diff --git a/etc/example.conf b/etc/example.conf index f9c368b6..dc7a4d12 100644 --- a/etc/example.conf +++ b/etc/example.conf @@ -45,7 +45,7 @@ number_of_worker_processes=2 max_connections=64 ; number of processed emails per each piler process -max_requests_per_child=1000 +max_requests_per_child=10000 ; SMTP HELO identification string ; this should be the FQDN part of the email address diff --git a/src/cfg.c b/src/cfg.c index 27e21db2..490011b6 100644 --- a/src/cfg.c +++ b/src/cfg.c @@ -81,7 +81,7 @@ struct _parse_rule config_parse_rules[] = { "listen_port", "integer", (void*) int_parser, offsetof(struct config, listen_port), "25", sizeof(int)}, { "locale", "string", (void*) string_parser, offsetof(struct config, locale), "", MAXVAL-1}, { "max_connections", "integer", (void*) int_parser, offsetof(struct config, max_connections), "64", sizeof(int)}, - { "max_requests_per_child", "integer", (void*) int_parser, offsetof(struct config, max_requests_per_child), "1000", sizeof(int)}, + { "max_requests_per_child", "integer", (void*) int_parser, offsetof(struct config, max_requests_per_child), "10000", sizeof(int)}, { "memcached_servers", "string", (void*) string_parser, offsetof(struct config, memcached_servers), "127.0.0.1", MAXVAL-1}, { "memcached_to_db_interval", "integer", (void*) int_parser, offsetof(struct config, memcached_to_db_interval), "900", sizeof(int)}, { "memcached_ttl", "integer", (void*) int_parser, offsetof(struct config, memcached_ttl), "86400", sizeof(int)}, diff --git a/src/piler.c b/src/piler.c index cf0d9416..16c59dc6 100644 --- a/src/piler.c +++ b/src/piler.c @@ -283,13 +283,13 @@ void child_main(struct child *ptr){ sig_unblock(SIGHUP); - // TODO: do we want to quit after processing a certain number of messages? - - //if(cfg.max_requests_per_child > 0 && ptr->messages >= cfg.max_requests_per_child){ - // if(cfg.verbosity >= _LOG_DEBUG) syslog(LOG_PRIORITY, "child (pid: %d, serial: %d) served enough: %d", getpid(), ptr->messages, ptr->serial); - // break; - //} + // Let the child quit after processing max_requests_per_child messages + if(cfg.max_requests_per_child > 0 && ptr->messages >= cfg.max_requests_per_child){ + if(cfg.verbosity >= _LOG_DEBUG) + syslog(LOG_PRIORITY, "child (pid: %d, serial: %d) served enough: %d", getpid(), ptr->messages, ptr->serial); + break; + } } #ifdef HAVE_MEMCACHED