cvs commit: apache-apr/pthreads/src/main http_main.c scoreboard.c

1999-02-15 Thread rbb
rbb 99/02/15 10:42:51

  Modified:pthreads/src/main http_main.c scoreboard.c
  Log:
  A cuple of fixes for those static variables from the last scoreboard patch.
  This creates functions that return the value of those variables, and sets
  them back to static.
  
  Revision  ChangesPath
  1.24  +12 -2 apache-apr/pthreads/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /home/cvs/apache-apr/pthreads/src/main/http_main.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- http_main.c   1999/02/15 15:45:17 1.23
  +++ http_main.c   1999/02/15 18:42:49 1.24
  @@ -183,7 +183,7 @@
* to deal with MaxClients changes across SIGUSR1 restarts.  We use this
* value to optimize routines that have to scan the entire scoreboard.
*/
  -int max_daemons_limit = -1;
  +static int max_daemons_limit = -1;
   
   /*
* The maximum number of threads in each child process.  This is ap_threads_
  @@ -261,7 +261,7 @@
   
   /* *Non*-shared http_main globals... */
   
  -server_rec *server_conf;
  +static server_rec *server_conf;
   static struct pollfd *listenfds;   /* Z abstract fd_set */ 
   static int num_listenfds;   /* Z abstract num_listenfds */
   static pid_t pgrp;
  @@ -356,6 +356,16 @@
component, NULL);
}
   }
  +}
  +
  +API_EXPORT(int) ap_get_max_daemons(void)
  +{
  +return max_daemons_limit;
  +}
  +
  +API_EXPORT(server_rec *) get_server_conf(void)
  +{
  +return server_conf;
   }
   
   /*
  
  
  
  1.3   +2 -3  apache-apr/pthreads/src/main/scoreboard.c
  
  Index: scoreboard.c
  ===
  RCS file: /home/cvs/apache-apr/pthreads/src/main/scoreboard.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- scoreboard.c  1999/02/15 16:28:38 1.2
  +++ scoreboard.c  1999/02/15 18:42:50 1.3
  @@ -24,11 +24,8 @@
   #endif
   
   scoreboard *ap_scoreboard_image = NULL;
  -extern server_rec *server_conf;
   extern pool * pconf;
  -extern int max_daemons_limit;
   
  -
   /*
*
* Dealing with the scoreboard... a lot of these variables are global
  @@ -312,6 +309,7 @@
   static void setup_shared_mem(pool *p)
   {
   struct shmid_ds shmbuf;
  +server_rec * server_conf = get_server_conf();
   #ifdef MOVEBREAK
   char *obrk;
   #endif
  @@ -555,6 +553,7 @@
   API_EXPORT(int) find_child_by_pid(int pid)
   {
   int i;
  +int max_daemons_limit = ap_get_max_daemons();
   
   for (i = 0; i  max_daemons_limit; ++i)
if (ap_scoreboard_image-parent[i].pid == pid)
  
  
  


cvs commit: apache-apr/pthreads/src/main http_main.c scoreboard.c

1999-02-15 Thread rbb
rbb 99/02/15 12:39:02

  Modified:pthreads/src/include http_conf_globals.h httpd.h
scoreboard.h
   pthreads/src/main http_main.c scoreboard.c
  Log:
  Scoreboard updates.  We now store the number of workers and acceptors in the
  scoreboard file.  I also added two new states for acceptor threads, ACCEPTING
  and QUEUEing.  Lastly, we are now using reasonable defaults for
  HARD_SERVER_LIMIT and HARD_THREAD_LIMIT.
  
  Revision  ChangesPath
  1.6   +1 -0  apache-apr/pthreads/src/include/http_conf_globals.h
  
  Index: http_conf_globals.h
  ===
  RCS file: /home/cvs/apache-apr/pthreads/src/include/http_conf_globals.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- http_conf_globals.h   1999/02/11 16:33:00 1.5
  +++ http_conf_globals.h   1999/02/15 20:38:54 1.6
  @@ -74,6 +74,7 @@
   extern gid_t group_id_list[NGROUPS_MAX];
   #endif
   extern int ap_threads_per_child;
  +extern int ap_acceptors_per_child;
   extern int ap_idle_thread_threshold;
   extern int ap_busy_thread_threshold;
   extern int ap_max_requests_per_child;
  
  
  
  1.7   +4 -2  apache-apr/pthreads/src/include/httpd.h
  
  Index: httpd.h
  ===
  RCS file: /home/cvs/apache-apr/pthreads/src/include/httpd.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- httpd.h   1999/02/11 16:33:00 1.6
  +++ httpd.h   1999/02/15 20:38:57 1.7
  @@ -307,7 +307,7 @@
* the overhead.
*/
   #ifndef HARD_SERVER_LIMIT
  -#define HARD_SERVER_LIMIT 256
  +#define HARD_SERVER_LIMIT 8 
   #endif
   
   /* Limit on the threads per process.  Clients will be locked out if more than
  @@ -318,7 +318,7 @@
* the overhead.
*/
   #ifndef HARD_THREAD_LIMIT
  -#define HARD_THREAD_LIMIT 500
  +#define HARD_THREAD_LIMIT 64 
   #endif
   
   /*
  @@ -1039,6 +1039,8 @@
   API_EXPORT(int) ap_is_directory(const char *name);
   API_EXPORT(int) ap_can_exec(const struct stat *);
   API_EXPORT(void) ap_chdir_file(const char *file);
  +API_EXPORT(int) ap_get_max_daemons(void);
  +server_rec * get_server_conf(void);
   
   #ifndef HAVE_CANONICAL_FILENAME
   /*
  
  
  
  1.6   +5 -3  apache-apr/pthreads/src/include/scoreboard.h
  
  Index: scoreboard.h
  ===
  RCS file: /home/cvs/apache-apr/pthreads/src/include/scoreboard.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- scoreboard.h  1999/02/15 15:45:16 1.5
  +++ scoreboard.h  1999/02/15 20:38:57 1.6
  @@ -89,7 +89,9 @@
   #define SERVER_BUSY_LOG 6/* Logging the request */
   #define SERVER_BUSY_DNS 7/* Looking up a hostname */
   #define SERVER_GRACEFUL 8/* server is gracefully finishing request */
  -#define SERVER_NUM_STATUS 9  /* number of status settings */
  +#define SERVER_ACCEPTING 9   /* thread is accepting connections */
  +#define SERVER_QUEUEING  10  /* thread is putting connection on the 
