When too much HTTP header data is sent back during an HTTP response, these can be logged as a successful response on the Web (Apache/PHP) layer (showing a "200" status code on access.log), but trigger a 503 sent back to the browser/client.
Since there is a hard limit in Acquia Cloud around the size and number of headers a response can have, you must reduce the number of headers and/or data by:
- Disabling some modules
- Limiting the data using a special custom module
Common cause: the D8 Core Content Translation module
A common issue is triggered by the Content Translation code module adding many "Link" headers on a response. The Content Translation module exposes link relations both at the HTTP level (Link response header) and the HTML level (<link> tag in HTML <head>). This can easily exceed the number of allowable headers. The particular Link headers are generated because of this code within content_translation_page_attachments():
$page['#attached']['html_head_link'] = [ [ 'rel' => 'alternate', 'hreflang' => $language->getId(), 'href' => $url, ], TRUE, ];
To alter the module behavior so that it no longer adds a Link response header, create a custom module and implement hook_page_attachments_alter() to set the boolean to FALSE for all html_head_link elements.
On Acquia Cloud, the soft limit is 60 individual headers and/or a combined total of 23kb of header data. Requests which exceed the soft limit may serve 503 status codes from Varnish and 200 from the Apache backend.
Drupal 8 and certain contributed modules may increase the size of headers sent out with each response, so that
We are working towards a Varnish configuration change that will remove this soft limit. In the meantime you may need to adjust your site to emit less header data.