diff options
author | Maria Matejka <mq@ucw.cz> | 2023-01-19 10:49:47 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2023-01-19 11:13:50 +0100 |
commit | 84c298465f6360a8694d4837f3420961ea321fa5 (patch) | |
tree | 273455bf0e6f1b7a1be8956692feacbf6b3484a3 /sysdep/unix/config.Y | |
parent | 4d8d81f144e72fe2e182d7569087f2a8c8c5b938 (diff) |
Decoupling loops from threads to allow fixed thread count
On large configurations, too many threads would spawn with one thread
per loop. Therefore, threads may now run multiple loops at once. The
thread count is configurable and may be changed during run. All threads
are spawned on startup.
This change helps with memory bloating. BIRD filters need large
temporary memory blocks to store their stack and also memory management
keeps its hot page storage per-thread.
Known bugs:
* Thread autobalancing is not yet implemented.
* Low latency loops are executed together with standard loops.
Diffstat (limited to 'sysdep/unix/config.Y')
-rw-r--r-- | sysdep/unix/config.Y | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sysdep/unix/config.Y b/sysdep/unix/config.Y index 5c4b5bef..a50ec757 100644 --- a/sysdep/unix/config.Y +++ b/sysdep/unix/config.Y @@ -101,6 +101,12 @@ mrtdump_base: ; +conf: THREADS expr { + if ($2 < 1) cf_error("Number of threads must be at least one."); + new_config->thread_count = $2; +} + + conf: debug_unix ; debug_unix: @@ -145,6 +151,11 @@ CF_CLI_HELP(GRACEFUL, restart, [[Shut the daemon down for graceful restart]]) CF_CLI(GRACEFUL RESTART,,, [[Shut the daemon down for graceful restart]]) { cmd_graceful_restart(); } ; +CF_CLI(SHOW THREADS,,, [[Write out thread information]]) +{ cmd_show_threads(0); } ; + +CF_CLI(SHOW THREADS ALL,,, [[Write out thread and IO loop information]]) +{ cmd_show_threads(1); } ; cfg_name: /* empty */ { $$ = NULL; } |