Skip to content

Conversation

@proton-lisandro-pin
Copy link

The MySQL Binlog Reader currently pushes an update to every connected ProxySQL server every time it sees a GTID change; for complex database setups, this can have a significant impact in network usage.

This merge request implements a new option (-t) to batch and write updates every x milliseconds, instead of immediately after every GTID event.

A few new options will be introduced by the following commits.
If enabled, binlog reader will push updates to ProxySQL clients
ever X milliseconds, with all GTID events ocurring in that period.
When update message buffers are too big writes to ProxySQL
clients fail, as binlog reader tries to perform these in a
single write() call. This behavior is particularly noticeable
when -t is enabled, and causes ProxySQL to disconnect, and
immediately connect back.

This commit reworks writes to batch in chunks of a maximum
configurable size - currently 4kb.
23fb45d introduced a hard limit of max 2Kb write queues, which
can be (easly) hit with throttled updates. This commit fixes the
issue, and also reworks `Client_Data` memory management logic
to avoid fragementation.
@renecannao
Copy link
Contributor

Hi @proton-lisandro-pin .
Sorry for the delay in reviewing this PR.
Adding assignee

@proton-lisandro-pin
Copy link
Author

proton-lisandro-pin commented Oct 24, 2025

Hi @proton-lisandro-pin . Sorry for the delay in reviewing this PR. Adding assignee

Appreciated, thanks!

If this PR is accepted, i'm planning to looking into combining GTIDs for batched updates to reduce bandwidth usage as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants