From 31cfa14935a836ad78c3c7cd401a387e3f66b4d6 Mon Sep 17 00:00:00 2001 From: tikikun Date: Tue, 19 Dec 2023 13:53:04 +0700 Subject: [PATCH] feat: add more threads for core services --- controllers/llamaCPP.cc | 2 +- main.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/llamaCPP.cc b/controllers/llamaCPP.cc index b76140a25..849940d01 100644 --- a/controllers/llamaCPP.cc +++ b/controllers/llamaCPP.cc @@ -435,7 +435,7 @@ bool llamaCPP::loadModelImpl(const Json::Value &jsonBody) { gpt_params params; // By default will setting based on number of handlers - int drogon_thread = drogon::app().getThreadNum() - 1; + int drogon_thread = drogon::app().getThreadNum() - 5; LOG_INFO << "Drogon thread is:" << drogon_thread; if (jsonBody) { if (!jsonBody["mmproj"].isNull()) { diff --git a/main.cc b/main.cc index a1c6187fd..0c4534493 100644 --- a/main.cc +++ b/main.cc @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) { LOG_INFO << "Server started, listening at: " << host << ":" << port; LOG_INFO << "Please load your model"; drogon::app().addListener(host, port); - drogon::app().setThreadNum(thread_num + 1); + drogon::app().setThreadNum(thread_num + 5); LOG_INFO << "Number of thread is:" << drogon::app().getThreadNum(); drogon::app().run();