Re: How to log 'user time' in postgres logs

From: francis picabia <fpicabia(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to log 'user time' in postgres logs
Date: 2019-08-29 11:43:18
Message-ID: CA+AKB6HZDRD8HDAvgoh7v94VtRP6jdK5gwi9DaiZ6uCQK35g8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Aug 28, 2019 at 4:51 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> francis picabia <fpicabia(at)gmail(dot)com> writes:
> > The server was running Moodle. The slow load time was noticed when
> loading
> > a quiz containing
> > multiple images. All Apache log results showed a 6 seconds or a multiple
> > of 6 for how long
> > it took to retrieve each image.
>
> > Interestingly, if I did a wget, on the server, to the image link (which
> was
> > processed through a pluginfile.php URL)
> > even the HTML page returned of "please login first" took consistently 6
> > seconds. Never 2, 3, 4, 5 or 7, 8, 9...
> > So whatever was wrong, there was a 6 second penalty for this.
>
> Hmm ... some weird DNS behavior, perhaps? That is one way to explain
> a pattern like this. How long does it take to "dig" or "nslookup"
> your server name?
>
> regards, tom lane
>

Nope, it isn't DNS related. The dev server uses same DNS service and
was very fast to do the same actions. I also run the DNS server and would
be aware
of any complaints about the performance. I thought firewall for awhile but
there was
nothing there related to it.

It all cleared up minutes after the *vacuum -a -v -z *was run,
and was reported slow several days before this. I myself saw it
consistently slow
for the quiz for the 2.5 days I fought the problem. We're certain the
vacuum
made the difference in performance.

If there is no way to log the "user time", I guess we'd need to log
something
like the connection and disconnection to get another idea on the time
elapsing.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Willy-Bas Loos 2019-08-29 12:15:55 implicit transaction changes trigger behaviour
Previous Message Luca Ferrari 2019-08-29 11:34:23 Re: Question about password character in ECPG's connection string