diff options
author | dormando <dormando@rydia.net> | 2022-12-05 14:04:11 -0800 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2022-12-06 22:33:13 -0800 |
commit | 146c6489fccf659bbb98e5012169661e7dfc7b69 (patch) | |
tree | ee53f42f0f9ffb87eafa342cf0f4b8b61ac3041b /proxy.h | |
parent | 1ba5df8410e7ccc035390438e45b26c2d11ede5c (diff) | |
download | memcached-146c6489fccf659bbb98e5012169661e7dfc7b69.tar.gz |
proxy: IO thread performance improvements
1) more IOV's per syscall
2) if a backend got a large stack of pending IO's + continual writes the
CPU usage of the IO thread would bloat while looping past already
flushed IO objects.
Diffstat (limited to 'proxy.h')
-rw-r--r-- | proxy.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -292,8 +292,8 @@ typedef STAILQ_HEAD(io_head_s, _io_pending_proxy_t) io_head_t; // TODO (v2): IOV_MAX tends to be 1000+ which would allow for more batching but we // don't have a good temporary space and don't want to malloc/free on every // write. transmit() uses the stack but we can't do that for uring's use case. -#if (IOV_MAX > 128) -#define BE_IOV_MAX 128 +#if (IOV_MAX > 1024) +#define BE_IOV_MAX 1024 #else #define BE_IOV_MAX IOV_MAX #endif @@ -306,6 +306,7 @@ struct mcp_backend_s { STAILQ_ENTRY(mcp_backend_s) be_next; // stack for backends STAILQ_ENTRY(mcp_backend_s) beconn_next; // stack for connecting conns io_head_t io_head; // stack of requests. + io_pending_proxy_t *io_next; // next request to write. char *rbuf; // statically allocated read buffer. size_t rbufused; // currently active bytes in the buffer struct event event; // libevent |