You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dave Hill <dd...@laurel.zk3.dec.com> on 2000/07/14 00:29:58 UTC

Fix for error creating scoreboard on Tru64

Building on:
	Compaq Tru64 UNIX, v5.0a
	native cc 
	sources from anoncvs 7/12/00

Hi,
    I could not get httpd to work, it kept complaining about not being
able to create the scoreboard. To make a long story shorter... 
There is a fudge factor built into ap_shm_init() for the total size
of the scoreboard. This fudge is currently 40 and is used to cover 
the overhead of the mm_malloc process. This number is too small on
alpha. I doubled the number to 80 and httpd feels much better, 
and even is serving me pages !

If I understand the mm code right... the fudge should be based on
sizeof(struct mem_chunk) which is 24 on alpha, so 40 might have
been close, but 80 does work :-)

file is src/modules/mpm/mpmt_pthread/scoreboard.c
	
*** scoreboard.c.orig	Thu Jul 13 17:48:58 2000
--- scoreboard.c	Thu Jul 13 18:18:29 2000
***************
*** 104,110 ****
      const char *fname;
  
      fname = ap_server_root_relative(p, ap_scoreboard_fname);
!     if (ap_shm_init(&scoreboard_shm, SCOREBOARD_SIZE + NEW_SCOREBOARD_SIZE + 40, fname, p) != APR_SUCCESS) {
          ap_snprintf(buf, sizeof(buf), "%s: could not open(create) scoreboard",
                      ap_server_argv0);
          perror(buf);
--- 104,110 ----
      const char *fname;
  
      fname = ap_server_root_relative(p, ap_scoreboard_fname);
!     if (ap_shm_init(&scoreboard_shm, SCOREBOARD_SIZE + NEW_SCOREBOARD_SIZE + 80, fname, p) != APR_SUCCESS) {
          ap_snprintf(buf, sizeof(buf), "%s: could not open(create) scoreboard",
                      ap_server_argv0);
          perror(buf);
+-------------------------------------------------------------+
Dave Hill                             Unix Software Group
Mailstop: ZKO3-3/Y15                  
Digital Equipment Corp.               (603) 884-2985
110 Spit Brook Road         /\_/\     enet: ddhill@zk3.dec.com
Nashua, NH 03062-2698       (0_0)     
+-----------------------oOO--(_)--OOo-------------------------+


Re: Fix for error creating scoreboard on Tru64

Posted by David Hill <dd...@zk3.dec.com>.
> I'm glad 80 worked, but I have hated the magic 40 since I added it.  It
> would be REALLY nice to be able to get this fudge factor from MM
> itself.  This would let us add the correct fudge factor on each
> machine.  I may look into this at some point.

I had similar thoughts myself. Would not think it hard to create a macro in
mm.h that would add the overhead and do the word aligned boundry padding.

Also, When the scoreboard create failed.... should that be a fatal error
for httpd? I found that the server was hanging around (did not even have the
port open) waiting for something. Seems cleaner just to log an error and
terminate.

Dave


Re: Fix for error creating scoreboard on Tru64

Posted by rb...@covalent.net.
I'm glad 80 worked, but I have hated the magic 40 since I added it.  It
would be REALLY nice to be able to get this fudge factor from MM
itself.  This would let us add the correct fudge factor on each
machine.  I may look into this at some point.

Ryan
> Hi,
>     I could not get httpd to work, it kept complaining about not being
> able to create the scoreboard. To make a long story shorter... 
> There is a fudge factor built into ap_shm_init() for the total size
> of the scoreboard. This fudge is currently 40 and is used to cover 
> the overhead of the mm_malloc process. This number is too small on
> alpha. I doubled the number to 80 and httpd feels much better, 
> and even is serving me pages !
> 
> If I understand the mm code right... the fudge should be based on
> sizeof(struct mem_chunk) which is 24 on alpha, so 40 might have
> been close, but 80 does work :-)
> 
> file is src/modules/mpm/mpmt_pthread/scoreboard.c
> 	
> *** scoreboard.c.orig	Thu Jul 13 17:48:58 2000
> --- scoreboard.c	Thu Jul 13 18:18:29 2000
> ***************
> *** 104,110 ****
>       const char *fname;
>   
>       fname = ap_server_root_relative(p, ap_scoreboard_fname);
> !     if (ap_shm_init(&scoreboard_shm, SCOREBOARD_SIZE + NEW_SCOREBOARD_SIZE + 40, fname, p) != APR_SUCCESS) {
>           ap_snprintf(buf, sizeof(buf), "%s: could not open(create) scoreboard",
>                       ap_server_argv0);
>           perror(buf);
> --- 104,110 ----
>       const char *fname;
>   
>       fname = ap_server_root_relative(p, ap_scoreboard_fname);
> !     if (ap_shm_init(&scoreboard_shm, SCOREBOARD_SIZE + NEW_SCOREBOARD_SIZE + 80, fname, p) != APR_SUCCESS) {
>           ap_snprintf(buf, sizeof(buf), "%s: could not open(create) scoreboard",
>                       ap_server_argv0);
>           perror(buf);

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------