pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
From: harikennedy (@harikennedy) <noreply+harikennedy@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #766: High LWLock Contention During Concurrent HNSW Index Scans
Date: Sat, 25 Jan 2025 20:33:48 +0000
Message-ID: <gh-pgvector-pgvector-766-c2614091304@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-766@github.com>
References: <gh-pgvector-pgvector-766@github.com>

Thanks for the response! 

I’d like to clarify that the issue doesn’t appear to be CPU saturation. During high concurrency workloads on a db.r5.8xlarge instance, CPU usage remains around 30–50%, while AWS Performance Insights shows LWLock:LockManager wait events dominating the load.

![Image](https://github.com/user-attachments/assets/d11e5fa0-8161-4dc0-b180-812591f8c5d0)

Shared locks like LockPage(..., HNSW_SCAN_LOCK, ShareLock) allow concurrent reads, but at high concurrency, the overhead of acquiring and releasing these locks seems to cause contention. This is evident as query throughput saturates at ~32 sessions and increasing concurrency beyond this only increases LWLock contention.

view thread (17+ messages)  latest in thread

Message-ID: <gh-pgvector-pgvector-766-c2614091304@github.com>
Permalink:  ../gh-pgvector-pgvector-766-c2614091304@github.com/

 · 


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