Make keepalive ping checks more efficient

The code now only checks the need for a keepalive ping once every
keepalive interval. Reduced the number of mxs_clock calls to one so that
all servers use the same value.
This commit is contained in:
Markus Mäkelä
2018-12-09 14:33:50 +02:00
parent 5420bf618d
commit 1fa3b133c7
3 changed files with 20 additions and 14 deletions

View File

@ -17,6 +17,7 @@
#include <maxscale/modutil.hh>
#include <maxscale/poll.h>
#include <maxscale/clock.h>
using namespace maxscale;
@ -28,11 +29,11 @@ RWSplitSession::RWSplitSession(RWSplit* instance,
, m_backends(backends)
, m_current_master(master)
, m_config(instance->config())
, m_last_keepalive_check(mxs_clock())
, m_nbackends(instance->service()->n_dbref)
, m_client(session->client_dcb)
, m_sescmd_count(1)
, // Needs to be a positive number to work
m_expected_responses(0)
, m_expected_responses(0)
, m_query_queue(NULL)
, m_router(instance)
, m_sent_sescmd(0)