powa-team / powa

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

powa isnt getting enabled in shared_preload_libraries #170

Closed sajiljosephs closed 1 year ago

sajiljosephs commented 1 year ago

Screenshot from 2023-05-03 13-47-31 Screenshot from 2023-05-03 13-47-06

in postgresql.conf shared_preload_libraries = 'pg_stat_statements,powa,pg_stat_kcache,pg_qualstats,pg_wait_sampling'

show shared_preload_libraries; pg_stat_statements, pg_qualstats, pg_stat_kcache

select count(*) from pg_stat_statements; 1080

screenshots clearly says that all required extensions are enabled.

rjuju commented 1 year ago

Hi,

I'm not entirely sure of what your problem is. If the problem is "Collector status for this instance: stopped" and the "stopped" status in the servers page, the reason is that powa.frequency is set to -1, which means "no local snapshot". If you want to use the local mode (a single server for your data and powa data), then you need to choose a positive value for powa.frequency. A good general value is '5min' to get decent granularity without much overhead.

sajiljosephs commented 1 year ago

background worker is not connected. On checking could see that powa is not getting enabled with shared_preload_libraries As it is not enabled, powa.frequency cannot be set in postgresql.conf

sajiljosephs commented 1 year ago

Screenshot from 2023-05-03 14-15-45

rjuju commented 1 year ago

On checking could see that powa is not getting enabled with shared_preload_libraries

Do you mean that when doing "SHOW shared_preload_libraries;" powa doesn't appear? Did you restart postgres after configuring shared_preload_libraries?

sajiljosephs commented 1 year ago

Yes, restarted postgres many times. powa doesnt appear with "SHOW shared_preload_libraries;"

rjuju commented 1 year ago

Then the shared_preload_libraries is being configured from somewhere else. Maybe someone used ALTER SYSTEM, or you have the same setting configured later in the same file or an included file. You can check where the setting is actually coming from using:

SELECT name, setting, source, sourcefile, sourceline FROM pg_settings WHERE name = 'shared_preload_libraries';

Modify the really used file and restart and the new value should be applied.

sajiljosephs commented 1 year ago

Perfect, Thanks for helping out.

rjuju commented 1 year ago

Great news!