]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
*-login: For Pro edition, default to "high performance mode"
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 28 Feb 2025 09:22:54 +0000 (11:22 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 7 Mar 2025 08:01:55 +0000 (10:01 +0200)
src/imap-login/imap-login-settings.c
src/pop3-login/pop3-login-settings.c
src/submission-login/submission-login-settings.c

index ba4e2dc3fdbaef84bd989306e724c498babb57e5..f4e0c49d7bb6d04d1964461dba0988f192e02d20 100644 (file)
@@ -20,7 +20,9 @@ struct service_settings imap_login_service_settings = {
 
        .drop_priv_before_exec = FALSE,
 
+#ifndef DOVECOT_PRO_EDITION
        .restart_request_count = 1,
+#endif
 
        .unix_listeners = ARRAY_INIT,
        .fifo_listeners = ARRAY_INIT,
@@ -80,6 +82,10 @@ static const struct setting_keyvalue imap_login_default_settings_keyvalue[] = {
        { "service/imap-login/imap_capability/LITERAL+", "yes" },
        { "service/imap-login/imap_capability/LITERAL-", "yes" },
        { "imap_id_send/name", DOVECOT_NAME },
+#ifdef DOVECOT_PRO_EDITION
+       { "service/imap-login/service_process_limit", "%{system:cpu_count}" },
+       { "service/imap-login/service_process_min_avail", "%{system:cpu_count}" },
+#endif
        { NULL, NULL },
 };
 
index 8ecf742d60d0350b3f8ea3a68e05f115be14ecb0..a4e1bdd547b5c58ef508d2318e8d243bfdfb2ed3 100644 (file)
@@ -20,7 +20,9 @@ struct service_settings pop3_login_service_settings = {
 
        .drop_priv_before_exec = FALSE,
 
+#ifndef DOVECOT_PRO_EDITION
        .restart_request_count = 1,
+#endif
 
        .unix_listeners = ARRAY_INIT,
        .fifo_listeners = ARRAY_INIT,
@@ -46,6 +48,14 @@ const struct setting_keyvalue pop3_login_service_settings_defaults[] = {
        { NULL, NULL }
 };
 
+static const struct setting_keyvalue pop3_login_default_settings_keyvalue[] = {
+#ifdef DOVECOT_PRO_EDITION
+       { "service/pop3-login/service_process_limit", "%{system:cpu_count}" },
+       { "service/pop3-login/service_process_min_avail", "%{system:cpu_count}" },
+#endif
+       { NULL, NULL },
+};
+
 static const struct setting_define pop3_login_setting_defines[] = {
        SETTING_DEFINE_LIST_END
 };
@@ -54,4 +64,5 @@ const struct setting_parser_info pop3_login_setting_parser_info = {
        .name = "pop3_login",
 
        .defines = pop3_login_setting_defines,
+       .default_settings = pop3_login_default_settings_keyvalue,
 };
index a8b883dc3ad2615eb94a60070d69a720ca7c7d7d..767fd6b137db0d4a4e353b3039eec1c3770525de 100644 (file)
@@ -24,7 +24,9 @@ struct service_settings submission_login_service_settings = {
 
        .drop_priv_before_exec = FALSE,
 
+#ifndef DOVECOT_PRO_EDITION
        .restart_request_count = 1,
+#endif
 
        .unix_listeners = ARRAY_INIT,
        .fifo_listeners = ARRAY_INIT,
@@ -74,11 +76,20 @@ static const struct submission_login_settings submission_login_default_settings
        .submission_backend_capabilities = ARRAY_INIT,
 };
 
+static const struct setting_keyvalue submission_login_default_settings_keyvalue[] = {
+#ifdef DOVECOT_PRO_EDITION
+       { "service/submission-login/service_process_limit", "%{system:cpu_count}" },
+       { "service/submission-login/service_process_min_avail", "%{system:cpu_count}" },
+#endif
+       { NULL, NULL },
+};
+
 const struct setting_parser_info submission_login_setting_parser_info = {
        .name = "submission_login",
 
        .defines = submission_login_setting_defines,
        .defaults = &submission_login_default_settings,
+       .default_settings = submission_login_default_settings_keyvalue,
 
        .struct_size = sizeof(struct submission_login_settings),
        .pool_offset1 = 1 + offsetof(struct submission_login_settings, pool),