[MXS-3845] Sending binlog events is inefficient Created: 2021-11-02  Updated: 2022-01-13  Resolved: 2021-11-17

Status: Closed
Project: MariaDB MaxScale
Component/s: binlogrouter
Affects Version/s: 2.5.16, 6.1.4
Fix Version/s: 2.5.17, 6.2.0

Type: Bug Priority: Major
Reporter: markus makela Assignee: Niclas Antti
Resolution: Fixed Votes: 0
Labels: None

Sprint: MXS-SPRINT-144

 Description   

Sending replication events to clients causes multiple intermediate buffers to be used when the event could be loaded directly into memory that is sent to the client. Most of this can be fixed in 2.5 by adjusting the network packet creation code to be smarter.

In addition, a switch from std::vector to GWBUF would also fix the problem where the current use of std::vector::resize to allocate memory causes the new memory to be default-initialized before new data overwrites it. This means that for each replicated event there's an extra memset that isn't needed. A one-time measurement showed that this was about half of the CPU time spent on non-MaxScale code. This needs verification but the inefficiently is there regardless of its severity.


Generated at Thu Feb 08 04:24:22 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.