mirror of
https://github.com/milvus-io/milvus.git
synced 2026-07-21 10:15:43 +00:00
This PR adds lightweight active thread observability for named C++ thread pools. - name FileWriteWorkerPool threads with the `MILVUS_FL_WR_` prefix - sample named OS threads every 5 seconds and export `milvus_thread_cpu_active_num_by_pool` - classify active named threads by CPU-time delta or runnable/uninterruptible state - show active named C++ thread pools in the Runtime / OS Threads Grafana panel by `pod` and `thread_pool` - skip `/proc/self/task` collection on non-Linux platforms issue: #50066 Performance note for the named thread active sampler: I measured the cost of one sampling round by creating 128 / 512 / 1024 OS threads and repeatedly running the same `/proc/self/task` based collection path. Each benchmark was run in a separate `go test` process for 10 rounds to avoid OS-thread reuse affecting the result. - Idle: about 2.1 ms for 128 threads, 7.9 ms for 512 threads, and 16.0 ms for 1024 threads per sampling round. - Under 64 concurrent search workload: about 5.1 ms for 128 threads, 18.3 ms for 512 threads, and 34.1 ms for 1024 threads per sampling round. The sampler runs every 5 seconds, so even the 1024-thread case under search load is about 34 ms / 5000 ms, or below 0.7% of one CPU core. The current standalone test process had around 116 OS threads, closer to the 128-thread case. Based on this, the expected runtime overhead is low. Signed-off-by: CLiQing <2208529306@qq.com>