From ddcc4074e5fd45e26e9dcd434e30fdcd696c824a Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Sun, 27 Sep 2020 21:58:57 -0400 Subject: [PATCH] more workers helps in some cases without hurting others. apparently --- cgi.d | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cgi.d b/cgi.d index 87f3833..5820876 100644 --- a/cgi.d +++ b/cgi.d @@ -4472,7 +4472,7 @@ class ListeningConnectionManager { if(epoll_ctl(epfd, EPOLL_CTL_ADD, listener.handle, &ev) == -1) throw new Exception("epoll_ctl " ~ to!string(errno)); - WorkerThread[] threads = new WorkerThread[](totalCPUs + 1); + WorkerThread[] threads = new WorkerThread[](totalCPUs * 2 + 1); foreach(i, ref thread; threads) { thread = new WorkerThread(this, handler, cast(int) i); thread.start(); @@ -9851,6 +9851,7 @@ private struct StackBuffer { this(int a) { buffer = initial[]; + position = 0; } void add(in char[] what) {