From 9d332f9b0fb5f4dcdb8aadc8e80de661305ccb71 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 16 Feb 2021 15:10:43 -0500 Subject: [PATCH] TT#111357 use a better default for recording threads Change-Id: Id9f3d0404505e87bf785e52680c5a771d6d58828 --- recording-daemon/main.c | 5 ++++- recording-daemon/rtpengine-recording.pod | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/recording-daemon/main.c b/recording-daemon/main.c index b4319ddc8..affd70b22 100644 --- a/recording-daemon/main.c +++ b/recording-daemon/main.c @@ -31,7 +31,7 @@ int ktable = 0; -int num_threads = 8; +int num_threads; enum output_storage_enum output_storage = OUTPUT_STORAGE_FILE; char *spool_dir = NULL; char *output_dir = NULL; @@ -272,6 +272,9 @@ static void options(int *argc, char ***argv) { die("Invalid mode value '%s'", chmod_mode); output_chmod = m; } + + if (num_threads <= 0) + num_threads = num_cpu_cores(8); } static void options_free(void) { diff --git a/recording-daemon/rtpengine-recording.pod b/recording-daemon/rtpengine-recording.pod index 882610ad9..c07ba178a 100644 --- a/recording-daemon/rtpengine-recording.pod +++ b/recording-daemon/rtpengine-recording.pod @@ -118,7 +118,9 @@ reside on a file system that supports the B mechanism. =item B<--num-threads=>I -How many worker threads to launch. Defaults to B<8>. +How many worker threads to launch. Defaults to the number of CPU cores +available, or B<8> if there are fewer than that or if the number is not +known. =item B<--thread-stack=>I