-
Notifications
You must be signed in to change notification settings - Fork 30
Calculation and Interpretation of Net/Delay* #52
Description
First of all: Thanks for providing this great way to get further insights into Postgres Network analysis! We were so interested in this approach in my group, that I worked on my own version of this. This is due to the fact, that I we cannot construct extra tables in the public schema of a customer, so I just perform the necessary SELECTs into pg_stat_activity and aggregate them via a Python script.
I have one last open point concerning the Net/Delay* value. The central statement for this, seems to me this (in gather_report.sql):
CASE WHEN (itr_max - itr_min)::float/itr.gitr_max2000 - pidwcnt > 0 THEN', Net/Delay: ' || round(((itr_max - itr_min)::float/itr.gitr_max2000 - pidwcnt)::numeric100/2000,2) || '%'
From my results, I suspect that itr.gitr_max will mostly equal wait_events such as 'WalWriterMain', which you "always see".
Looking at my evaluations, I suspect hat Net/Delay* may include sometimes "counts" from idle connections. In another statement, we exclude those (in gather.sql):
SELECT pid || E'\t' || COALESCE(wait_event,'\N') FROM pg_stat_get_activity(NULLIF(pg_sleep(0.01)::text,'')::INT) WHERE (state != 'idle' OR state IS NULL) AND pid != pg_backend_pid();
Is this an invalid concern?
Thanks a lot again,
Thomas