LWLock optimization - Mailing list pgsql-general

From Alexander Pyhalov
Subject LWLock optimization
Date
Msg-id VI1PR05MB620666631A41186ACC3FC91ACFC70@VI1PR05MB6206.eurprd05.prod.outlook.com
Whole thread Raw
Responses Re: LWLock optimization  (Andres Freund <andres@anarazel.de>)
List pgsql-general
Hi.

I was asked to bring up this topic on maling lists after asking question on IRC.

The issue is the following.
On one of our servers (10.5), I see a lot of queries with wait_event_type='LWLock', wait_event='lock_manager'

This is a stat gathering/analyzing application with tables which have > 100 partitions.
The queries itself are mostly simple (select by pkey, update by primary key and so on).

 select count(*) from pg_locks shows about 40K  records (all granted) and

 select count(*) from (select distinct
locktype,database,relation,page,tuple,virtualxid,transactionid,classid,objid,objsubidfrom pg_locks)  

is varying from about 1K to 25K (I haven't stored this value in monitoring system, just observed manually).

Currently I was adviced to increase LOG2_NUM_LOCK_PARTITIONS at compile time. If it bothers us enough, we would likely
doit, but I have a question,  if this  (or NUM_LOCK_PARTITIONS) value should be increased by default  or set tunable? 


С уважением,
Александр Пыхалов,
программист отдела телекоммуникационной инфраструктуры
управления информационно-коммуникационной инфраструктуры ЮФУ




pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_upgrade : 9.X to 11.X issue CentoOS 7.6
Next
From: Adrian Klaver
Date:
Subject: Re: Default ordering option