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

@ -136,6 +136,7 @@ public:
mxs::SRWBackend m_target_node; /**< The currently locked target node */
mxs::SRWBackend m_prev_target; /**< The previous target where a query was sent */
Config m_config; /**< Configuration for this session */
int m_last_keepalive_check; /**< When the last ping was done */
int m_nbackends; /**< Number of backend servers (obsolete) */
DCB* m_client; /**< The client DCB */
uint64_t m_sescmd_count; /**< Number of executed session commands */