apache / incubator-pegasus

Apache Pegasus - A horizontally scalable, strongly consistent and high-performance key-value store
https://pegasus.apache.org/
Apache License 2.0
1.96k stars 310 forks source link

feat: Add 2 options to limit thread count #2011

Closed acelyc111 closed 1 month ago

acelyc111 commented 1 month ago

There are 2 options stats_dump_period_sec and stats_persist_period_sec in RocksDB to adjust the period to dump/persist stat, each RocksDB instance creates 2 dependent threads for this aim.

A replica server is possible to serve thousands of replicas, it means thousands of RocksDB instances are possible to be running in one process, then thousands of threads will be created will may consume much resouce.

This patch introduces 2 options, then it's possible to disable the threads by setting them to 0.