powa-team / powa

PostgreSQL Workload Analyzer
http://powa.readthedocs.io/
PostgreSQL License
768 stars 57 forks source link

Can powa work with Streaming Replication? #98

Closed walnut-tom closed 5 years ago

walnut-tom commented 7 years ago

Streaming Replication master and slave ,slave is read only, how ?

rjuju commented 7 years ago

Hello,

unfortunately only the extensions (pg_stat_statements, pg_qualstats...) will work on a slave, but no sampling will be done since the slave is read-only and for now the sampling is only done on the local node.

This is on our todo list (will probably be done with a centralized mode, see issue #16), but this will require a major rewrite in both the sampling functions and the UI, so it'll take some time.

walnut-tom commented 7 years ago

Thank you very much!

Do I understand that?

  1. slave needs to install the relevant modules;
  2. slave does not have local sampling data, but it can run normally without running error.
rjuju commented 7 years ago

Exactly. It's especially important to setup all relevant modules (including configurating shared_preload_libraries) if the standby servers can be promoted as primary. In this case, sampling will start automatically as soon as promotion is done.

bharattelange commented 6 years ago

Greetings,

Does this means there is no way in PoWA to analyse data of slave server until it is promoted as master? The reason we need to monitor slave servers because we have heavy read loads on our slave servers.

regards, Bharat

rjuju commented 6 years ago

Hello,

Unfortunately yes, that's what it means. The queries on the slave are never run on the master? If they're at least sometimes analysing the master should be enough.

bharattelange commented 6 years ago

Hi,

Thanks for the confirmation. Queries on slave are never run on master. Slave gets the load of all the read queries, none of them are being run on master. And we want to analyse the load on slave too before any performance impact.

regards, Bharat

rjuju commented 5 years ago

I'm closing this issue for now, as this will be solved with the bigger plan to implement a remote mode, mentioned in https://github.com/powa-team/powa/issues/16.

Some work has already be done on this, but a lot more is still needed. Don't worry, we don't forget your problem, and I hope we'll be able to implement it in a not too distance future.