# HG changeset patch
# User Sebastien Jodogne <s.jodogne@gmail.com>
# Date 1548867051 -3600
# Node ID 07a2f637b76d74ab295103edc7d61b1abe1e20c1
# Parent  fca730c267d7716d8eeb5472052beb9206e83d04
new option: "HttpThreadsCount" to set the number of threads in the embedded HTTP server

diff -r fca730c267d7 -r 07a2f637b76d Core/HttpServer/HttpServer.cpp
--- a/Core/HttpServer/HttpServer.cpp	Wed Jan 30 17:12:15 2019 +0100
+++ b/Core/HttpServer/HttpServer.cpp	Wed Jan 30 17:50:51 2019 +0100
@@ -1202,6 +1202,8 @@
     
     Stop();
     threadsCount_ = threads;
+
+    LOG(INFO) << "The embedded HTTP server will use " << threads << " threads";
   }
 
 
diff -r fca730c267d7 -r 07a2f637b76d NEWS
--- a/NEWS	Wed Jan 30 17:12:15 2019 +0100
+++ b/NEWS	Wed Jan 30 17:50:51 2019 +0100
@@ -4,7 +4,9 @@
 General
 -------
 
-* New configuration option: "MetricsEnabled" to track the metrics of Orthanc
+* New configuration options:
+  - "MetricsEnabled" to track the metrics of Orthanc
+  - "HttpThreadsCount" to set the number of threads in the embedded HTTP server
 
 REST API
 --------
diff -r fca730c267d7 -r 07a2f637b76d OrthancServer/main.cpp
--- a/OrthancServer/main.cpp	Wed Jan 30 17:12:15 2019 +0100
+++ b/OrthancServer/main.cpp	Wed Jan 30 17:50:51 2019 +0100
@@ -814,7 +814,7 @@
       httpDescribeErrors = lock.GetConfiguration().GetBooleanParameter("HttpDescribeErrors", true);
   
       // HTTP server
-      //httpServer.SetThreadsCount(50);
+      httpServer.SetThreadsCount(lock.GetConfiguration().GetUnsignedIntegerParameter("HttpThreadsCount", 50));
       httpServer.SetPortNumber(lock.GetConfiguration().GetUnsignedIntegerParameter("HttpPort", 8042));
       httpServer.SetRemoteAccessAllowed(lock.GetConfiguration().GetBooleanParameter("RemoteAccessAllowed", false));
       httpServer.SetKeepAliveEnabled(lock.GetConfiguration().GetBooleanParameter("KeepAlive", defaultKeepAlive));
diff -r fca730c267d7 -r 07a2f637b76d Resources/Configuration.json
--- a/Resources/Configuration.json	Wed Jan 30 17:12:15 2019 +0100
+++ b/Resources/Configuration.json	Wed Jan 30 17:50:51 2019 +0100
@@ -363,6 +363,9 @@
   // caveats: https://eklitzke.org/the-caveats-of-tcp-nodelay
   "TcpNoDelay" : true,
 
+  // Number of threads that are used by the embedded HTTP server.
+  "HttpThreadsCount" : 50,
+
   // If this option is set to "false", Orthanc will run in index-only
   // mode. The DICOM files will not be stored on the drive. Note that
   // this option might prevent the upgrade to newer versions of Orthanc.