[users@httpd] Re: mod_status: extended + auto (machine-readable) output
https://github.com/apache/httpd/pull/27 On Sat, Oct 08, 2016 at 09:58:57PM -0300, Raphaël wrote: > Hi, > > I've an Apache server handling various virtual hosts and I'd like to monitor > the distinct activities of all of them without having to parse multiple > accesslog files. > > > Most monitoring softwares consume the output of "mod_status?auto" which is > made easy to parse but does not provide the detailed the information > available in the HTML mod_status+ExtendedStatus output [...] - To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org
Re: [users@httpd] resources prioritization/scheduler (app vs assets)
use it's slow, how to avoid the accumulation of main-script request to block requests directed to static stuff ? Could be seen as the opposite of the "root's ext4 inode 5% reserve": A percentage of ThreadsPerChild which, under high-load, is *not* allocated to the main-script ? Thanks! > > On 10/12/2016 14:22, Raphaël wrote: > >Hi, > > > >I've a question on how to prioritize traffic in order to optimize > >the service in the case of traffic bursts: > > > > > >Context: > >* a server with finite resources (let's say 1 GB mem) > >* a PHP application: initial page load needs 100 MB (index.php) > >* for each page load (index.php) approx: > > * ~ 40 subsequent assets (static files) are needed > > * serving assets is, obviously, quicker than serving index.php > >* I assume, and decide, that PHP-FPM must not use more than 700MB > >* I want to avoid "broken" pages (missing assets/images/...) as much as > >possible > > > > > >Thus PHP-FPM is configured to not allow no more than 7 children. > >The Apache MaxRequestWorkers (worker MPM) is set to be strictly superior than > >7*40 (lets say 350) > > > > > >Now imagine a traffic burst with 200 distinct clients simultaneously > >hitting the main page (wow!) > >They now occupy 57% of the Apache workers, 193 of them waiting for a > >PHP-FPM child. ( "max" default value being ThreadsPerChild) > > > >... some hundreds milliseconds later... > > > >The 7 first clients having been served, each one now requests 40 more assets. > >And the situation is then as follows: > > > >* 7 hits on index.php were already processed successfully > >* 7 currently being processed by PHP-FPM (still occupying Apache workers) > >* 186 queued Apache workers hits /index.php, waiting for PHP-FPM/proxy-fcgi > >* 7*40 = 280 new hits for assets (subsequent resources needed by the 7 first > >clients) > >* 157 of them immediately get an available Apache worker and can be > > served (157+186+7 == 350) > >* >>>>>>> 123 assets will NOT get an available worker <<<<<<< PROBLEM > > HERE > > > > > >In the "best" case these 123 requests, which should have been served > >*now*, will end up in the ListenBackLog and wait the 157 first assets to > >be served first and liberate their workers. > > > >The server works virtually *as* if only 350-200 = 150 workers were > >available (150 being < 280, which is the typical workers implication > >for 7 pages-load) > > > >200 being the (unpredictable/variable) "intensity" of the burst, I would > >like to know of a better way to handle such a situation. > > > > > >The first ideas that come to mind is service shaping (prioritization/quotas): > >How to make Apache only accept 1/40 of the traffic to the fcgi php-fpm proxy. > >Sample heuristic: > >>If all worker are used (350/350), we "compute" which proportion is > >>dedicated to index.php. If it's superior to a given configurable > >>threshold, then free some of the workers dedicated to this resources > >>in order to accept assets-directed resources. > > > >I'm curious about possible solutions. > >Thank you for reading. - To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org
[users@httpd] resources prioritization/scheduler (app vs assets)
Hi, I've a question on how to prioritize traffic in order to optimize the service in the case of traffic bursts: Context: * a server with finite resources (let's say 1 GB mem) * a PHP application: initial page load needs 100 MB (index.php) * for each page load (index.php) approx: * ~ 40 subsequent assets (static files) are needed * serving assets is, obviously, quicker than serving index.php * I assume, and decide, that PHP-FPM must not use more than 700MB * I want to avoid "broken" pages (missing assets/images/...) as much as possible Thus PHP-FPM is configured to not allow no more than 7 children. The Apache MaxRequestWorkers (worker MPM) is set to be strictly superior than 7*40 (lets say 350) Now imagine a traffic burst with 200 distinct clients simultaneously hitting the main page (wow!) They now occupy 57% of the Apache workers, 193 of them waiting for a PHP-FPM child. ( "max" default value being ThreadsPerChild) ... some hundreds milliseconds later... The 7 first clients having been served, each one now requests 40 more assets. And the situation is then as follows: * 7 hits on index.php were already processed successfully * 7 currently being processed by PHP-FPM (still occupying Apache workers) * 186 queued Apache workers hits /index.php, waiting for PHP-FPM/proxy-fcgi * 7*40 = 280 new hits for assets (subsequent resources needed by the 7 first clients) * 157 of them immediately get an available Apache worker and can be served (157+186+7 == 350) * >>> 123 assets will NOT get an available worker <<< PROBLEM HERE In the "best" case these 123 requests, which should have been served *now*, will end up in the ListenBackLog and wait the 157 first assets to be served first and liberate their workers. The server works virtually *as* if only 350-200 = 150 workers were available (150 being < 280, which is the typical workers implication for 7 pages-load) 200 being the (unpredictable/variable) "intensity" of the burst, I would like to know of a better way to handle such a situation. The first ideas that come to mind is service shaping (prioritization/quotas): How to make Apache only accept 1/40 of the traffic to the fcgi php-fpm proxy. Sample heuristic: > If all worker are used (350/350), we "compute" which proportion is > dedicated to index.php. If it's superior to a given configurable > threshold, then free some of the workers dedicated to this resources > in order to accept assets-directed resources. I'm curious about possible solutions. Thank you for reading. - To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org
[users@httpd] mod_status: extended + auto (machine-readable) output
Hi, I've an Apache server handling various virtual hosts and I'd like to monitor the distinct activities of all of them without having to parse multiple accesslog files. Most monitoring softwares consume the output of "mod_status?auto" which is made easy to parse but does not provide the detailed the information available in the HTML mod_status+ExtendedStatus output As a consequence they can't the monitor the detailed states of the children and the virtual-host they serve. If it were to be done, would you consider merging a patch of mod_status in order to provide a machine-readable detailed output? If yes, then would you have a specific guidelines/advises about the implementation? Eg: * support of an "?extended" parameter in order to keep as-is the default and widely used output of "?auto". But ap_run_status_hook() allow appending anyway? * Specific format to render the "Server Details" section (separators) * whether or not adding the "SSL session cache" section (ssl_ext_status_hook) and "Proxy LoadBalancer Status" (proxy_status_hook) too? The alternative to patching mod_status would be doing a custom/out-of-tree module using the ap_run_status_hook() in order to append to the output. But IHMO having auto+extended fits mod_status better. best regards Note: I don't know what use-cases the "NoTable" output format was intended to, given that its HTML is neither nice to render in a browser, neither is it nice to parse. Note: from a quick look at the code, "auto" is bound to a "short_report" variable implying that machine-readable format was projected to stay short to begin with. - To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org
Re: [users@httpd] getting disk cache to respect removing key from request query string
On Wed, Aug 10, 2016 at 07:13:05PM +0200, Yann Ylavic wrote: > On Wed, Aug 10, 2016 at 5:12 PM, Raphaël <raphael.d...@gmail.com> wrote: > > On Tue, Aug 09, 2016 at 01:03:33AM -0600, Anthony Biacco wrote: > >> Is there any way i can rewrite the query string so that only the modified > >> query string is used to create the cache files? > > > > https://bz.apache.org/bugzilla/show_bug.cgi?id=21935 > > Patch proposed on bugzilla (link above), could you and/or Tony please test it? Tested using patched 2.4.10 Debian Jessie's sources: it works! (I posted a vhost sample in BZ) Note that mod_cache verbose logging still log the wrong (unparsed) keys. Thank you very much Yann! I'll be happy to see this land in the next 2.4 - To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org
Re: [users@httpd] AW: mod_cache/mod_cache_disk responses missing Content-Type header
On Mon, Dec 21, 2015 at 11:39:55AM -0500, Eric Covener wrote: > On Mon, Dec 21, 2015 at 11:25 AM, Alexander Härtig >wrote: > > AH00717: Premature end of cache headers. > > The error reporting is very poor there. Are you able to patch > mod_cache_disk and run with at least LogLevel debug? > > http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_cache_disk.c?r1=1721210=1721209=1721210 trace8 brings nothing new w.r.t debug (as sent in my previous email) I found the following behavior interesting : GET / => OK # put in cache POST / => OK # invalidate cache POST / => not OK # cache_disk:error AH00717 My guess is that it comes from following patch from 2013: > mod_cache: Invalidate cached entities in response to RFC2616 Section https://mail-archives.apache.org/mod_mbox/httpd-cvs/201305.mbox/%3c20130528203005.1a55d2388...@eris.apache.org%3E * It seems it introduced a CACHE_INVALIDATE filter (for which, sadly, I didn't find much documentation) * I guess it introduced an invalid code path triggering invalidate_entity() => recall_headers() for an already invalidated entity. Maybe this error it just the symptom of trying to invalidate a "removed" entity twice. When doing tests I was also able to encouter easily: > AH02468: cache: Attempted to invalidate cached entity with key: > http://:80/index.php? by just playing a bit with htcacheclean (side note: htcacheclean -A is an incorrect usage, but an unexpected behavior) Going further, I guess that the second invalidation shows this issue because the first invalidation (in during the first POST) failed to output a valid mod_cache file. Attached the initial cache header file (GET.txt, just after a GET), copied from /var/cache/apache2/mod_cache_disk/6q/m_/*.header.vary/ou/Ye/*.header and then just after a POST was issued (successive POSTs cause the error but don't change this file anymore) : POST.txt I hope it makes things clearer and could help bringing up a full explanation + fix + workaround. thank you � &