By Greg Nowak. Last updated 2026-11-16.
HTTP/2 is enabled, the homepage feels quick, and then a campaign lands. Product pages hesitate, searches drag, or enquiries time out. Before buying more server capacity, find out where those requests are waiting.
HTTP/2 lets multiple requests share a connection. It does not increase the number of PHP processes available or make application work finish sooner. A useful investigation connects the customer’s delay to a measured constraint, then tests whether a specific change improves it.
Start with the customer journey and the request path
Choose the journey that matters commercially: browsing campaign pages, searching a catalogue, or opening a booking form. Record what becomes slow, when it happens, and what an acceptable response would look like. A fast homepage tells you little about a slow search.
Then map the deployed route: browser, CDN or cache, NGINX, Apache where present, PHP-FPM, and application dependencies. Browser-to-NGINX HTTP/2 says nothing about the protocol used between NGINX and Apache. If NGINX sends PHP requests directly to FPM, leave Apache out of that investigation.
Compare a confirmed cache hit that avoids application execution with a representative dynamic request. Keep cookies and authentication state explicit: they may change which route a request takes.
| Observation during the same test window | Next check | Decision it can inform |
|---|---|---|
| Cached responses stay quick; dynamic responses slow | Application workers, slow traces, database and external-service timings | Whether to investigate execution time or available application capacity |
| Cached and dynamic responses both slow | Shared infrastructure, network path and test-generator capacity | Where to investigate before changing PHP settings |
| FPM reaches its child limit as delays rise | Worker memory, CPU headroom and what busy requests are doing | Whether more workers are feasible or requests need to finish sooner |
| Higher HTTP/2 stream counts expose delays | Negotiated protocols, backend queues and Apache MPM where relevant | Whether multiplexing is exposing an existing processing constraint |
Build a baseline someone else can repeat
Record the endpoint, headers, cache state, installed versions, test location and expected response. Use an authorised environment and a read-only request. For production, agree on a test window, monitoring owner and stopping conditions before generating load.
The official h2load guide documents concurrent clients (-c), streams per client (-m), request count (-n), duration and warm-up. These examples illustrate a short comparison; their settings are not a universal safe load. Replace the example URL with your approved endpoint:
h2load --h1 -c5 -m1 --duration=10 --warm-up-time=2 https://staging.example.com/read-only-page
h2load --alpn-list=h2 -c5 -m1 --duration=10 --warm-up-time=2 https://staging.example.com/read-only-page
h2load --alpn-list=h2 -c5 -m5 --duration=10 --warm-up-time=2 https://staging.example.com/read-only-pageThe first two runs compare protocols with one stream per client. The third increases HTTP/2 streams while holding client count steady. Confirm the negotiated protocol. Duration-based runs ignore -n.
Repeat against cached and dynamic responses. Record timings, throughput, failures and status codes, and separately verify expected content. Fast error pages are not successful customer journeys. This endpoint benchmark also does not measure browser rendering or reproduce an entire checkout.
Check Apache only where it handles the affected traffic
The Apache HTTP/2 guide documents a significant restriction: with the prefork MPM, mod_http2 processes one request at a time per connection by default. A slow request can therefore delay others sharing that connection. Apache recommends the event MPM where compatible.
This explanation applies when Apache is handling HTTP/2 on that connection. If NGINX talks HTTP/1.1 to Apache, investigate Apache worker availability without attributing it to that HTTP/2 restriction. Check application and module compatibility before changing MPMs, and measure worker occupancy and memory during the test.
Read NGINX keepalive settings correctly
keepalive 32 describes cached idle upstream connections per worker; it does not cap backend processing at 32 requests. The NGINX upstream documentation states that version 1.29.7 introduced default upstream keepalive caching of 32 connections per worker, with reuse local to each location. HTTP proxying also defaults to HTTP/1.1 from that version.
Check your installed version and effective configuration before borrowing a tuning example. Earlier versions need explicit configuration for those behaviours. For FastCGI connection reuse, fastcgi_keep_conn on; is also required. Treat reuse as something to evaluate against the backend’s capacity and measured connection overhead, rather than enabling it as a blanket performance fix.
Investigate PHP-FPM saturation and slow execution together
pm.max_children limits simultaneous requests served by an FPM pool. The static, dynamic and ondemand modes determine how processes are maintained. These controls are defined in the PHP-FPM configuration manual.
Configure a slowlog destination and request_slowlog_timeout to capture backtraces of slow requests. For visibility when the main pool is occupied, pm.status_listen provides independent status handling; configure the status path and web-server routing too, keeping access private.
Before raising the child limit, measure memory during representative work and reserve capacity for the operating system, database and other services. Check CPU pressure and dependency timings alongside pool activity. More PHP workers can increase contention when requests are already waiting on an overloaded database.
Finish with a decision, evidence and a repeat test
Make one targeted change, retain a rollback path, and repeat the baseline. Judge success against the affected journey’s response-time target, correct content and acceptable failure rate. Record the tested workload and what remains untested so the result supports a sensible capacity decision.
If recurring peaks are disrupting sales or delivery, talk to Greg about a focused performance investigation. Bring the affected URLs, traffic window and available monitoring. A useful scope covers the baseline, evidence of where requests wait, a targeted intervention and a repeat test—giving owners, operations leads and agency teams a clear basis for the next investment.
Related on GrN.dk
- NGINX 1.30 and upstream connection reuse: what to check before upgrading
- Nginx 1.30 Changed Upstream Connections: What to Test Before You Upgrade
- A stray Set-Cookie can waste your CDN: audit the cache at the edge
Need help with this kind of work?
Discuss a performance investigation with Greg Get in touch with Greg.