Some setting calc on nginx
http://myshell.co.uk/blog/2012/07/adjusting-child-processes-for-php-fpm-nginx/
Thêm 1 giải thích dễ hiểu cho nginx why :
People here already touched on most the reasons. So I'm just going to throw in some more "why". Personally, I don't run apache anymore, unless I have to. I'll get into that too.
Why nginx is good at serving static files?
It's not any better/worse at serving static files than Apache. However, the big difference is that nginx can serve a lot more users without using up additional resources.
Apache makes copies (process forks) of itself for every request, be it PHP or a css file. Each running version eats up more RAM. So you have a very low limit on the number of things it can do at one time.
Nginx on the other hand uses a fixed amount of RAM because it is event driven. So you can use your RAM for other things, like PHP.
Why nginx + apache?
nginx is configured to serve the static (js, css, img) files. So you have a fixed amount of ram handling all the regular files. No need to use up a fat copy of apache to serve something simple.
apache+mod_php, can just focus on creating dynamic HTML. Which means more effective use of your precious RAM.
Why nginx+phpfpm
To slim and simplify things even more I run nginx+phpfpm. This gives me nginx's great static file serving capabilities plus PHP without the additional overhead of Apache.
IMO this is the future. It is very stable and quite fast. Plus I've found nginx to be a lot easier to configure, with a more terse configuration file than Apache.
http://myshell.co.uk/blog/2012/07/adjusting-child-processes-for-php-fpm-nginx/
Thêm 1 giải thích dễ hiểu cho nginx why :
People here already touched on most the reasons. So I'm just going to throw in some more "why". Personally, I don't run apache anymore, unless I have to. I'll get into that too.
Why nginx is good at serving static files?
It's not any better/worse at serving static files than Apache. However, the big difference is that nginx can serve a lot more users without using up additional resources.
Apache makes copies (process forks) of itself for every request, be it PHP or a css file. Each running version eats up more RAM. So you have a very low limit on the number of things it can do at one time.
Nginx on the other hand uses a fixed amount of RAM because it is event driven. So you can use your RAM for other things, like PHP.
Why nginx + apache?
nginx is configured to serve the static (js, css, img) files. So you have a fixed amount of ram handling all the regular files. No need to use up a fat copy of apache to serve something simple.
apache+mod_php, can just focus on creating dynamic HTML. Which means more effective use of your precious RAM.
Why nginx+phpfpm
To slim and simplify things even more I run nginx+phpfpm. This gives me nginx's great static file serving capabilities plus PHP without the additional overhead of Apache.
IMO this is the future. It is very stable and quite fast. Plus I've found nginx to be a lot easier to configure, with a more terse configuration file than Apache.
Comments
Post a Comment