开发者

best http server solution for multiple requests + php interpretation [closed]

开发者 https://www.devze.com 2023-03-23 07:44 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 11 years ago.

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:

  1. httpd(MPM worker module) + php + fastcgi or
  2. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号