From: Matthias Apitz <guru@unixarea.de>
To: Postgres General <pgsql-general@postgresql.org>
Subject: Mysterious performance degradation in exceptional cases
Date: Wed, 14 Sep 2022 10:31:26 +0200
Message-ID: <20220914083126.GA9@sh4-5.1blu.de> (raw)
We have a C-written application server which uses ESQL/C on top
of PostgreSQL 13.1 on Linux. The application in question always serves
the same search in a librarian database, given to the server
as commands over the network, login into the application and doing
a search:
SLNPServerInit
User:zfl
SLNPEndCommand
SLNPSearch
HitListName:Zfernleihe
Search:1000=472214284
SLNPEndCommand
To fulfill the search, the application server has to do some 100
ESQL/C calls and all this should not take longer than 1-2 seconds, and
normally it does not take longer. But, in some situations it takes
longer than 180 seconds, in 10% of the cases. The other 90% are below 2 seconds,
i.e. this is digital: Or 2 seconds, or more than 180 seconds, no values between.
We can easily simulate the above with a small shell script just sending over
the above two commands with 'netcat' and throwing away its result (the real search is
done by an inter library loan software which has an timeout of 180 seconds
to wait for the SLNPSearch search result -- that's why we got to know
about the problem at all, because all this is running automagically with
no user dialogs). The idea of the simulated search was to get to know
with the ESQL/C log files which operation takes so long and why.
Well, since some day, primary to catch the situation, we send over every
10 seconds this simulated searches and since then the problem went away at all.
The Linux server where all this is running is highly equipped with memory and CPUs
and 99% idle.
The picture, that the problem went away with our test search every 10 seconds,
let me think in something like "since we keep the PostgreSQL server busy
that way it has not chance to go into some kind of deeper sleep" (for
example being swapped out or whatever).
Any ideas about this?
matthias
--
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: guru@unixarea.de
Subject: Re: Mysterious performance degradation in exceptional cases
In-Reply-To: <20220914083126.GA9@sh4-5.1blu.de>
References: <20220914083126.GA9@sh4-5.1blu.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox