aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-14 17:48:46 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-14 17:48:46 +0100
commite229b6dd55b04b155b17fcb8c09b9f7e602c4913 (patch)
tree40163e7cfe4ec72308b359fa13e464bd70e538a2 /src/libserver
parent784746733a95d847e741a2d74153e99349b52fee (diff)
downloadrspamd-e229b6dd55b04b155b17fcb8c09b9f7e602c4913.tar.gz
rspamd-e229b6dd55b04b155b17fcb8c09b9f7e602c4913.zip
[Fix] Add configurable number of threads for OpenBLAS
Issue: #3082
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/cfg_file.h1
-rw-r--r--src/libserver/cfg_rcl.c8
-rw-r--r--src/libserver/cfg_utils.c1
3 files changed, 9 insertions, 1 deletions
diff --git a/src/libserver/cfg_file.h b/src/libserver/cfg_file.h
index 4eea4db16..3ee832d5a 100644
--- a/src/libserver/cfg_file.h
+++ b/src/libserver/cfg_file.h
@@ -463,6 +463,7 @@ struct rspamd_config {
guint lua_gc_pause; /**< lua gc pause */
guint full_gc_iters; /**< iterations between full gc cycle */
guint max_lua_urls; /**< maximum number of urls to be passed to Lua */
+ guint max_blas_threads; /**< maximum threads for openblas when learning ANN */
GList *classify_headers; /**< list of headers using for statistics */
struct module_s **compiled_modules; /**< list of compiled C modules */
diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c
index 5ef913f36..7936c8725 100644
--- a/src/libserver/cfg_rcl.c
+++ b/src/libserver/cfg_rcl.c
@@ -2200,7 +2200,13 @@ rspamd_rcl_config_init (struct rspamd_config *cfg, GHashTable *skip_sections)
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_config, max_lua_urls),
RSPAMD_CL_FLAG_INT_32,
- "Maximum count of URLs to pass to Lua to avoid DoS");
+ "Maximum count of URLs to pass to Lua to avoid DoS (default: 1024)");
+ rspamd_rcl_add_default_handler (sub,
+ "max_blas_threads",
+ rspamd_rcl_parse_struct_integer,
+ G_STRUCT_OFFSET (struct rspamd_config, max_blas_threads),
+ RSPAMD_CL_FLAG_INT_32,
+ "Maximum number of Blas threads for learning neural networks (default: 1)");
/* Neighbours configuration */
rspamd_rcl_add_section_doc (&sub->subsections, "neighbours", "name",
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index 5851e250f..98a50bea3 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -196,6 +196,7 @@ rspamd_config_new (enum rspamd_config_init_flags flags)
cfg->log_error_elt_maxlen = 1000;
cfg->cache_reload_time = 30.0;
cfg->max_lua_urls = 1024;
+ cfg->max_blas_threads = 1;
/* Default log line */
cfg->log_format_str = "id: <$mid>,$if_qid{ qid: <$>,}$if_ip{ ip: $,}"