summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavan Deolasee2015-07-09 06:04:58 +0000
committerPavan Deolasee2015-07-09 06:04:58 +0000
commitd04572065de0ce390243448a6b2cf5d763f02fae (patch)
treef9682fe6fcfccd475f8012511ed8f1831ebfa1d3
parentfbb248f9d70de66b556971285826eb338d687f9b (diff)
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
-rw-r--r--src/gtm/proxy/proxy_main.c4
1 files changed, 3 insertions, 1 deletions
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)