diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2020-06-25 22:59:46 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2020-06-25 22:59:46 +0200 |
commit | 060564653d5812b33e3198ecd407b373846532aa (patch) | |
tree | 7acfe06e8124f9136e698ad244d713ac53e88d15 /myisam/mi_update.c | |
parent | 9160e4aa95cd3c40ea0733d632692526049ed12b (diff) | |
download | mariadb-git-bb-10.5-wlad-tpwin.tar.gz |
MDEV-22990 Threadpool : Optimize network/named pipe IO for Windowsbb-10.5-wlad-tpwin
This patch reduces the overhead of system calls prior to a query, for
threadpool. Previously, 3 system calls were done
1. WSARecv() to get notification of input data from client, asynchronous
equivalent of select() in one-thread-per-connection
2. recv(4 bytes) - reading packet header length
3. recv(packet payload)
Now there will be usually, just WSARecv(), which pre-reads user data into
a buffer, so we spared 2 syscalls
Profiler shows the most expensive call WSARecv(16%CPU) becomes 4% CPU,
after the patch, benchmark results (network heavy ones like point-select)
improve by ~20%
The buffer management was rather carefully done to keep
buffers together, as Windows would keeps the pages pinned
in memory for the duration of async calls.
At most 1MB memory is used for the buffers, and overhead per-connection is
only 256 bytes, which should cover most of the uses.
SSL does not yet use the optmization, so far it does not properly use
VIO for reads and writes. Neither one-thread-per-connection would get any
benefit, but that should be fine, it is not even default on Windows.
Diffstat (limited to 'myisam/mi_update.c')
0 files changed, 0 insertions, 0 deletions