![]() |
NginX and Varnish
Anybody using either or both of these ? Opinions good or bad ? Any problems experienced or issues with scripts ?
Thinking of getting both and upgrading RAM from 8gb to 16gb. should speed things up dramatically right ? |
If you plan to have like 10-20k users online at the same time, yes. I think it is better to make load balancer. 1 server for mysql, 1 server for nginx and other servers having the nginx server partitions mounted or sth like that.
|
depends how you are using it.
but this combination works great. here is great read for you. http://ewan.im/900/10-million-hits-a...ng-a-15-server |
I using nginx since age of chaos and so far "load problems" is word which i no longer recognize.But again as i have pic sites only that might be one of the reasons why load is fine.And when it comes to varnish,i dont have experience with it(having optimized nginx did the job in my case)but it's not only caching solution,you might try several ones before picking right one.
And when it comes to script issues,that is indeed one of problems when using nginx -first,some scripts could have toocomplicated regex which cannot be converted to nginx automaticly,so then unless someone already converted regex to nginx format it will be toomuch hassle to find right regex -second,some of php functions are exclusive to apache like php include virtual and that make it impossible to make it work on nginx,and some other functions as well That problem can be resolved by proxying certain domain to apache,so if i need to use script which not working properly on nginx or have toocomplicated regex then i simply proxy it to apache.In shortly you will need to make several tests before finding the right solution. |
Thanks, so are you saying that if I install Nginx I will have problems with PHP includes, for example.......<? include("filename.php"); ?>
|
Ok I've done some reading up, the main purpose here is to give a boost to a dynamic social network site using PHP Fox, so if I'm veering to just getting Varnish. I can't be doing with sorting out a lot of Php problems if that's what Nginx might bring.
|
Quote:
php include virtual i.e. virtual() ref : http://stackoverflow.com/questions/1...tion-for-nginx and if you site load is too high and php code is not too complecated and not using eval functins , then try looking in to hiphop by facebook, lowers the resources by upto 50 % . nginx as reverse proxy hiphop as web server. varnish for cache. |
If you use nginx, you will need php-fpm to run php scripts to begin with...
|
Quote:
I peaked at google to see what they say about varnish and found this article: http://rtcamp.com/tutorials/why-we-n...sh-with-nginx/ and i agree with article author as nginx indeed can be optimized enough so then there is no need for any further optimization. As you would use nginx proxy to apache,you will then have chance to optimize both nginx and apache,and then might not be need to use anything else further. So in shortly do this and post back when you get results. |
as someone who has used that platform, stay away from it or get ready to spend a lot if you get any sort of traffic and it still will under perform
|
Quote:
|
really depends on setup... Nginx is good for serving static stuff (jpg, gif, png, css, js, html) while varnish can cache all that in memory for really quick responses. It also caches dynamic content so in general it lowers the load and increases performance by far. It's bit complicated to configure...
I have some experience with both and if anyone need any help - feel free to contact me at celebempire{at}gmail.com http://www.awmzone.com/services |
Quote:
|
Varnish "can" be very good, but with dynamic sites you'll need to dip a lot into its configs and exclusion files etc. to make sure which pages get cached and which don't. With e-commerce it can be a bitch, more so when you have a pair of them load balancing.
Look at something like new relic as well, that can monitor your apache/PHP/MySQL an tell you down to the lines of code what is and isn't performing. It may well identify a bottle neck elsewhere rather than just a lack of grunt to handle requests. |
First of all you should install xdebug (or another php debugging extension) and see which part is eating the most cpu/ram. If its mysql, then you need caching (eg: memcache or redis), or you can also move mysql to another server, if the problem is with I/O then you need faster hdd's. If the problem is related to requests been queued then you need to load balance. Nginx will make static requests (like css/images/js) a lot faster, and with php-fpm it will also make dynamic (php) requests a little faster (not very much). I have never used varnish before...
|
All times are GMT -7. The time now is 07:49 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123