![]() |
who here has setup nginx?
having issues getting php to work.
curious on peoples setup. :helpme |
wild guess.
try removing .htaccess files., |
I wish I could remember some php on nginx tips, but there were other nginx problems after that made me forget about the PHP stuff. Nginx seems to be one problem after another, so we just added noatime to fstab and went back to a perfectly working, standards compliant Apache setup.
|
Quote:
|
Quote:
|
I can send you tutorial to mail written by me if you want.
|
Quote:
|
php-fpm is what you want I think
|
Not sure, just use it for streaming media.
|
you will get even better performance out of apache with varnish in front.
|
Fris, I'd not recommend you go that route... Its great for dissing up plain html, thumbs and stuff, but php-fpm just slows everything right down.
If you still carry on, make sure you test with ab both pre and post nginx |
Quote:
|
Nginx is running wp like a mofo on speed!!
|
Quote:
|
Quote:
|
Quote:
|
got it setup fine, just need to tune php-fpm.conf
|
Quote:
|
Quote:
Quote:
Quote:
Quote:
I run an API server that is heavily PHP dependent and has 30million+ requests daily. Load was a bit nuts at one point early last year (load 5ish) and it was only serving around 10mill around then, so I gave nginx+php a try. Configured it to the minimum but it thrashed around like hell, sending load way high. Continuously. The reason being the php-cgi spawing was costing too much. So, I stripped apache down, tweaked all the settings, now server load is a VERY steady 0.05 with 30mill+ hits. So, I still hold that apache wins hands down. Well, for high traffic sites that is... your wp may well run smooth and quick, but wait till it gets enough traffic to start spawning children :thumbsup |
Quote:
|
borked, how well did you tune php5-fpm? Did you set it up as a socket or used tcp? Did you use the same caching (built-in to nginx) methods in both? It might just be that you're more familiar with fine-tuning Apache.
|
tbh, I don't know now - it was way back at the beginning of 2011. All I remember was I gave it all the resources I could and it still couldn't handle the load (watched by server-status seeing all the slots fill up, and cpu spike).
I tried it on and off for a few days until I called it quits and got dirty with apache. Honestly never looked back since. Still, I'm not saying bad of nginx - I use it for thumbs on another server that runs at 2-500mbs (adult stuff, not an API) so that I can use apache with keepalive on for the harder processing. That combo works sweet and brought load down from ~8 to 3. Without nginx handling the thumbs, I couldn't have keep-alive on in apache. Every circumstance is different I guess - I just wouldn't switch to nginx just cos it's what the other boys are doing... look at your situation and try both in different combinations. Just like I love MySQL, but things were getting crazy (yes, db optimised to hell). Once I figured out where the bulk of the queries were, I moved them over to lucene/solr and shit has been plain sailing ever since. I never eliminated MySQL, but combining both "just made sense" and the server lives happily ever after. There is no "one size fits all". A server configuration needs to adapt based on the specific requirements. That's my lesson for today ;) |
Quote:
|
Quote:
You can tweak it to the bone, and it will run stable and superfast. Check out yoast.com, he has some nice posts on nginx server setups and they rock. |
Quote:
For every need there is a different solution... |
apache 2.4 was just released, with a lot of speed enhancements. It's reported to be faster than nginx in some aspects. I haven't tested it yet, but it could be an option Fris.
|
Quote:
|
I would suggest Varnish Cache
|
If you do get it working, definitely DO test, with noatime. For best results, comment out the twenty Apache modules you're not using, like mod_speling. On a 400 Mbps site we did a lot of testing on, Apache was the winner. Speed on all was about the same once noatime was enabled because all severs were then doing the same things. With roughly equal performance, Apache's flexibility and correct implementation of standards pushed it over the top.
|
Ray were you using relatime before? If not, did it make a big difference? Does Apache have a noatime-like setting so you don't have to change the mount?
|
Quote:
It was not using relatime. Noatime versus default makes a HUGE difference in IOPS, so for small files, some databases, and those PHP scripts that include a bunch of different .php files. For small files, it cuts disk access roughly in half by making it one read rather than a read and a write. As far as I know, Apache simply follows the mount specification and doesn't have an option to seperately avoid atime within the application. mod_cache_disk to shm would do it, though. I haven't tested relatime under a heavy webserver workload. I use it on my desktop homedir and our IMAP server. |
I don't see how nginx can get around that if a disk mounted without noatime, since that's a kernel-level thing. Every file's access time is altered irrespective of software if noatime is not specifically specified.
|
Btw borked can you post httpd -m on that machine where you optimized apache ?
|
Quote:
anyway, here's the list for the member site server running at a few hundred mbs: Code:
Loaded Modules: Code:
CoreDumpDirectory /var/apache-core-dumps here are the stats at the low point of the day (current bw 154mbs) Code:
CPU Usage: u2635.41 s536.09 cu0 cs0 - .704% CPU load |
Why offload to nginx instead of another install of apache? Is it because ... nginx is better for that job?
|
Quote:
sure, I could put up another install of apache stripped bare on the same server, but have you ever tried to maintain two apache installs? nginx has the advantage because out of the box it is a bare-minimum httpd engine, that you build up. Apache comes out of the box quite loaded, that I end up stripping down. For a server that simply disses up jpegs, loading up nginx was a no-brainer. As ever, YMMV. If your server is happy running nginx for your sites, who the hell am I to tell you otherwise? |
it's like saying do you use tomcat or jetty, and why?
you can't group shit simply without knowing the circumstances let's have some fun with similes: nginx ==jetty == WBA lightweight == small footprint apache == tomcat == WBA heavyweight == big footprint |
Quote:
if you can send your setup ;) |
Quote:
.I have also some fancy codes which can optimize nginx further so can sent that too. |
ya thanks, got it setup already, just took me a while for the rewrite rules for one of my code igniter projects.
mainly went by this http://itresident.com/nginx/nginx-an...t-connections/ |
Quote:
note though his article title is misleading, since the majority of those 2k active connections are keep alives and with a timeout of 60seconds (very high imo) is likely to be dead timeouts that will gracefully timeout. He has 200/s reads, which is still a lot but nothing apache couldn't handle easily. fris if you have both setup, mind posting some benchmark test results with ab with same 100 concurrents? |
wtf is nginx. Damn now I got to google it...
|
You need VODKA to set up nginx. Drink vodka and it all starts to make sense. Not Wild Goose or whatever the fuck that shit is, because nothing makes sense if you drink that.
Luckily OPs name is also name of cheap and very good Danish vodka. Which, incidentally, is very difficult to get in Denmark. |
Quote:
Code:
open(filename, O_NOATIME, ... Quote:
|
Quote:
thanks Quote:
Quote:
it's not free but it's good and easy to use... Quote:
my services http://www.awmzone.com/services |
Quote:
|
got it setup fine, the only issue was the rewrite rules, its a different system than apache
|
All times are GMT -7. The time now is 05:36 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123