diff options
author | Graham Leggett <minfrin@apache.org> | 2004-07-29 00:50:54 +0200 |
---|---|---|
committer | Graham Leggett <minfrin@apache.org> | 2004-07-29 00:50:54 +0200 |
commit | e548632412d9b5a0a19c21201f03cd106ce34264 (patch) | |
tree | 24bfe3ec131be664466b7897d4a14837b1b9a6c2 /include | |
parent | modify to better translation. (diff) | |
download | apache2-e548632412d9b5a0a19c21201f03cd106ce34264.tar.xz apache2-e548632412d9b5a0a19c21201f03cd106ce34264.zip |
Add load balancer support to the scoreboard in preparation for
load balancing support in mod_proxy.
PR:
Obtained from:
Submitted by: Mladen Turk <mturk@apache.org>
Reviewed by:
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104404 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include')
-rw-r--r-- | include/scoreboard.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/scoreboard.h b/include/scoreboard.h index beb75e513a..3521d6c5fb 100644 --- a/include/scoreboard.h +++ b/include/scoreboard.h @@ -32,6 +32,7 @@ extern "C" { #include "apr_thread_proc.h" #include "apr_portable.h" #include "apr_shm.h" +#include "apr_optional.h" /* Scoreboard file, if there is one */ #ifndef DEFAULT_SCOREBOARD @@ -118,6 +119,7 @@ struct worker_score { typedef struct { int server_limit; int thread_limit; + int lb_limit; ap_scoreboard_e sb_type; ap_generation_t running_generation; /* the generation of children which * should still be serving requests. */ @@ -135,6 +137,13 @@ struct process_score{ */ }; +/* stuff which is lb specific */ +typedef struct lb_score lb_score; +struct lb_score{ + /* TODO: make a real stuct from this */ + unsigned char data[1024]; +}; + /* Scoreboard is now in 'local' memory, since it isn't updated once created, * even in forked architectures. Child created-processes (non-fork) will * set up these indicies into the (possibly relocated) shmem records. @@ -143,6 +152,7 @@ typedef struct { global_score *global; process_score *parent; worker_score **servers; + lb_score **balancers; } scoreboard; typedef struct ap_sb_handle_t ap_sb_handle_t; @@ -168,6 +178,7 @@ void ap_time_process_request(int child_num, int thread_num, int status); AP_DECLARE(worker_score *) ap_get_scoreboard_worker(int x, int y); AP_DECLARE(process_score *) ap_get_scoreboard_process(int x); AP_DECLARE(global_score *) ap_get_scoreboard_global(void); +AP_DECLARE(lb_score *) ap_get_scoreboard_lb(int child_num, int lb_num); AP_DECLARE_DATA extern scoreboard *ap_scoreboard_image; AP_DECLARE_DATA extern const char *ap_scoreboard_fname; @@ -185,6 +196,13 @@ AP_DECLARE_DATA extern ap_generation_t volatile ap_my_generation; */ AP_DECLARE_HOOK(int, pre_mpm, (apr_pool_t *p, ap_scoreboard_e sb_type)) +/** + * proxy load balancer + * @return the number of load balancer workers. + */ +APR_DECLARE_OPTIONAL_FN(int, ap_proxy_lb_workers, + (void)); + /* for time_process_request() in http_main.c */ #define START_PREQUEST 1 #define STOP_PREQUEST 2 |