From d04572065de0ce390243448a6b2cf5d763f02fae Mon Sep 17 00:00:00 2001 From: Pavan Deolasee Date: Thu, 9 Jul 2015 11:34:58 +0530 Subject: [PATCH] Reduce timeout for poll() from 1000ms to 10ms in GTM proxy. This was a source of significant slow down for regression tests when tested in a setup with GTM proxies. When there are not many concurrent clients connecting to a GTM proxy, poll() may not return until timeout occurs, thus slowing requests coming after the poll was started make installcheck now runs at least 3 times faster with GTM proxies --- src/gtm/proxy/proxy_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gtm/proxy/proxy_main.c b/src/gtm/proxy/proxy_main.c index 2ea1b1025a..0534ee4a31 100644 --- a/src/gtm/proxy/proxy_main.c +++ b/src/gtm/proxy/proxy_main.c @@ -68,6 +68,7 @@ extern char *optarg; #endif #endif +static int poll_timeout_ms = 10; static char *progname = "gtm_proxy"; char *ListenAddresses; int GTMProxyPortNumber; @@ -1314,7 +1315,8 @@ GTMProxy_ThreadMain(void *argp) while (true) { Enable_Longjmp(); - nrfds = poll(thrinfo->thr_poll_fds, thrinfo->thr_conn_count, 1000); + nrfds = poll(thrinfo->thr_poll_fds, thrinfo->thr_conn_count, + poll_timeout_ms); Disable_Longjmp(); if (nrfds < 0) -- 2.39.5