Overview: mod_status server-status?auto lists the keys BusyWorkers and IdleWorkers twice. Steps to Reproduce: wget -O - 'http://localhost/server-status?auto' Actual Results: I see e.g. ... DurationPerReq: 8.53412 BusyWorkers: 1 IdleWorkers: 49 Processes: 2 Stopping: 0 BusyWorkers: 1 IdleWorkers: 49 ConnsTotal: 2 ... Expected Results: Up to release 2.4.34 the output was e.g. ... Uptime: 3 ReqPerSec: 0 BytesPerSec: 0 BusyWorkers: 1 IdleWorkers: 4 Scoreboard: ... Additional Information: The change was introduced with "mod_status: Complete the data shown for async" ( https://github.com/apache/httpd/commit/6befc1893bea72320388b84fd879a4533e29b244 ) from 2018-08-07 released with httpd 2.4.35. Is there a contract that the keys should be unique?
Suggested fix would be to make https://github.com/apache/httpd/blob/2.4.39/modules/generators/mod_status.c#L554 ap_rprintf(r, "BusyWorkers: %d\nIdleWorkers: %d\n", busy, ready); conditional on is_async. Not sure though if both outputs could report different values?
Would be great to avoid duplicate values here. In the meantime others like collectd have implemented workarounds. But imho duplicate values should be prevented at the source. https://github.com/collectd/collectd/pull/3131
I would prefer to rename to fields for the async values, because they are calculated in an independent way. Deltas may point to problems. For instance: BusyWorkers => BusyAsyncWorkers IdleWorkers => IdleAsyncWorkers Although of course in the async case there are only async workers, no others.
Either way. But having a solution would be great.
Created attachment 38466 [details] mod_status.patch Hi, i would also like this to be resolved. I Reproduced this issue on Fedora-Rawhide. My proposal is to remove the first set of BusyWorkers IdleWorkers when ?auto query is supplied and let only the second set be printed out with correct values which count with gracefully finishing threads but renaming is also ok. Thanks for any help.
Hi guys, Any plan to fix this?
I just added a fix for trunk in 1909429 and plan to suggest it for backport. The changelog item would be: mod_status: Remove duplicate keys "BusyWorkers" and "IdleWorkers". Resolve inconsistency between the previous two occurrences by counting workers in state SERVER_GRACEFUL no longer as busy, but instead in a new counter "GracefulWorkers" (or on HTML view as "workers gracefully restarting"). Also add the graceful counter as a new column to the existing HTML per process table for async MPMs. That should explain, how I resolved it.
See also: https://svn.apache.org/viewvc?view=revision&revision=r1909429
Hi Rainer, I think there is a typo. + if (res == SERVER_GRACEFUL) + graceful++; + if (is_async) { + thread_graceful_buffer[i]++; + } else { + busy++; + if (is_async) thread_busy_buffer[i]++; You indented the first "if (is_async)" as if it was guarded by the "if (res == SERVER_GRACEFUL)" condition but it is not.
The typo was fixed in r1909606 already, thanks for reviewing/noticing!
Proposed for backport to 2.4.x.
Committed to 2.4.x in r1911892. Will be part of 2.4.58.