summaryrefslogtreecommitdiff
path: root/proxy.h
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2022-12-05 14:04:11 -0800
committerdormando <dormando@rydia.net>2022-12-06 22:33:13 -0800
commit146c6489fccf659bbb98e5012169661e7dfc7b69 (patch)
treeee53f42f0f9ffb87eafa342cf0f4b8b61ac3041b /proxy.h
parent1ba5df8410e7ccc035390438e45b26c2d11ede5c (diff)
downloadmemcached-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.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/proxy.h b/proxy.h
index 66b4748..f12ec1e 100644
--- a/proxy.h
+++ b/proxy.h
@@ -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