summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2016-12-19 16:00:56 -0800
committerdormando <dormando@rydia.net>2016-12-19 16:00:56 -0800
commit4dc24dcccd5df1bc0c00169434296075688d68e7 (patch)
tree4a8b1d22bc8b70bd1ba2219d5b8695279fddcfaf /thread.c
parent99b55790619a066212919a702fcd1e2bf9835fa2 (diff)
downloadmemcached-4dc24dcccd5df1bc0c00169434296075688d68e7.tar.gz
scale item hash lock with more worker threads
the thread scalability is much higher than when the bucket count was tested. Increasing this has a relatively small effect, but still worth adjusting. More strict testing should be done to more properly scale the table; as well ad adjusting for false-sharing issues given table entries that border each other.
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/thread.c b/thread.c
index b623180..0a01eed 100644
--- a/thread.c
+++ b/thread.c
@@ -741,9 +741,13 @@ void memcached_thread_init(int nthreads) {
power = 11;
} else if (nthreads < 5) {
power = 12;
- } else {
- /* 8192 buckets, and central locks don't scale much past 5 threads */
+ } else if (nthreads <= 10) {
power = 13;
+ } else if (nthreads <= 20) {
+ power = 14;
+ } else {
+ /* 32k buckets. just under the hashpower default. */
+ power = 15;
}
if (power >= hashpower) {