Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] Support concurrent requests without 503 responses
Instead of offloading the work to wait for the final page content, concurrent requests now wait for the real page content to be rendered (and deliver the content from cache once ready) instead of sending a 503 response code and the famous "Page is being generated" message. The logic to wait for the rendered page (lock and wait) is already there thanks to the page locking, but was deliberately circumvented by the temporary page cache content before to get rid of waiting requests in high-load situations. This approach to simply skip the temporary cache and wait for the renderer to finish has been tested using the skip_page_is_being_generated extension in wild for 3 years (for TYPO3 v6, v7, v8 and v9). Note: In case the increased number of waiting requests has a negative impact on sites with high server load, a additional proxy cache should be considered in front of the server to make sure clients are served a valid response without waiting until new content is ready. The motivation for this change: The 503 status code together with the "Page is being generated message" does not only occur for slow or high traffic sites. It will be displayed even for two concurrent requests, no matter how fast the page rendered or how low the current traffic is. The requests only need to (nearly) arrive at the same time. This can easily be reproduced using two parallel curl requests: for i in {1..2}; do curl -sv https://doma.in/foo |& grep '^< HTTP'& done There would be one "503 Service unavailable" response when /foo has not yet been rendered to the cache before. An explanation for the releaseLock('pagesection') addition in TSFE::getFromCache(): This has been added as the pagesection lock – which is acquired in TemplateService::start() – was implicitly released in setPageCacheContent() before. Now this would block concurrent rendering for pages with $_GET-aware plugins, therefore we release the pagesection lock early, after the pagesection cache has been generated. Releases: master, 9.5, 8.7 Resolves: #87980 Change-Id: I034f410335b3035c5863b26e3e689ca29b5f3f80 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60656 Tested-by: TYPO3com <noreply@typo3.com> Tested-by: Jonas Eberle <flightvision@googlemail.com> Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de> Tested-by: Benjamin Franzke <bfr@qbus.de> Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de> Reviewed-by: Benjamin Franzke <bfr@qbus.de>
- Loading branch information
Showing
4 changed files
with
70 additions
and
115 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
...n/Changelog/9.5.x/Important-87980-PageIsBeingGeneratedMessageHasBeenRemoved.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
.. include:: ../../Includes.txt | ||
|
||
====================================================================== | ||
Important: #87980 - "Page is being generated" message has been removed | ||
====================================================================== | ||
|
||
See :issue:`87980` | ||
|
||
Description | ||
=========== | ||
|
||
The "Page is being generated" message and the corresponding | ||
temporary 503 response have been removed. | ||
|
||
Instead of offloading the work to wait for the final page content, | ||
concurrent requests now wait for the real page content to be | ||
rendered (and deliver the content from cache once ready) instead | ||
of sending a 503 response code and the famous "Page is being | ||
generated" message. | ||
|
||
|
||
The motivation for this change: | ||
The 503 status code together with the "Page is being generated message" | ||
does not only occur for slow or high traffic sites. It will be displayed | ||
even for two concurrent requests, no matter how fast the page rendered | ||
or how low the current traffic is. | ||
The requests only need to (nearly) arrive at the same time. | ||
|
||
Note: In case the increased number of waiting requests has a negative | ||
impact on highly frequented servers, a additional proxy cache should be | ||
considered in front of the server to make sure clients are served a valid | ||
response without waiting until new content is ready. | ||
|
||
.. index:: Frontend, ext:frontend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters