Add hints to increase max_children config variable if we're hitting the maximum
authordbs <dbs@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 11 Jan 2011 23:00:35 +0000 (23:00 +0000)
committerdbs <dbs@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 11 Jan 2011 23:00:35 +0000 (23:00 +0000)
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
src/perl/lib/OpenSRF/Server.pm

index c5a2f27..c61374a 100644 (file)
@@ -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..." );
index c525bba..279c4a5 100644 (file)
@@ -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}});