5 ms·
Get rid of mod_php, replace it with a nice build of php-fpm (included in 5.3 actually) tied to nginx via fastcgi. Bam. Nginx will handle all static content SUPE
by whalesalad 16y ago
Get rid of mod_php, replace it with a nice build of php-fpm (included in 5.3 actually) tied to nginx via fastcgi. Bam. Nginx will handle all static content SUPER fast while keeping an incredibly small memory footprint, while passing dynamic requests to the PHP side of things via fastcgi.
Example of one of my nginx configuration files, for a Wordpress site: http://paste.pocoo.org/show/256982/ http://paste.pocoo.org/show/256982/
This will only do so much, but I suspect it will solve a great deal of your problems. The final bit of advice that I can give is to look into any caching modules for Drupal. Simple disk caching will do the trick, just something to prevent lots of DB reads. I'm unfamiliar with Drupal, but I'd imagine there are loads of modules out there that can assist with caching.
- pilif 16y agoI don't know about php-fpm, but the old fastcgi implementation was extremely buggy when we tried that with lighttpd back when there was no nginx yet. Burned like this, I'm currently using Apache/mod_php for all dynamic content but let nginx serve the static files (using a reverse proxy configuration. Turn off KeepAlive in Apache!). This works extremely well and totally stable. Even though php/fastcgi is now a more common configuration than it was back then, mod_php is still more common and hence better tested.
- bartman 16y agoI have php-fpm running behind nginx in a production environment for over a year now, it's been very stable. The graceful restarts and statistics (slow execution log) far exceed what other fastcgi or mod_php implementations provide.
- seunosewa 16y agoOr you can just put nginx in front of apache.