Mercurial > dovecot > core-2.2
changeset 10008:a15182f41f30 HEAD
master: Added default_vsz_limit setting, which defaults to 256 MB.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 08 Oct 2009 20:49:31 -0400 |
parents | c862648185b8 |
children | bdd87f9ccccf |
files | doc/example-config/conf.d/master.conf src/master/master-settings.c src/master/master-settings.h src/master/service-process.c src/master/service.c src/master/service.h |
diffstat | 6 files changed, 13 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/example-config/conf.d/master.conf Thu Oct 08 20:43:25 2009 -0400 +++ b/doc/example-config/conf.d/master.conf Thu Oct 08 20:49:31 2009 -0400 @@ -1,5 +1,6 @@ default_process_limit = 100 default_client_limit = 1000 +default_vsz_limit = 256 service config { type = config
--- a/src/master/master-settings.c Thu Oct 08 20:43:25 2009 -0400 +++ b/src/master/master-settings.c Thu Oct 08 20:49:31 2009 -0400 @@ -169,6 +169,7 @@ DEF(SET_ENUM, ssl), DEF(SET_UINT, default_process_limit), DEF(SET_UINT, default_client_limit), + DEF(SET_UINT, default_vsz_limit), DEF(SET_BOOL, version_ignore), DEF(SET_BOOL, mail_debug), @@ -192,6 +193,7 @@ MEMBER(ssl) "yes:no:required", MEMBER(default_process_limit) 100, MEMBER(default_client_limit) 1000, + MEMBER(default_vsz_limit) 256, MEMBER(version_ignore) FALSE, MEMBER(mail_debug) FALSE,
--- a/src/master/master-settings.h Thu Oct 08 20:43:25 2009 -0400 +++ b/src/master/master-settings.h Thu Oct 08 20:49:31 2009 -0400 @@ -49,6 +49,7 @@ const char *ssl; unsigned int default_process_limit; unsigned int default_client_limit; + unsigned int default_vsz_limit; bool version_ignore; bool mail_debug;
--- a/src/master/service-process.c Thu Oct 08 20:43:25 2009 -0400 +++ b/src/master/service-process.c Thu Oct 08 20:49:31 2009 -0400 @@ -345,8 +345,8 @@ if (auth_args != NULL && service->set->master_set->mail_debug) env_put("DEBUG=1"); - if (service->set->vsz_limit != 0) - restrict_process_size(service->set->vsz_limit, -1U); + if (service->vsz_limit != 0) + restrict_process_size(service->vsz_limit, -1U); restrict_access_init(&rset); rset.uid = service->uid; @@ -658,11 +658,11 @@ case FATAL_LOGERROR: return "Internal logging error"; case FATAL_OUTOFMEM: - if (service->set->vsz_limit == 0) + if (service->vsz_limit == 0) return "Out of memory"; return t_strdup_printf("Out of memory (vsz_limit=%u MB, " "you may need to increase it)", - service->set->vsz_limit); + service->vsz_limit); case FATAL_EXEC: return "exec() failed";
--- a/src/master/service.c Thu Oct 08 20:43:25 2009 -0400 +++ b/src/master/service.c Thu Oct 08 20:49:31 2009 -0400 @@ -167,6 +167,9 @@ service->client_limit < set->service_count) service->client_limit = set->service_count; + service->vsz_limit = set->vsz_limit != 0 ? set->vsz_limit : + set->master_set->default_vsz_limit; + service->type = SERVICE_TYPE_UNKNOWN; if (*set->type != '\0') { if (strcmp(set->type, "log") == 0)
--- a/src/master/service.h Thu Oct 08 20:43:25 2009 -0400 +++ b/src/master/service.h Thu Oct 08 20:49:31 2009 -0400 @@ -70,6 +70,8 @@ /* Maximum number of client connections a process can handle. */ unsigned int client_limit; + /* set->vsz_limit or set->master_set->default_client_limit */ + unsigned int vsz_limit; /* log process pipe file descriptors. */ int log_fd[2];