If the config->workers is zero, the number of worker threads is
determinated based on the number of CPU cores.
Signed-off-by: Eduardo Silva <edsiper@gmail.com>
config->default_mimetype = mk_string_dup(MIMETYPE_DEFAULT_TYPE);
mk_mimetype_read_config();
+ /*
+ * If the worker numbers have not be set, set the number based on
+ * the number of CPU cores
+ */
+ if (config->workers < 1) {
+ config->workers = sysconf(_SC_NPROCESSORS_ONLN);
+ }
+
config->worker_capacity = mk_server_worker_capacity(config->workers);
config->max_load = (config->worker_capacity * config->workers);