You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ro...@imdb.com> on 1997/01/15 17:16:20 UTC

Re: [BUG]: "MinSpareServers shouldn't be greater than MaxSpareServers" on SunOS 4.x

Hi,

Thanks for the info. We'll see if anything can be done before 1.2 is
released.

cheers,
rob


On Wed, 15 Jan 1997 sean@itc.icl.ie wrote:

> Submitter: sean@itc.icl.ie
> Operating system: SunOS 4.x, version: 
> Version of Apache Used: 1.2b4
> Extra Modules used: status
> URL exhibiting problem: 
> 
> Symptoms:
> --
> If I set MaxSpareServers to 3 and do not set
> MinSpareServers, MinSpareServers defaults to 5.
> 
> It would seem reasonable that Min would default 
> to 5 if Max > 5 but if Max < 5, this seems silly.
> 
> If I set Max to 3, I expect no more than 3 servers
> to be idle at any time, but this is not the case
> (because Min says 5 must always be idle).
> 
> Can you give a warning if Min > Max ?  And perhaps
> if a Min value is not specified, default it to
> Max > 5 ? 5 : Max
 



Re: [BUG]: "MinSpareServers shouldn't be greater than MaxSpareServers" on SunOS 4.x

Posted by Ed Korthof <ed...@organic.com>.
There is a block of code which sets MaxSpareServers to be one larger than
MinSpareServers, so that MinSpareServers overrides MaxSpareServers (to prevent
thrashing).

The following patch solves the problem: if MaxSpareServers and MinSpareServers
conflict, the one which comes later in the configuration file will override the
other.  This patch also removes the aforementioned code, for easy of
maintenance (imo, we should do both checks in the same section of code); so
long as we don't set DEFAULT_MAX_FREE_SERVERS < DEFAULT_MIN_FREE_SERVERS, this
will do exactly the same thing.

-----
*** http_core.c	Wed Jan  1 12:00:14 1997
--- http_core.c.new	Wed Jan 15 15:14:29 1997
***************
*** 948,959 ****
         fprintf(stderr, "Please read the documentation.\n");
         daemons_min_free = 1;
      }
!
      return NULL;
  }

  const char *set_max_free_servers (cmd_parms *cmd, void *dummy, char *arg) {
      daemons_max_free = atoi (arg);
      return NULL;
  }

--- 948,971 ----
         fprintf(stderr, "Please read the documentation.\n");
         daemons_min_free = 1;
      }
!     if (daemons_max_free <= daemons_min_free) { /* don't thrash */
!        daemons_max_free = daemons_min_free + 1;
!     }
      return NULL;
  }

  const char *set_max_free_servers (cmd_parms *cmd, void *dummy, char *arg) {
      daemons_max_free = atoi (arg);
+     if (daemons_max_free < 2) { /*it seems daemons_min_free should be >0...
*/
+        fprintf(stderr, "WARNING: detected MaxSpareServers set to < 2.\n");
+        fprintf(stderr, "Resetting to 2 to avoid almost certain Apache
failure.\n");
+        fprintf(stderr, "Please read the documentation; MinSpareServers
must\n");
+        fprintf(stderr, "be > 0 and at least one less than
MaxSpareServers.\n");
+        daemons_max_free = 2;
+     }
+     if (daemons_max_free < daemons_min_free) { /* don't thrash */
+        daemons_min_free = daemons_max_free -1;
+     }
      return NULL;
  }

*** http_main.c	Sun Jan 12 18:00:12 1997
--- http_main.c.new	Wed Jan 15 15:04:48 1997
***************
*** 1947,1955 ****

      num_children = 0;

-     if (daemons_max_free < daemons_min_free + 1) /* Don't thrash... */
- 	daemons_max_free = daemons_min_free + 1;
-
      while (num_children < daemons_to_start && num_children < daemons_limit) {
  	make_child(server_conf, num_children++);
      }
--- 1947,1952 ----
-----


On Jan 15,  4:16pm, Rob Hartill wrote:
> Subject: Re: [BUG]: "MinSpareServers shouldn't be greater than MaxSpareSer
>
> Hi,
>
> Thanks for the info. We'll see if anything can be done before 1.2 is
> released.
>
> cheers,
> rob
>
>
> On Wed, 15 Jan 1997 sean@itc.icl.ie wrote:
>
> > Submitter: sean@itc.icl.ie
> > Operating system: SunOS 4.x, version:
> > Version of Apache Used: 1.2b4
> > Extra Modules used: status
> > URL exhibiting problem:
> >
> > Symptoms:
> > --
> > If I set MaxSpareServers to 3 and do not set
> > MinSpareServers, MinSpareServers defaults to 5.
> >
> > It would seem reasonable that Min would default
> > to 5 if Max > 5 but if Max < 5, this seems silly.
> >
> > If I set Max to 3, I expect no more than 3 servers
> > to be idle at any time, but this is not the case
> > (because Min says 5 must always be idle).
> >
> > Can you give a warning if Min > Max ?  And perhaps
> > if a Min value is not specified, default it to
> > Max > 5 ? 5 : Max
>
>
>-- End of excerpt from Rob Hartill



-- 
     -- Ed Korthof        |  Web Server Engineer --
     -- ed@organic.com    |  Organic Online, Inc --
     -- (415) 278-5676    |  Fax: (415) 284-6891 --