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: Thu, 06 Feb 2025 21:57:32 +0000
Message-ID: <gh-pgvector-pgvector-766-c2641151018@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-766@github.com>
References: <gh-pgvector-pgvector-766@github.com>
For reference, here were the settings in my earlier post:
- Hardware: 32 vCPUs, 256GB RAM
- Dimension: <100
- PostgreSQL Version: 16.4
- pgVector Version: 0.7.3
- HNSW Params: m=16, efc=512, efs=1 to 20
@ankane @greenhal I made a few changes since then, including upgrading the hardware and pgvector version. Here’s the new setup:
- Hardware: 64 vCPUs, 256GB RAM
- Dimension: <100
- PostgreSQL Version: 16.5
- pgVector Version: 0.8.0
- HNSW Params: m=16, efc=max
After the upgrade, I noticed saturation occurring around ~40 sessions, even though CPU utilization remained below 30% and sessions were underutilized. This behavior aligns with what @greenhal mentioned earlier except for CPU util.
However, I also observed that saturation depends on ef_search: lower values result in session underutilization, while increasing ef_search shifts the saturation point.
For efs=1

For efs=10

QPS remained constant from ef_search = 1 to ef_search = 10 (this changes with the dataset size), which is different from what I observed in pgVector 0.7.3, where QPS was higher for lower ef_search values and gradually decreased as expected. In the new setup, QPS only starts decreasing beyond a certain point (eg: ef_search = 10).
Would be curious to hear if others have noticed similar behavior or have any pointers into why this change might have occurred.