powa-team/powa

"I/O Time" and "Blocks Written" is always 0B.

dan-aksenov opened this issue · 5 comments

Hello.
Thank you for this great application. Really saves me a lot of time.

My issue

"I/O Time" and "Blocks Written" is always 0B on "General Overview" page. For both database and query level

Although select from pg_stat_kcache shows non null values in write field.

I see I've got emtpy result from:
powa=# select * from pg_stat_statements where shared_blks_written > 0;

But got non empty from:
powa=# select * from pg_stat_kcache_detail where pg_stat_kcache_detail.writes > 0

My setup

Postgres 11.6
Extensions:

        Name        | Version |   Schema   |                        Description
--------------------+---------+------------+-----------------------------------------------------------
 btree_gist         | 1.5     | public     | support for indexing common datatypes in GiST
 hypopg             | 1.1.3   | public     | Hypothetical indexes for PostgreSQL
 pg_buffercache     | 1.3     | public     | examine the shared buffer cache
 pg_qualstats       | 1.0.9   | public     | An extension collecting statistics about quals
 pg_stat_kcache     | 2.1.1   | public     | Kernel statistics gathering
 pg_stat_statements | 1.6     | public     | track execution statistics of all SQL statements executed
 pg_track_settings  | 2.0.0   | public     | Track settings changes
 pg_wait_sampling   | 1.1     | public     | sampling based statistics of wait events
 plpgsql            | 1.0     | pg_catalog | PL/pgSQL procedural language
 powa               | 4.0.1   | public     | PostgreSQL Workload Analyser-core

rjuju commented

Hello @dan-aksenov

The root cause seems different in your case, as the UI seems to be correctly displaying what's being stored.

About IO timing, do you have track_io_timing activated?

Then, blocks written is indeed only shared block written, while pg_stat_kcache will see any write happening. Maybe you have temporary files being written? Another alternative would be if for some reason you have stored procedures that do writes on their own without using postgres infrastructure. In such case only pg_stat_kcache would be able to report any activity. Does any of those scenario applies to your case?

Thank you.

powa=# show track_io_timing;
 track_io_timing
-----------------
 off

That was my mistake.

I have a few (1 query right now) non null values values for "Temp Blocks read/written"

Our developers user stored procedures/functions alot, but they seems executing casual update/insert(within plpgsql).
What do you mean by

do writes on their own without using postgres infrastructure

?
Procedures in languages other than (plpg)sql?

rjuju commented

Procedures in languages other than (plpg)sql?

Yes, with a language that can do a write() directly.

I have a few (1 query right now) non null values values for "Temp Blocks read/written"

I see. One possibility would be that the queries reporting writes in pg_stat_kcache_detail aren't actually executed in the interval you're displaying on the UI. Can you check using a way bigger interval on the UI if you see writes on the main grid?

Yeh, on monthly interval ther are some Writes.
Sorry for wasting you time.

rjuju commented

No problem, I'm glad that everything's working fine!