diff options
author | dormando <dormando@rydia.net> | 2023-01-13 15:22:26 -0800 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2023-02-24 17:43:54 -0800 |
commit | 6442017c545a2a5ad076697b8695cd64bd32b542 (patch) | |
tree | a95c5443a72f5cfbe5b1c32fe5cf552da3201b0c /memcached.h | |
parent | 833a7234bbaed264a9973141850a23df4eb1b939 (diff) | |
download | memcached-6442017c545a2a5ad076697b8695cd64bd32b542.tar.gz |
proxy: allow workers to run IO optionally
`mcp.pool(p, { dist = etc, iothread = true }`
By default the IO thread is not used; instead a backend connection is
created for each worker thread. This can be overridden by setting
`iothread = true` when creating a pool.
`mcp.pool(p, { dist = etc, beprefix = "etc" }`
If a `beprefix` is added to pool arguments, it will create unique
backend connections for this pool. This allows you to create multiple
sockets per backend by making multiple pools with unique prefixes.
There are legitimate use cases for sharing backend connections across
different pools, which is why that is the default behavior.
Diffstat (limited to 'memcached.h')
-rw-r--r-- | memcached.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/memcached.h b/memcached.h index 4790c75..79b9a81 100644 --- a/memcached.h +++ b/memcached.h @@ -703,6 +703,7 @@ typedef struct { int notify_send_fd; /* sending end of notify pipe */ #endif int cur_sfd; /* client fd for logging commands */ + int thread_baseid; /* which "number" thread this is for data offsets */ struct thread_stats stats; /* Stats generated by this thread */ io_queue_cb_t io_queues[IO_QUEUE_COUNT]; struct conn_queue *ev_queue; /* Worker/conn event queue */ @@ -723,6 +724,7 @@ typedef struct { void *proxy_hooks; void *proxy_user_stats; void *proxy_int_stats; + void *proxy_event_thread; // worker threads can also be proxy IO threads uint32_t proxy_rng[4]; // fast per-thread rng for lua. // TODO: add ctx object so we can attach to queue. #endif |