From e0da430c424192c24f5089ceb97f37062349e9ef Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Thu, 14 Sep 2023 03:54:57 -0400 Subject: http and httpsys config options (#401) * Added `--http-threads`, `--httpsys-async-work-threads`, `--httpsys-enable-request-logging` and `--httpsys-enable-async-response` command line options to zenserver * remove unused CreateHttpSysServer --- src/zenserver/config.cpp | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'src/zenserver/config.cpp') diff --git a/src/zenserver/config.cpp b/src/zenserver/config.cpp index 7ec3a0cee..64acdfe73 100644 --- a/src/zenserver/config.cpp +++ b/src/zenserver/config.cpp @@ -793,11 +793,22 @@ ParseConfigFile(const std::filesystem::path& Path, LuaOptions.AddOption("server.objectstore.buckets"sv, ServerOptions.ObjectStoreConfig); ////// network - LuaOptions.AddOption("network.httpserverclass"sv, ServerOptions.HttpServerClass, "http"sv); + LuaOptions.AddOption("network.httpserverclass"sv, ServerOptions.HttpServerConfig.ServerClass, "http"sv); + LuaOptions.AddOption("network.httpserverthreads"sv, ServerOptions.HttpServerConfig.ThreadCount, "http-threads"sv); LuaOptions.AddOption("network.port"sv, ServerOptions.BasePort, "port"sv); LuaOptions.AddOption("network.websocket.port"sv, ServerOptions.WebSocketPort, "websocket-port"sv); LuaOptions.AddOption("network.websocket.threadcount"sv, ServerOptions.WebSocketThreads, "websocket-threads"sv); + LuaOptions.AddOption("network.httpsys.async.workthreads"sv, + ServerOptions.HttpServerConfig.HttpSys.AsyncWorkThreadCount, + "httpsys-async-work-threads"sv); + LuaOptions.AddOption("network.httpsys.async.response"sv, + ServerOptions.HttpServerConfig.HttpSys.IsAsyncResponseEnabled, + "httpsys-enable-async-response"sv); + LuaOptions.AddOption("network.httpsys.requestlogging"sv, + ServerOptions.HttpServerConfig.HttpSys.IsRequestLoggingEnabled, + "httpsys-enable-request-logging"sv); + ////// trace LuaOptions.AddOption("trace.host"sv, ServerOptions.TraceHost, "tracehost"sv); LuaOptions.AddOption("trace.file"sv, ServerOptions.TraceFile, "tracefile"sv); @@ -1037,9 +1048,16 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions) "", "http", "Select HTTP server implementation (asio|httpsys|null)", - cxxopts::value(ServerOptions.HttpServerClass)->default_value(DefaultHttp), + cxxopts::value(ServerOptions.HttpServerConfig.ServerClass)->default_value(DefaultHttp), ""); + options.add_option("network", + "", + "http-threads", + "Number of http server connection threads", + cxxopts::value(ServerOptions.HttpServerConfig.ThreadCount), + ""); + options.add_option("network", "p", "port", @@ -1061,6 +1079,27 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions) cxxopts::value(ServerOptions.WebSocketThreads)->default_value("0"), ""); + options.add_option("httpsys", + "", + "httpsys-async-work-threads", + "Number of HttpSys async worker threads", + cxxopts::value(ServerOptions.HttpServerConfig.HttpSys.AsyncWorkThreadCount), + ""); + + options.add_option("httpsys", + "", + "httpsys-enable-async-response", + "Enables Httpsys async response", + cxxopts::value(ServerOptions.HttpServerConfig.HttpSys.IsAsyncResponseEnabled)->default_value("true"), + ""); + + options.add_option("httpsys", + "", + "httpsys-enable-request-logging", + "Enables Httpsys request logging", + cxxopts::value(ServerOptions.HttpServerConfig.HttpSys.IsRequestLoggingEnabled), + ""); + #if ZEN_WITH_TRACE options.add_option("ue-trace", "", -- cgit v1.2.3