]> granicus.if.org Git - icinga2/commitdiff
Improve IDO performance
authorGunnar Beutner <gunnar.beutner@netways.de>
Wed, 13 Jul 2016 12:44:53 +0000 (14:44 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Wed, 13 Jul 2016 12:44:53 +0000 (14:44 +0200)
refs #12147

lib/db_ido_mysql/idomysqlconnection.cpp

index 40f720b354aee77ab829a67d8a6ae5b6680b57d1..d0026826bd13bacca3efd99ffefcc7aae86cc5d9 100644 (file)
@@ -39,7 +39,7 @@ REGISTER_TYPE(IdoMysqlConnection);
 REGISTER_STATSFUNCTION(IdoMysqlConnection, &IdoMysqlConnection::StatsFunc);
 
 IdoMysqlConnection::IdoMysqlConnection(void)
-       : m_QueryQueue(1000000)
+       : m_QueryQueue(10000000)
 { }
 
 void IdoMysqlConnection::OnConfigLoaded(void)
@@ -453,6 +453,11 @@ void IdoMysqlConnection::AsyncQuery(const String& query, const boost::function<v
        aq.Query = query;
        aq.Callback = callback;
        m_AsyncQueries.push_back(aq);
+
+       if (m_AsyncQueries.size() > 25000) {
+               FinishAsyncQueries();
+               InternalNewTransaction();
+       }
 }
 
 void IdoMysqlConnection::FinishAsyncQueries(void)