Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 33136 invoked by uid 500); 20 Feb 2002 21:48:36 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 33123 invoked from network); 20 Feb 2002 21:48:35 -0000 Date: Wed, 20 Feb 2002 14:47:30 -0800 From: Adam Sussman To: dev@httpd.apache.org Subject: [PATCH/PROPOSAL] add server_limit and thread_limit to scoreboard Message-ID: <20020220144730.J7538@vishnu.vidya.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I know this idea isn't totaly popular, but I thought I would throw this out and see what people think. Aaron's most recent patch to the scoreboard creation logic allows you to make the apache scoreboard shared memory image accessible to external programs. This is very usefull and we have employed this same methodology to monitor apache 1.3 in the past. The problem with the new scoreboard though is that its size depends on configure time variables rather than compile time variables. There's no easy way for an external program to be adaptable without parsing the conf files. This patch adds the configured server_limit and thread_limit elements to the global score and sets them at the time the scoreboard is intialized. If there is a better way to derive this information, someone please tell me! -adam Index: include/scoreboard.h =================================================================== RCS file: /home/cvspublic/httpd-2.0/include/scoreboard.h,v retrieving revision 1.41 diff -u -r1.41 scoreboard.h --- include/scoreboard.h 19 Feb 2002 21:09:27 -0000 1.41 +++ include/scoreboard.h 20 Feb 2002 21:41:53 -0000 @@ -159,6 +159,8 @@ }; typedef struct { + int server_limit; + int thread_limit; ap_scoreboard_e sb_type; ap_generation_t running_generation; /* the generation of children which * should still be serving requests. */ Index: server/scoreboard.c =================================================================== RCS file: /home/cvspublic/httpd-2.0/server/scoreboard.c,v retrieving revision 1.57 diff -u -r1.57 scoreboard.c --- server/scoreboard.c 19 Feb 2002 21:09:27 -0000 1.57 +++ server/scoreboard.c 20 Feb 2002 21:41:53 -0000 @@ -158,6 +158,8 @@ more_storage += thread_limit * sizeof(worker_score); } ap_assert(more_storage == (char*)shared_score + scoreboard_size); + ap_scoreboard_image->global->server_limit = server_limit; + ap_scoreboard_image->global->thread_limit = thread_limit; } /**