diff --git a/etc/init.d/icinga2.cmake b/etc/init.d/icinga2.cmake index 2d86ecebc..f65da997f 100644 --- a/etc/init.d/icinga2.cmake +++ b/etc/init.d/icinga2.cmake @@ -54,7 +54,8 @@ start() { fi echo "Starting Icinga 2: " - ulimit -n 8192 + ulimit -n 32768 + ulimit -s 512 $DAEMON -c $ICINGA2_CONFIG_FILE -d -e $ICINGA2_ERROR_LOG -u $ICINGA2_USER -g $ICINGA2_GROUP echo "Done" diff --git a/lib/base/threadpool.cpp b/lib/base/threadpool.cpp index 7557e0083..1e184c3ba 100644 --- a/lib/base/threadpool.cpp +++ b/lib/base/threadpool.cpp @@ -23,6 +23,7 @@ #include "base/debug.h" #include "base/utility.h" #include "base/scriptvariable.h" +#include "base/application.h" #include #include #include @@ -254,7 +255,7 @@ void ThreadPool::ManagerThreadProc(void) /* Spawn more workers if there are outstanding work items. */ if (tthreads > 0 && pending > 0) - tthreads = 8; + tthreads = (Utility::GetTime() - Application::GetStartTime() < 300) ? 128 : 8; std::ostringstream msgbuf; msgbuf << "Thread pool; current: " << alive << "; adjustment: " << tthreads; diff --git a/lib/base/threadpool.h b/lib/base/threadpool.h index e1abdfb0d..657f33b2d 100644 --- a/lib/base/threadpool.h +++ b/lib/base/threadpool.h @@ -73,7 +73,7 @@ private: static int m_NextID; boost::thread_group m_Threads; - ThreadStats m_ThreadStats[512]; + ThreadStats m_ThreadStats[4096]; double m_WaitTime; double m_ServiceTime;