Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i33ya-00005X-LI for pgsql-general@arkaria.postgresql.org; Wed, 28 Aug 2019 19:51:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i33yY-0005ME-VK for pgsql-general@arkaria.postgresql.org; Wed, 28 Aug 2019 19:51:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i33yY-0005Kg-KA for pgsql-general@lists.postgresql.org; Wed, 28 Aug 2019 19:51:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i33yW-0004gt-I9 for pgsql-general@postgresql.org; Wed, 28 Aug 2019 19:51:26 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x7SJpLdf029680; Wed, 28 Aug 2019 15:51:21 -0400 From: Tom Lane To: francis picabia cc: pgsql-general@postgresql.org Subject: Re: How to log 'user time' in postgres logs In-reply-to: References: <94ac4f4a-452e-02cd-a91c-4db3afbd4a2b@aklaver.com> Comments: In-reply-to francis picabia message dated "Wed, 28 Aug 2019 15:36:00 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29678.1567021881.1@sss.pgh.pa.us> Date: Wed, 28 Aug 2019 15:51:21 -0400 Message-ID: <29679.1567021881@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk francis picabia 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