queue */
  +#define SERVER_NUM_STATUS 11 /* number of status settings */
   
   /* A virtual time is simply a counter that indicates that a child is
* making progress.  The parent checks up on each child, and when they have
  @@ -171,8 +173,8 @@
   typedef struct {
   pid_t pid;
   ap_generation_t generation;  /* generation of this child */
  -int threads;
  -int inactive_threads;
  +int worker_threads;
  +int acceptor_threads;
   #ifdef OPTIMIZE_TIMEOUTS
   time_t last_rtime;   /* time(0) of the last change */
   vtime_t last_vtime;  /* the last vtime the parent has seen */
  
  
  
  1.25  +11 -24apache-apr/pthreads/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /home/cvs/apache-apr/pthreads/src/main/http_main.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- http_main.c   1999/02/15 18:42:49 1.24
  +++ http_main.c   1999/02/15 20:39:01 1.25
  @@ -157,6 +157,7 @@
   gid_t group_id_list[NGROUPS_MAX];
   #endif
   int ap_threads_per_child;
  +int ap_acceptors_per_child;
   int ap_max_requests_per_child;
   int ap_idle_thread_threshold;
   int ap_busy_thread_threshold;
  @@ -186,15 +187,6 @@
   static int max_daemons_limit = -1;
   
   /*
  - * The maximum number of threads in each child process.  This is ap_threads_
  - * per child + # of acceptor threads.  Used to optimize routines that must
  - * scan the entire scoreboard.  This is garaunteed not to change, unless the
  - * server is restarted, at which point, it must be updated to incorporate
  - * any changes in the threadsperchild or listen directives.
  - */
  -int max_threads_limit;
  -
  -/*
* During config time, listeners is treated as a