From 5b3f8bb3cd81cab29a55acaa2defdd2e46e83edd Mon Sep 17 00:00:00 2001 From: dbs Date: Tue, 11 Jan 2011 23:00:35 +0000 Subject: [PATCH] Add hints to increase max_children config variable if we're hitting the maximum Already added this hint to the Python implementation, now propagating to C and Perl. git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@2142 9efc2488-bf62-4759-914b-345cdb29e865 --- src/libopensrf/osrf_prefork.c | 10 +++++++--- src/perl/lib/OpenSRF/Server.pm | 5 +++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/libopensrf/osrf_prefork.c b/src/libopensrf/osrf_prefork.c index c5a2f27..c61374a 100644 --- a/src/libopensrf/osrf_prefork.c +++ b/src/libopensrf/osrf_prefork.c @@ -797,9 +797,13 @@ static void prefork_run( prefork_simple* forker ) { honored = 1; } } - - } - } + } else { + osrfLogWarning( OSRF_LOG_MARK, "Could not launch a new child as %d children " + "were already running; consider increasing max_children for this " + "application higher than %d in the OpenSRF configuration if this " + "message occurs frequently", + forker->current_num_children, forker->max_children ); + } if( !honored ) { osrfLogWarning( OSRF_LOG_MARK, "No children available, waiting..." ); diff --git a/src/perl/lib/OpenSRF/Server.pm b/src/perl/lib/OpenSRF/Server.pm index c525bba..279c4a5 100644 --- a/src/perl/lib/OpenSRF/Server.pm +++ b/src/perl/lib/OpenSRF/Server.pm @@ -129,8 +129,9 @@ sub run { $self->write_child($self->spawn_child(1), $msg); } else { - - $logger->warn("server: no children available, waiting..."); + $logger->warn("server: no children available, waiting... consider increasing " . + "max_children for this application higher than $self->{max_children} ". + "in the OpenSRF configuration if this message occurs frequently"); $self->check_status(1); # block until child is available my $child = pop(@{$self->{idle_list}}); -- 2.43.2