Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a simple 2kb PHP script that I want to host on my own domain. Soon, i'll connect it to a mySQL database and add Google Analytics. But thats pretty much it. There is no physical content or even webpage per say involved in my app. I do want to be able to handle and redirect a huge amount of requests. I'm guessing it could spike to ~1k a minute. Anybody got server recommendations for an app of this kind? Or any advice?

share|improve this question

migrated from Sep 21 '10 at 0:52

This question came from our site for professional and enthusiast programmers.

Apache is a good option. It's free, open source, fast, and secure (if you configure it correctly).

share|improve this answer
Yeah, I'm running Apache as part of WAMP right now. I'm wondering, I guess if I should go dedicated or if I should chance it and run it off my own PC. It's powerful enough, 6gb of memory, i7 etc. and I keep it running 24/7. But I also use it for everything I do, and usually have it running 10 to 15 programs at a time. – egfx Sep 16 '10 at 21:29
Don't use your own computer as a webserver if you are actively using the computer. It's ok if you just want to use it as a webserver internally (like within your own office), but if you plan on making your site live to the public, don't do that. :) – SimpleCoder Sep 16 '10 at 21:32

Avoid pre-built web applications stacks as they tend to contain too much garbage. Also, PHP + Windows does not play so nicely, atleast I haven't heard about any large scale PHP on Windows deployments (consider that I am mostly *nix guy and rarely follow news in Win32 world).
Apache with mod_php is not as fast, as much of PHP library code is not thread safe, meaning that you must stick to slower mpm-prefork. You can run faster mpm-worker with PHP as FastCGI, but if you`re using FastCGI, you can use more lightweight web servers like nginx.
Remember to setup PHP APC cache, as it will give speed-up with no cost, caching PHP opcode and avoiding expensive code parsing.
Most web apps are IO bound. Try to avoid hitting DB and/or disk by using memcache or other in-memory cache (for example - redis).
Remember tuning FastCGI children count - for example, if your script takes 0.05 sec to load and you are expecting 1k/reqs per second, you need 50 PHP FastCGI processes (Just adjust PHP_FCGI_CHILDREN).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.