4 ms·
If the PHP responses are relatively static, adding a bit of caching in front of it will improve the responsiveness and decrease the load dramatically. Simply ad
by falcolas 11y ago
If the PHP responses are relatively static, adding a bit of caching in front of it will improve the responsiveness and decrease the load dramatically. Simply adding a 5 minute cache let us scale one PHP application from 100 concurrent to "SSL & gzip require more CPU than PHP". We figured that was sufficient.
More dynamic applications (like a commenting system) might feel better at 10-30 seconds of caching with expiration commands, but it will still help scale up significantly.
- miseg 11y agoBy caching, you mean like script execution caching that PHP accelerators give? https://en.wikipedia.org/wiki/List_of_PHP_accelerators https://en.wikipedia.org/wiki/List_of_PHP_accelerators Am I right in thinking that such caching comes built-in with PHP 5.5+ ?
- semerda 11y agoLook at Varnish Cache https://www.varnish-cache.org/ https://www.varnish-cache.org/ and Google's PageSpeed module on the server. https://developers.google.com/speed/pagespeed/?hl=en https://developers.google.com/speed/pagespeed/?hl=en
- miseg 11y agoThanks. That's quite added complexity in my scenario, which I think I would avoid.
- falcolas 11y agoNginx and Apache have built in caching which can usually be easily enabled, which while arguably not as fast as using Varnish (Nginx in particular will serve cached content from disk using sendfile, as opposed to Varnish's in-memory caching) are still faster than calling back into PHP.
- semerda 11y agoPageSpeed is 1 liner installation on your instance. It will compress assets etc automatically as Apache serves them. Worth adding to your deployment script.
- miseg 11y agoNice. I like how it could be installed in Apache, and then left to its own devices.