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