httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/standard mod_cgid.c
Date Fri, 07 Jul 2000 15:20:37 GMT
trawick     00/07/07 08:20:36

  Modified:    src/modules/standard mod_cgid.c
  Log:
  Drastically increase the listen backlog for mod_cgid's unix socket.  It
  was pretty easy to hit ECONNREFUSED errors when the backlog was 5.
  
  The backlog can be customized at build time if required.
  
  Revision  Changes    Path
  1.26      +13 -3     apache-2.0/src/modules/standard/mod_cgid.c
  
  Index: mod_cgid.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_cgid.c,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- mod_cgid.c	2000/07/05 23:43:40	1.25
  +++ mod_cgid.c	2000/07/07 15:20:35	1.26
  @@ -124,6 +124,17 @@
   
   #define SHELL_PATH "/bin/sh"
   
  +/* DEFAULT_CGID_LISTENBACKLOG controls the max depth on the unix socket's
  + * pending connection queue.  If a bunch of cgi requests arrive at about
  + * the same time, connections from httpd threads/processes will back up
  + * in the queue while the cgid process slowly forks off a child to process
  + * each connection on the unix socket.  If the queue is too short, the
  + * httpd process will get ECONNREFUSED when trying to connect.
  + */
  +#ifndef DEFAULT_CGID_LISTENBACKLOG
  +#define DEFAULT_CGID_LISTENBACKLOG 100
  +#endif
  +
   typedef struct { 
       const char *sockname;
       const char *logname; 
  @@ -531,9 +542,8 @@
                        sconf->sockname); 
           return errno;
       } 
  -    /* Most implementations silently enforce a value of 5 anyway.  
  -     * This way, it'll work the same everywhere. */
  -    if (listen(sd, 5) < 0) {
  +
  +    if (listen(sd, DEFAULT_CGID_LISTENBACKLOG) < 0) {
           ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server, 
                        "Couldn't listen on unix domain socket"); 
           return errno;
  
  
  

Mime
View raw message