darold / pgbadger

A fast PostgreSQL Log Analyzer
http://pgbadger.darold.net/
PostgreSQL License
3.49k stars 349 forks source link

Odd session statistics #774

Closed KaiHanne closed 9 months ago

KaiHanne commented 1 year ago

With our SQL off-loading instance we see odd session statistics in the Global Stats overview: e.g. 557 total sessions 7,068 session peak I'm wondering how a total of 557 session could result in a peak of 7,068 sessions. image We have 5 production instances for which we collect and generate daily statistics with PGBadger. All instances show "normal" global session stats but this one always reports odd stats. I cannot add the log file in case of further analysis because of it's size (195MB gzipped).

darold commented 1 year ago

Hi, can you send a link to download the file to < pgbadger AT darold DOT net >?

KaiHanne commented 1 year ago

Hi Darold,

Send through Wetransfer.

Regards | Met vriendelijke groet,

Gert Jan Willems

darold commented 1 year ago

Got it, thanks.

darold commented 1 year ago

Running pgbadger on your log give me the following results:

Sessions:
      61,821 Total number of sessions
    3,631 sessions at 2023-04-18 12:32:23 Session peak

which is correct.

Are you running pgbadger in incremental mode or just on this single log file? What version are you using?

KaiHanne commented 1 year ago

I’m running pgbadger in single log file mode and i’ve just ran it with the 12.1 version:

We are running Centos 7.9 on VMWARE VM WITH 36GB MEM AND 2 CPU’S.

If you need more info please let me know.

darold commented 1 year ago

yes, please post here your pgbadger command.

KaiHanne commented 1 year ago

e.g.

pgbadger -v postgresql-2.log -U postgres -U pgadmin -b 06:00:00 -e 20:00:00 -o out-tue-16-04.html

KaiHanne commented 1 year ago

When i run pgbadger without the optional switches (-U and -b -e) then i get the following results:

61,821 Total number of sessions 7,068 sessions at 2023-04-18 19:12:14 Session peak

KaiHanne commented 1 year ago

Our logline prefix: log_line_prefix = '%t [%p]: user=%u,db=%d,app=%a,client=%h '

darold commented 9 months ago

Not reproducible or fixed with latest development code. Closing.