Skip to content

Commit f5f9c2c

Browse files
knikolov82AlCutter
authored andcommitted
Fix thread starvation in case all threads from internal pool process add-chain request.
1 parent 2ad95c3 commit f5f9c2c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cpp/server/ct-server.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,13 @@ int main(int argc, char* argv[]) {
117117
CHECK(db) << "No database instance created, check flag settings";
118118

119119
shared_ptr<libevent::Base> event_base(make_shared<libevent::Base>());
120-
ThreadPool internal_pool(8);
120+
121+
// We need to create internal pool with at least double of http server threads,
122+
// in order to avoid thread starvation. The issue occurs when all threads from
123+
// internal pool are processing add-chain request, as during processing
124+
// additional thread from internal pool is needed for each request for adding
125+
// pending entry to etcd server.
126+
ThreadPool internal_pool(FLAGS_num_http_server_threads * 2);
121127
UrlFetcher url_fetcher(event_base.get(), &internal_pool);
122128

123129
const bool stand_alone_mode(cert_trans::IsStandalone(true));

0 commit comments

Comments
 (0)