mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-24 18:30:11 +01:00
Retire piler child after processing max_requests_per_child messages
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
ae1d551db4
commit
15c9fa7101
@ -45,7 +45,7 @@ number_of_worker_processes=2
|
|||||||
max_connections=64
|
max_connections=64
|
||||||
|
|
||||||
; number of processed emails per each piler process
|
; number of processed emails per each piler process
|
||||||
max_requests_per_child=1000
|
max_requests_per_child=10000
|
||||||
|
|
||||||
; SMTP HELO identification string
|
; SMTP HELO identification string
|
||||||
; this should be the FQDN part of the email address
|
; this should be the FQDN part of the email address
|
||||||
|
@ -81,7 +81,7 @@ struct _parse_rule config_parse_rules[] =
|
|||||||
{ "listen_port", "integer", (void*) int_parser, offsetof(struct config, listen_port), "25", sizeof(int)},
|
{ "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},
|
{ "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_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_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_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)},
|
{ "memcached_ttl", "integer", (void*) int_parser, offsetof(struct config, memcached_ttl), "86400", sizeof(int)},
|
||||||
|
12
src/piler.c
12
src/piler.c
@ -283,13 +283,13 @@ void child_main(struct child *ptr){
|
|||||||
|
|
||||||
sig_unblock(SIGHUP);
|
sig_unblock(SIGHUP);
|
||||||
|
|
||||||
// TODO: do we want to quit after processing a certain number of messages?
|
// 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;
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
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
|
#ifdef HAVE_MEMCACHED
|
||||||
|
Loading…
Reference in New Issue
Block a user