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