diff --git a/userspace/falco/webserver.cpp b/userspace/falco/webserver.cpp index 46e0fa81..dba93973 100644 --- a/userspace/falco/webserver.cpp +++ b/userspace/falco/webserver.cpp @@ -15,6 +15,7 @@ limitations under the License. */ #include "webserver.h" +#include "falco_utils.h" #include falco_webserver::~falco_webserver() @@ -46,6 +47,10 @@ void falco_webserver::start( m_server = new httplib::Server(); } + // configure server + auto threadiness = std::min(2u, falco::utils::hardware_concurrency()); + m_server->new_task_queue = [&threadiness] { return new httplib::ThreadPool(threadiness); }; + // setup healthz endpoint m_server->Get(healthz_endpoint, [](const httplib::Request &, httplib::Response &res) { diff --git a/userspace/falco/webserver.h b/userspace/falco/webserver.h index 1da0d185..7a022b0b 100644 --- a/userspace/falco/webserver.h +++ b/userspace/falco/webserver.h @@ -16,6 +16,7 @@ limitations under the License. #pragma once #define CPPHTTPLIB_OPENSSL_SUPPORT +#define CPPHTTPLIB_ZLIB_SUPPORT #include #include #include "configuration.h"