From 92961f3c1306934d0b5f495d3d0b151b990c20d8 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 2 Dec 2016 11:43:55 +0000 Subject: [PATCH] Merge r1738628, r1757009, r1756848, r1757029 from trunk: Display process slot number in the async overview Fix the number of column for 'Async connections'. There are only 3 columns (writing, keep-alive, closing), not 4. Try to improve the code layout for it to be more readable. Each is on its own line so keep the corresponding "colspan" fields grouped together. r1738628 introduced a new column, 'Slot'. Add an empty cell for it in the last line of the table, in order to fix the layout of the Totals. Replace tab by spaces to be consistent mod_status: note stopping procs in async info table * add new column "stopping", denoting if a process is shutting down * add additional "(old gen)", if a process is from before a graceful reload * add counts of processes and stopping processes to summary line Submitted by: sf, jailletc36, jailletc36, sf Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1772333 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ modules/generators/mod_status.c | 49 +++++++++++++++++++++++---------- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/CHANGES b/CHANGES index 0feceb7509..3f06e2edd7 100644 --- a/CHANGES +++ b/CHANGES @@ -15,6 +15,9 @@ Changes with Apache 2.4.24 *) mod_ssl: Fix quick renegotiation (OptRenegotiaton) with no intermediate in the client certificate chain. PR 55786. [Yann Ylavic] + *) mod_status: Display the process slot number in the async connection + overview. [Stefan Fritsch] + *) mod_dir: Responses that go through "FallbackResource" might appear to hang due to unterminated chunked encoding. PR58292. [Eric Covener] diff --git a/modules/generators/mod_status.c b/modules/generators/mod_status.c index 70df1a100e..12801f94ce 100644 --- a/modules/generators/mod_status.c +++ b/modules/generators/mod_status.c @@ -531,7 +531,7 @@ static int status_handler(request_rec *r) if (is_async) { int write_completion = 0, lingering_close = 0, keep_alive = 0, - connections = 0; + connections = 0, stopping = 0, procs = 0; /* * These differ from 'busy' and 'ready' in how gracefully finishing * threads are counted. XXX: How to make this clear in the html? @@ -539,13 +539,15 @@ static int status_handler(request_rec *r) int busy_workers = 0, idle_workers = 0; if (!short_report) ap_rputs("\n\n\n" - "" + "" + "" + "" "\n" "" - "\n" + "\n" "" - "" - "\n", r); + "" + "\n", r); for (i = 0; i < server_limit; ++i) { ps_record = ap_get_scoreboard_process(i); if (ps_record->pid) { @@ -555,26 +557,45 @@ static int status_handler(request_rec *r) lingering_close += ps_record->lingering_close; busy_workers += thread_busy_buffer[i]; idle_workers += thread_idle_buffer[i]; - if (!short_report) - ap_rprintf(r, "" - "" + if (!short_report) { + const char *dying = "no"; + const char *old = ""; + if (ps_record->quiescing) { + dying = "yes"; + stopping++; + } + if (ps_record->generation != mpm_generation) + old = " (old gen)"; + procs++; + ap_rprintf(r, "" + "" + "" + "" "" "\n", - ps_record->pid, ps_record->connections, + i, ps_record->pid, + dying, old, + ps_record->connections, ps_record->not_accepting ? "no" : "yes", - thread_busy_buffer[i], thread_idle_buffer[i], + thread_busy_buffer[i], + thread_idle_buffer[i], ps_record->write_completion, ps_record->keep_alive, ps_record->lingering_close); + } } } if (!short_report) { - ap_rprintf(r, "" - "" + ap_rprintf(r, "" + "" + "" + "" + "" "\n
PID
SlotPIDStoppingConnectionsThreadsAsync connections
Async connections
totalacceptingbusyidlewritingkeep-aliveclosing
busyidlewritingkeep-aliveclosing
%" APR_PID_T_FMT "%u%s%u%u
%u%" APR_PID_T_FMT "%s%s%u%s%u%u%u%u%u
Sum%d %d%d%d%d%d
Sum%d%d%d %d%d%d%d%d
\n", - connections, busy_workers, idle_workers, + procs, stopping, + connections, + busy_workers, idle_workers, write_completion, keep_alive, lingering_close); - } else { ap_rprintf(r, "ConnsTotal: %d\n" -- 2.49.0