Qihoo360 / zeppelin

A Scalable, High-Performance Distributed Key-Value Platform
Apache License 2.0
399 stars 81 forks source link

Set meaningful number of CPU's in data server #7

Open Leviathan1995 opened 7 years ago

Leviathan1995 commented 7 years ago

The data_thread_num is hardcoded in config file, and I think we could make this value is related to number of CPU's on the machine. For example, set data_thread_num to std::hardwared_concurrency()*0.75

baotiao commented 7 years ago

since hardware_concurrency just is hint of the system's concurrency thread number. And there is still many argues between the number of thread and the number of cpu cores. In my opinion, I would like to set the thread number equal to ther core-number * 1.5. There is a discussion to tell us why we should set thread number more than core number. Then main idea is that the disk IO operation may block the thread. when cpu run schedule() function, it's better to have another thread to run. I have forgot this article...

Leviathan1995 commented 7 years ago

Yes, I just suggest to set this option, but the number of thread will be discussed further.

baotiao commented 7 years ago

ok. you can add the data_thread_num to the config file.