Use Nginx + php-fpm for better performance
Is your feature request related to a problem? Please describe. Apache with php-cgi suffers from performance issue when there is a lot of incoming connections.
Describe the solution you'd like Use Nginx web server with php-fpm instead of Apache2 + php-cgi
Do you have any tests / benchmark results to compare the performance between apache & nginx with Nominatim?
I think nginx really is (or at least was) faster when you have thousands of concurrent connections. Is this what you're facing?
I think nginx really is (or at least was) faster when you have thousands of concurrent connections. Is this what you're facing?
Absolutely, as I recall php-cgi on Apache2 is fork based, each connection would fork a new apache process. Though the database can't handle 1000x concurrent connections, it makes the pressure on the webserver and php much lower.
Nginx with PHP-FPM is also document in official installation guide, it's can be drop in place into the dockerfile.
My question was more along those lines: is a load of thousands requests/seconds a problem that you're facing or have you just read somewhere that nginx is faster than apache?
Yes, for this reason I had to drop running it in docker and installed a vm version with nginx.
I would not be averse to switching to nginx but you'd have to solve the the log rotation which is a bit tricky.
Would you be willing to try nginx privately and send a PR when you've tested it with your high load environment?
@philipkozeny WDYT?
I would not be averse to switching to nginx but you'd have to solve the the log rotation which is a bit tricky.
Would you be willing to try nginx privately and send a PR when you've tested it with your high load environment?
@philipkozeny WDYT?
sounds good to me.
@AnthraX1 you can test with https://github.com/darkBuddha/nominatim-docker/tree/master/4.1-nginx
IMHO, Nginx should always be preferred over Apache.
We have started the 'n7m' project, a Numeronym for Nominatim. It's not nearly as mature as 'nominatim-docker' but something we have been experimenting with.
This branch has a FPM docker image with n7m fronted with an official NGINX Docker image: https://github.com/smithmicro/n7m/tree/main
We have yet to do any performance tests comparing NGINX+FPM to Apache. Have at it!
@dsperling That's a really interesting project. I hope you succeed and we can refer the people with more advanced use cases (which we have been reluctant to implement for fear of extra maintenance burden) to your project.
@AnthraX1 - PHP-FPM support has now been merged to the main branch of n7m and is working extremely well. Comments welcome. https://github.com/smithmicro/n7m