-
Notifications
You must be signed in to change notification settings - Fork 570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Even distribution clients between threads #236
Comments
setting the config min-clients-per-thread to 0 will distribute clients across all threads evenly. By default we will try to bunch at least 50 clients to a thread. Usually, bunching a small number of clients results in lower overall latency as there is fixed overhead that needs to be overcome. |
I think the default of 50 is a bit too high though. I set that on a high clocked desktop CPU. Server CPUs tend to prefer a lower number, of around 20 or so. |
@JohnSully I've set min-clients-per-thread to 20, clients distribution and cpu looks better now. Thank you!
One more question. Why CPU with keydb instances so loaded? Now it's half of all traffic. |
Its a timely question, the reason it uses so much CPU is because its waiting in a spinlock. As of the next release we’ve dramatically reduced the lock contention and CPU usage is much lower. If you want a sneak peek give the unstable branch a try. |
I think, I can add more threads and waiting for new release. Thanks for answer! |
This bug tracks lowering the min-clients-per-thread setting to 20. |
When are you planning to release the next stable version? |
Hey @artful88533 I just tagged the release. Docker images are being built now and will be up soon. This fix is included. |
Unfortunately, after update, I don't see any improvement in CPU usage :(
|
@artful88533 You really want the minimum number of threads necessary for your workload. Usually 8 threads is more than sufficient for workloads with more clients than you have there. Each thread has overhead and using too many can reduce performance. A handful of clients will not saturate a thread, remember Redis handled many clients on its single thread - KeyDB’s server threads are essentially clones of that each one is capable of handling many clients. |
I originally implemented min-clients-per-thread because of a tendency to select too many threads. I’d recommend running memtier and observing what setup works best on your hardware when tweaking that setting. |
Hi! |
…tion-percent is a mutable config (#236)
Hello!
We have 3 separate redis instances. Now in top cpu used 80% and raising every month. So we decided to migrate to keydb 2 nodes with active-replica and multiple threads.
I've configured keydb with 8 threads, but the client's distribution not evenly. Also, we are using 3 haproxy load-balancing nodes on the front.
Is it normal that one thread load to 99.9%?
Run parameters
INFO
The text was updated successfully, but these errors were encountered: