开发者

apache or nginx or lighttpd for group message and chat service

i have to host an application where a user posts a lot of text messages, pics ,audio and video files . Consider it very similar to the fb message service so we are confused over continuing to 开发者_如何学运维use apache or use other options like nginx ,lighttpd so how to decide and choose one over another and why. Please help out with your answers


You can use nginx as reverse proxy with apache. where nginx will handle static files, and apache handle dynamic files.


Your question touches the surface of different webserver architectures, forking versus threading. There's this older article from Philip Greenspun about AOLServer which is nice to read and a more theoretically complete background article that is linked to from the nginx wiki.

While servers like nginx are handy in situations where you have to answer lots of lots of (also very short/small) simultaneous requests and the servers don't waste a lot of memory, things change when it comes to the kind of application you build.

Is it a very big and complex application that runs fine with PHP? You can proxy it and benefit from letting nginx crank out the static files. So Apache and the PHP module do only PHP work and nothing else. Or do you have long running fast cgi processes that run on their own? Then a pure apache setup (with a lightweight compiled apache with only the needed modules) could also be completely sufficient in your case.

If you do split setups with a frontend server proxy it's sometimes not easy how to develop progress bars for visualizing uploads, btw. Some servers eat the complete upload and put it to the backend in one piece.

But, I can tell that nginx is a good choice as it handles lots of parallel (keepalive) connections very well with little memory, even https connections.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