summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@ugent.be>2017-04-01 13:45:51 +0200
committerdimitri staessens <dimitri.staessens@ugent.be>2017-04-01 14:28:59 +0200
commitc72634b5d921bc06d8e06afb2a60a05a1acb7ee2 (patch)
tree833a7f4133fb3f3f8d746343cff6fb9fc40f7829 /include
parent47b6ff3333fb3fcc3f5f76459c356c79e4bb111c (diff)
downloadouroboros-c72634b5d921bc06d8e06afb2a60a05a1acb7ee2.tar.gz
ouroboros-c72634b5d921bc06d8e06afb2a60a05a1acb7ee2.zip
irmd: Add dynamic threadpool
This makes the IRMd add/remove worker threads dynamically. IRMD_TPM_TIMEOUT sets a timer in the threadpool manager for checking idle threads. Each time this timer expires, it will reduce the threadpool by one. IRMD_MIN_AV_THREADS is the minimum number of available worker threads. If the number of active threads goes under this threshold, the threadpool manager will create threads to get the number of threads to IRMD_MAX_AV_THREADS, unless IRMD_MAX_THREADS is reached.
Diffstat (limited to 'include')
-rw-r--r--include/ouroboros/config.h.in11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/ouroboros/config.h.in b/include/ouroboros/config.h.in
index 7616961c..067a2f85 100644
--- a/include/ouroboros/config.h.in
+++ b/include/ouroboros/config.h.in
@@ -35,7 +35,7 @@
#define IPCP_SHIM_ETH_LLC_EXEC "@IPCP_SHIM_ETH_LLC_TARGET@"
#define IPCP_NORMAL_EXEC "@IPCP_NORMAL_TARGET@"
#define IPCP_LOCAL_EXEC "@IPCP_LOCAL_TARGET@"
-#define AP_MAX_FLOWS 256
+#define AP_MAX_FLOWS 2048
#define AP_MAX_FQUEUES 64
#define SHM_RDRB_BLOCK_SIZE sysconf(_SC_PAGESIZE)
#define SHM_RDRB_MULTI_BLOCK
@@ -47,14 +47,19 @@
#define SHM_RBUFF_PREFIX "/ouroboros.rbuff."
#define SHM_FLOW_SET_PREFIX "/ouroboros.sets."
#define IRMD_MAX_FLOWS 4096
-#define IRMD_THREADPOOL_SIZE 16
+/* IRMD dynamic threadpooling */
+#define IRMD_MIN_AV_THREADS 16
+#define IRMD_MAX_AV_THREADS 64
+#define IRMD_MAX_THREADS 256
+
#define IPCPD_THREADPOOL_SIZE 16
#define IPCPD_MAX_CONNS IRMD_MAX_FLOWS
#define PTHREAD_COND_CLOCK CLOCK_MONOTONIC
#define PFT_SIZE 1 << 12
/* Timeout values */
+#define IRMD_TPM_TIMEOUT 1000
#define IRMD_ACCEPT_TIMEOUT 100
-#define IRMD_REQ_ARR_TIMEOUT 200
+#define IRMD_REQ_ARR_TIMEOUT 500
#define IRMD_FLOW_TIMEOUT 5000
#define IPCP_ACCEPT_TIMEOUT 100
#define SOCKET_TIMEOUT 4000