Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYTEs-0003Xp-QX for pgsql-general@arkaria.postgresql.org; Wed, 14 Sep 2022 14:19:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oYTEr-0006g0-OL for pgsql-general@arkaria.postgresql.org; Wed, 14 Sep 2022 14:19:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYTEq-0006fE-Lk for pgsql-general@lists.postgresql.org; Wed, 14 Sep 2022 14:19:41 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYTEn-0007XY-FS for pgsql-general@postgresql.org; Wed, 14 Sep 2022 14:19:39 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 23DA23200A2B; Wed, 14 Sep 2022 10:19:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 14 Sep 2022 10:19:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1663165172; x= 1663251572; bh=qn73IgubzJK7DAc8tDXaPM7RBG4cKHBSunIukZVQp5k=; b=l xgq0jdqzHNXs1JWERtVnV8mz3XPbvH7BGEC3Ghns/0PK7VkEZq8a419wmUfGlsYf ASmYkBNiKRcjrUIg6YEXPTGyUywZ3n5598NJLDVNvoCF7PWmfgtBCwGR73zc3huD Ny8uMOvVaiEXyU3f9e5QxWGKdQWxO3hBB+Cw1ZIxi0oRWcXj4QMZWTxE1KTLkTiw kbV9NZ71e54zT3gfIv2URDizZVPdoMo+c/Ak6qfDAQTMwsSOUZ7ph5G/F9xP7KnT oQ04nwlnGft0slUMPB8s6njNsjPtV0WLgwaB74FNMDUBp0OwWAdrs/GMRcLUbBe+ /Vy4G3tEKwaLsVQ1Bi6/Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1663165172; x=1663251572; bh=q n73IgubzJK7DAc8tDXaPM7RBG4cKHBSunIukZVQp5k=; b=SXf5BWCSajhsham5A 07BNNjiCQ86vyv1Ehufpf+H+2oSF3qg/7xZ6XkZr7o0BEFxvc2w+PxBNSyFi8oXh RbRIq2Dqa4qmQzR2L+TAEmIVqZFlL805sRK/OmDMxvz2Y+bR4lJStZSx//g2POH6 6P9UY9MDf+VNa/2WjZO47u3RWER1sq50SPJQMthdP7EXwoYZkjbwdeJ88pUHDOR3 Cb/tJdrkJzsh8h9Xxfcuvl7THVI6BfNSrG5SBAjRCcA5Sj2U0TItI/qkkMUfSbsZ laKJJiTxRLq5QpuPjBrnPmagfY0fCUqn+6T81LerpcIF3AQJNzcV8v47NjMXWZ6w gzNog== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeduiedgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthejredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeevvdekiefhudfhhfdtkeelgeffudeigfetjeegfffg hfetfeelledugfelleegveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 14 Sep 2022 10:19:31 -0400 (EDT) Message-ID: <1474a2c4-b254-e1b1-bf3c-90f41bed3528@aklaver.com> Date: Wed, 14 Sep 2022 07:19:31 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: Mysterious performance degradation in exceptional cases Content-Language: en-US To: Matthias Apitz , Postgres General References: <20220914083126.GA9@sh4-5.1blu.de> From: Adrian Klaver In-Reply-To: <20220914083126.GA9@sh4-5.1blu.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/14/22 01:31, Matthias Apitz wrote: > > 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. Does the test search run the inter library loan software? > > 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. To be clear the problem went away for the real search? Where is the inter library software, in your application or are you reaching out to another application? Is the search running across a remote network? > > 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 -- Adrian Klaver adrian.klaver@aklaver.com