best http server solution for multiple requests + php interpretation [closed]
I'm currently working on a service that will allow users to put on their sites a script file(javascript) that is going to be load from my http server, there for I can expect to handle a lot of http requests. Also the javascript file is generated using php(it has to be dynamically and I can't change that - so I use php to generate it).
Since some of my customers will prob开发者_C百科ably have sites with 50-60k visitors/day I can expect to have at least 1-2 million requests/day.
So.. back to my question. Obviously I can't use Apache httpd (MPM prefork module) + php since every process eats around 17-18 MB RAM and my ram is not unlimited.
So far Apache httpd(MPM worker module) + php is not working very well because it still undetermined if php is thread-safe or not, even if they claim that it is(search google to see more info).
So.. I was thinking of using:
- httpd(MPM worker module) + php + fastcgi or
- nginx + php + factscgi
To be frank I've heard that nginx is good for static pages, that's why I want to ask you if is working ok with php + fascgi on large amount of requests. Whould I have the same memory problem like using apache httpd but this time the memory will be made by fastcgi?
What do you think I should choose: 1 or 2? or do you have other solutions?
Thanks
The first thing you should do is benchmark your server.
The second thing is to check what your bottlenecks are (php, database, CPU usage, memory, disk access etc.) so you know what to work on.
Then you can bother trying to find solutions to your problems. If it's mainly php, do you use some cache and is it well configured ? If it's your database, can you change its architecture to have something better. If it's your server, check if nginx, lighttpd or apache with better settings or a combination of them can do the job.
精彩评论