MXS-1690: Need Backpressure mechanism (#169)

* implication of backpressure

* fix typo and refactor

* misc refactor

* misc fix

* add function session_unlink_backend_dcb and more comments

* misc fix

* refactor, move all throttling logic into dcb.cc

* misc fix

* misc fix
This commit is contained in:
dapeng
2018-03-07 18:34:47 +08:00
committed by Johan Wikman
parent d6b8147119
commit 82bb624981
6 changed files with 185 additions and 2 deletions

View File

@ -168,6 +168,8 @@ extern const char CN_USER[];
extern const char CN_USERS[];
extern const char CN_VERSION_STRING[];
extern const char CN_WEIGHTBY[];
extern const char CN_WRITEQ_HIGH_WATER[];
extern const char CN_WRITEQ_LOW_WATER[];
/**
* The config parameter
@ -233,6 +235,8 @@ typedef struct
bool substitute_variables; /**< Should environment variables be substituted */
char* local_address; /**< Local address to use when connecting */
time_t users_refresh_time; /**< How often the users can be refreshed */
uint32_t writeq_high_water; /**< High water mark of dcb write queue */
uint32_t writeq_low_water; /**< Low water mark of dcb write queue */
} MXS_CONFIG;
/**
@ -503,4 +507,18 @@ bool config_reload(void);
*/
json_t* config_maxscale_to_json(const char* host);
/**
* @brief Get DCB write queue high water mark
*
* @return Number of high water mark in bytes
*/
uint32_t config_writeq_high_water();
/**
* @brief Get DCB write queue low water mark
*
* @return @return Number of low water mark in bytes
*/
uint32_t config_writeq_low_water();
MXS_END_DECLS