Transparent Huge Pages (THP) — recommended configuration for production deployments? #9051
Replies: 7 comments 4 replies
-
|
To be honest, we haven't extensively tested this. I therefore cannot say whether it will be beneficial or not. My best guess is that it would behave similarly to the other databases you've mentioned. We did run a few tests with a larger default page size (64K), which did show a performance regression. But this has been some time ago.
No, we do not. If possible, I'd recommend to test it out on your own hardware to get an idea of the performance characteristics. |
Beta Was this translation helpful? Give feedback.
-
|
I ran into a similar situation when setting up a production Qdrant environment on Ubuntu 20.04. At first, I had THP set to "always" because that was the default on our servers. However, I noticed sporadic latency issues during peak operations, which tracked back to memory compaction. I switched the THP setting to "madvise" to see if that would help. You can do this by running After the change, I didn't experience the previous stalls, so for our deployment, "madvise" was the sweet spot. But keep an eye on your specific workload, as results might vary depending on the data and access patterns. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks a lot, guys! Your answers are very appreciated. For the moment, it's enough info for me. |
Beta Was this translation helpful? Give feedback.
-
|
Oh interesting, you're hitting the THP question for Qdrant — that’s a good one, and honestly not super well-documented for newer vector DBs like this. For what it’s worth, we ran into this exact debate with a high-traffic vector search setup on The short answer: set it to As for whether Qdrant specifically uses Curious: what’s your target data size and memory-to-disk ratio? If you’re doing large-scale queries with constrained RAM, you might also want to experiment with |
Beta Was this translation helpful? Give feedback.
-
|
hm, yeah, if you're on the latest v2.x, the docs mention that THP setting, but honestly, we saw the same stalls even then. If you're on v3, they’ve reworked some mem handling — might be worth checking if that improves things. BTW, here’s a thread with some deeper dev notes on THP tweaks: https://github.com/qdrant/qdrant/discussions/xxxxx — lmk if that’s helpful or if you see differences on your end. |
Beta Was this translation helpful? Give feedback.
-
|
We’ve run Qdrant in production for real-time vector search (mostly HNSW), and THP has consistently been a pain point for latency-sensitive workloads. When THP is set to always, we’ve observed unpredictable stalls—especially during compaction—similar to issues seen in Redis and MongoDB. These stalls can spike query latency from sub-50ms to several hundred ms, which is unacceptable for interactive search. Our setup:
Why disable?
Shell snippet we use at deployment: echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defragUnless Qdrant changes its internal allocations or advertises hugepage support, “never” is the safe bet for production—especially for workloads with mmap-heavy vector indices. |
Beta Was this translation helpful? Give feedback.
-
|
yeah that memory handling stuff in v3 looks promising — should reduce some of the mmap overhead we fought with. heads up tho, the default THP setting sometimes sneaks back on after reboots, so double-check there. lmk if you want a quick script snippet to enforce it on startup? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm setting up a production Qdrant deployment on Linux and want to understand the recommended OS-level configuration for Transparent Huge Pages (THP).
Specifically:
Context: Qdrant relies heavily on mmap for vector index segments (HNSW). Many databases (MongoDB, Redis, TiDB) explicitly recommend disabling THP due to compaction stalls causing latency spikes. Is the same true
for Qdrant?
Any official guidance or documented recommendation would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions