summaryrefslogtreecommitdiff
path: root/memcached.c
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2023-01-13 15:22:26 -0800
committerdormando <dormando@rydia.net>2023-02-24 17:43:54 -0800
commit6442017c545a2a5ad076697b8695cd64bd32b542 (patch)
treea95c5443a72f5cfbe5b1c32fe5cf552da3201b0c /memcached.c
parent833a7234bbaed264a9973141850a23df4eb1b939 (diff)
downloadmemcached-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.c')
-rw-r--r--memcached.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/memcached.c b/memcached.c
index adaf162..70cc8e3 100644
--- a/memcached.c
+++ b/memcached.c
@@ -6053,9 +6053,6 @@ int main (int argc, char **argv) {
#ifdef PROXY
if (settings.proxy_enabled) {
settings.proxy_ctx = proxy_init(settings.proxy_uring);
- if (proxy_load_config(settings.proxy_ctx) != 0) {
- exit(EXIT_FAILURE);
- }
}
#endif
#ifdef EXTSTORE
@@ -6067,6 +6064,14 @@ int main (int argc, char **argv) {
init_lru_crawler(NULL);
#endif
+#ifdef PROXY
+ if (settings.proxy_enabled) {
+ if (proxy_first_confload(settings.proxy_ctx) != 0) {
+ exit(EXIT_FAILURE);
+ }
+ }
+#endif
+
if (start_assoc_maint && start_assoc_maintenance_thread() == -1) {
exit(EXIT_FAILURE);
}