Status
Not open for further replies.
@SplitIce

All is saying that nginx rocks. the fact its not.

Nginx serve static files well, I agree. But for CGI , PHP based sites its apache the one.

nginx 10k test is based on 1k html/jpg file. try something on realworld mate.
 
Good evening, have little problem with Nginx configuration. I'm using it for script who streaming data to user from another server, so it's like proxy. But this action requires lot of CPU time. I have almost default Nginx configuration, it works with fast-cgi, i wonder maybe some one know something about tweaking Nginx for streaming/proxy?
Fast-cgi
 
And like I said, fast-cgi will always fail, especially with big sites...I should know.

If you're going to test it, use php-fpm with nginx, against apache with prefork-mpm.

I guarentee that nginx and fpm will put less strain on the server and use less resourses. Combined with an opcode cache, you will kick apaches ass.

In terms of serving static content (i.e streaming .flv from you're server) nginx will easily out perform apache. If you look at any of the big image hosting sites you will find the majority use nginx, plain and simple.
 
Running 12h on apache prefork-mpm CPU usage now very low, however RAMs is out of control...maybe need some fine tuning.

Will test Nginx with php-fpm tomorrow. Here is the screens:

cpu.jpg


and RAMS

ram.jpg
 
I would recommend you get help from Nginx irc channel
some very good skilled people there.

half the people here don't know squat and other half are/maybe right but can't pin it.
 
The final argument ender

@SplitIce

All is saying that nginx rocks. the fact its not.

Nginx serve static files well, I agree. But for CGI , PHP based sites its apache the one.

nginx 10k test is based on 1k html/jpg file. try something on realworld mate.

Im not saying it rocks without real world experience,

TheWarezScene

lets go back to 2008/09 I cant rember exactly when (around the time worldstream did its purge of sites), TheWarezScene was getting roughly 10k UV per day, 60K Pageviews to PHP per day (ajax and shoutbox included)

We where running on a Premium Server XL from worldstream and it was the only site on the server, we tried apache-mpm-preform, apache-mpm-worker and even apache-mpm-event all using mod_fastcgi with APC (Prefork was tested with mod_php (what we ran origionally) but that crashed the server instantly with a massive loadspike). TheWarezScene was the only major site on this server. Prefork was the worst performer and memory consumer, apache + php-cgi usage was over 3GB and using 100% of the cpu almost always. (Yes we also run xcache)

First we put a nginx service in front of the server and the load dropped from high teens down to 7-8, mostly due to the offloaded static file serving, we where also able to enable keepalive which previously was impossible due to it tieing up a thread/process in all but mpm-event which was buggy.

We then got kicked off our worldstream server in the infamous mass mail (woot I got 3 emails), we moved to a smaller server with server.lu, we migrated to nginx + php-fpm howeaver we ran apache in front for the mod-rewrite we needed until we converted the rewrite rules. This got load down a little but it was in the low teens due to the downgrade, apache was chewing ram & cpu and keepalive had to be disabled again

We then fully moved to nginx and php-fpm, now we sit at an average load of 1 with a spike once a day for awstats and a few other crons. We handle 150K php requests a day for 25K uv (mostly due to an unfixed bug in the ajax link checker)

My reverse CDN

We handle close to 8TB a month of traffc, all passed through the dynamic proxy_pass framework (the same framework as fastcgi_pass). This is handled by a nginx process that never exceeds 80MB ram usage and never registers more than 2% CPU (avg: 0). This includes gzip and unlimited keep alive timeout.



Name any other webserver in that range and ill eat my hat.

q2pgty.png

fwptmy.png

The memory and load includes all the other parts of the web server including php-fpm and mysql on the Reverse Proxy. Also includes the cache system in development (30MB Key cache)
 
Running 12h on apache prefork-mpm CPU usage now very low, however RAMs is out of control...maybe need some fine tuning.

Will test Nginx with php-fpm tomorrow. Here is the screens:

cpu.jpg


and RAMS

ram.jpg

Ive never seen anything like that my first guess would be what have you changed in the config. The most likely culprit for an ex-apache user is that they change the worker_processes and set it to something like 100-255 thinking that its a 1 process per request system when its not (each process can handle 1024+ connections depending on config). Other ideas include keep alive and gzip maybe.

Another idea ive seen people do is set their proxy/fastcgi cache key zone to a few GB thinking that it helps when it doesnt. (each key is 64bytes or something, unless you are storing 16,777,216+ cache entries that amount of key zone is useless!)

Thirdly nginx shouldnt spike, the nature of its event model means that it should remain constant, if its spiking something is definately wrong (check logs for segfaults and process restarts maybe? Maybe due to missconfig.)
 
SplitIce, get a real life. lol ur saying 25k unqiue is big scenario. I am dealing with around 300K daily. the competitive to apache i found was only litespeed.

and nginx never spike, it will just give 504 error to uncapable requests.
 
Apache is just the best, why? It's used by cPanel. It's the default webserver of cPanel and I think those freaks @ cPanel Inc. know a lot more about webservers than we know.

Anyway, stick to the thread and help the OP.
:)
 
SplitIce, get a real life. lol ur saying 25k unqiue is big scenario. I am dealing with around 300K daily. the competitive to apache i found was only litespeed.

and nginx never spike, it will just give 504 error to uncapable requests.
Never did I state that that it was the biggest scenario, and 150K php views/day is still alot for a single server in any ones books.

Id hate to know how much the Reverse proxy pushes as far as (pageviews/requests)/day

litespeed is a fine webserver - it uses the event model same as nginx.




--

Lighttpd would be fine cept its memory leaks are its downfall and Mo0 doesnt develop much any more both lighttpd and Xcache are falling behind.

--

localh0st - No offence but cPanel isnt made for performance or thuroughput its made for newbies. It uses apache because its whats been around for the longest and supported by most scripts out of the box because of that, nothing more. By no means does it mean that apache is the best

--

Also dont think that I dis apache, its a great server for localhosts/testing server -- its what I run internally on my box atm, .htaccess makes it easy to test a debug config without a server restart but in practice its a real performance drain with the number of stats required to serve a page.

--

Heres some benchmarks a quick google found:
nginx-apache-reqs-sec.png

nginx-apache-memory.png


I think this one is quite interesting as it highlights litespeeds performance, (howeaver its not suitable for warez sites as they wont licence it to us and if you want to crack it go ahead, but its a can of worms most people woudnt want to open)
k19xaa.png
 
Well said SplitIce. I agree about lighttpd and xcache. I actually recently switched to apc as was having strange authentication errors with xcache.

I was going to chime in and say something about cpanel earlier, but I thought my comment would sound a bit rude and be off-topic. :P

All I would say, is that if anyone consideres themself a proper webmaster, they wouldn't use cpanel, or any panel for that matter. Plus, its actually more fun setting it up yourself anyway and while doing it you increase your knowledge of linux systems.
 
Ive had ~500k php views/day without any problems (nginx + php fastcgi) on single quadcore server, so nginx is great for not only static stuff
i would recommend php-fpm now as desiboy said
btw i also use apache on my pc for testing purposes
 
Apache is just the best, why? It's used by cPanel. It's the default webserver of cPanel and I think those freaks @ cPanel Inc. know a lot more about webservers than we know.

Anyway, stick to the thread and help the OP.
:)

cPanel gets paid by the Apache Foundation.
They own the market using Microsoft's method.
 
approx 10 K uniques / day

bandwidth graph

e5f38ee1.png



memory usage -- Nginx

82d66912.png


will post apache's later ..it will be more than 500 MB + for sure :P
 
Status
Not open for further replies.
Back
Top