From 3cb0546c10d5c957b6463f25d0ed8505082dc933 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 1 Nov 2014 20:37:35 +1100 Subject: [PATCH] Recruit extra stratum receive processes based on number of CPUs --- src/stratifier.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stratifier.c b/src/stratifier.c index bf780df2..8251c06a 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -3579,10 +3579,12 @@ int stratifier(proc_instance_t *pi) mutex_init(&ckdb_lock); ssends = create_ckmsgq(ckp, "ssender", &ssend_process); - srecvs = create_ckmsgq(ckp, "sreceiver", &srecv_process); /* Create half as many share processing threads as there are CPUs */ threads = sysconf(_SC_NPROCESSORS_ONLN) / 2 ? : 1; sshareq = create_ckmsgqs(ckp, "sprocessor", &sshare_process, threads); + /* Create 1/4 as many stratum processing threads as there are CPUs */ + threads = threads / 2 ? : 1; + srecvs = create_ckmsgqs(ckp, "sreceiver", &srecv_process, threads); sauthq = create_ckmsgq(ckp, "authoriser", &sauth_process); ckdbq = create_ckmsgq(ckp, "ckdbqueue", &ckdbq_process); stxnq = create_ckmsgq(ckp, "stxnq", &send_transactions);