![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
who here has setup nginx?
having issues getting php to work.
curious on peoples setup. ![]()
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Nov 2009
Location: Heaven
Posts: 4,306
|
wild guess.
try removing .htaccess files., |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Oct 2002
Posts: 3,745
|
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.
__________________
For historical display only. This information is not current: support@bettercgi.com ICQ 7208627 Strongbox - The next generation in site security Throttlebox - The next generation in bandwidth control Clonebox - Backup and disaster recovery on steroids |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 | |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
Quote:
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Jan 2003
Location: In a Tater Patch
Posts: 2,321
|
There is no module for PHP for nginx, you need to set it up as php-fpm, it runs as as stand a lone daemon and basically proxies the requests to the socket/php-fpm.
__________________
Managed Hosting - Colocation - Network Services Yellow Fiber Networks icq: 19876563 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
|
I can send you tutorial to mail written by me if you want.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
ORLY?
Industry Role:
Join Date: Oct 2005
Location: NL & US
Posts: 2,579
|
php-fpm is what you want I think
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
aliasx
Join Date: Apr 2001
Posts: 19,010
|
Not sure, just use it for streaming media.
__________________
https://porncorporation.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Confirmed User
Join Date: Mar 2007
Posts: 118
|
you will get even better performance out of apache with varnish in front.
__________________
Cheap Bandwidth only 33cents/mbps |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
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
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
|
Using php-fpm for years and never had any slowdown problem.Never.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Almost goners..
Industry Role:
Join Date: May 2008
Location: Netherlands
Posts: 11,420
|
Nginx is running wp like a mofo on speed!!
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Confirmed User
Industry Role:
Join Date: Jul 2005
Location: icq#: 639544261
Posts: 1,965
|
Never had a problem with php-fpm either. Rasmus recommends it ffs...
__________________
I'm out. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Almost goners..
Industry Role:
Join Date: May 2008
Location: Netherlands
Posts: 11,420
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 |
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 | ||
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
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 ![]()
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
||
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 | |
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
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.
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#22 |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
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 ;)
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#23 | |
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#24 | |
Almost goners..
Industry Role:
Join Date: May 2008
Location: Netherlands
Posts: 11,420
|
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. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#25 | |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
Quote:
![]() For every need there is a different solution...
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#26 |
Coupon Guru
Industry Role:
Join Date: Mar 2009
Location: Minneapolis
Posts: 10,973
|
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.
__________________
Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more! AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#27 | |
Confirmed User
Industry Role:
Join Date: Jul 2005
Location: icq#: 639544261
Posts: 1,965
|
Quote:
__________________
I'm out. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#28 |
Confirmed User
Join Date: Feb 2008
Posts: 415
|
I would suggest Varnish Cache
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#29 |
Confirmed User
Join Date: Oct 2002
Posts: 3,745
|
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.
__________________
For historical display only. This information is not current: support@bettercgi.com ICQ 7208627 Strongbox - The next generation in site security Throttlebox - The next generation in bandwidth control Clonebox - Backup and disaster recovery on steroids |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#30 |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
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?
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#31 | |
Confirmed User
Join Date: Oct 2002
Posts: 3,745
|
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. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#32 |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
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.
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#33 |
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
|
Btw borked can you post httpd -m on that machine where you optimized apache ?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#34 | |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
Quote:
anyway, here's the list for the member site server running at a few hundred mbs: Code:
Loaded Modules: core_module (static) mpm_prefork_module (static) http_module (static) so_module (static) include_module (shared) log_config_module (shared) logio_module (shared) env_module (shared) ext_filter_module (shared) mime_magic_module (shared) expires_module (shared) deflate_module (shared) headers_module (shared) usertrack_module (shared) setenvif_module (shared) mime_module (shared) status_module (shared) autoindex_module (shared) info_module (shared) vhost_alias_module (shared) negotiation_module (shared) dir_module (shared) actions_module (shared) alias_module (shared) rewrite_module (shared) cgi_module (shared) version_module (shared) php5_module (shared) Syntax OK Code:
CoreDumpDirectory /var/apache-core-dumps ServerRoot "/etc/httpd" PidFile run/httpd.pid Timeout 10 KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 3 <IfModule prefork.c> StartServers 50 MinSpareServers 75 MaxSpareServers 150 ServerLimit 700 MaxClients 700 MaxRequestsPerChild 100 </IfModule> 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 21.7 requests/sec - 162.1 kB/second - 7.5 kB/request 20 requests currently being processed, 110 idle workers __KK___________W____________W__________W___W_K_____________C____ _K_______C__________________C_________C__CKK_K......__WK_W____W_ ________........................................................ ................................................................ ................................................................ ................................................................ ................................................................ ................................................................ ................................................................ ................................................................ ............................................................
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#35 |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
Why offload to nginx instead of another install of apache? Is it because ... nginx is better for that job?
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#36 | |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
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?
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#37 |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
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
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#38 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#39 | |
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
|
Quote:
.I have also some fancy codes which can optimize nginx further so can sent that too. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#40 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
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/
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#41 | |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
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?
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#42 |
Confirmed User
Join Date: Jan 2005
Location: Stockton
Posts: 4,365
|
wtf is nginx. Damn now I got to google it...
__________________
ICQ:268731675 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#43 |
Confirmed User
Industry Role:
Join Date: Jun 2006
Posts: 441
|
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#44 | |
Confirmed User
Join Date: Oct 2002
Posts: 3,745
|
Quote:
Code:
open(filename, O_NOATIME, ... A patch to use O_NOATIME should be fairly trivial, but a module with no patch would be a little more involved because apr_file_open() doesn't currently pass flags directly to open(). Instead it ORs only the APR_* flags. One would need to make a trivial patch to apr_file_open(), then optionally pass O_NOATIME from a module based on configuration (or just use noatime always).
__________________
For historical display only. This information is not current: support@bettercgi.com ICQ 7208627 Strongbox - The next generation in site security Throttlebox - The next generation in bandwidth control Clonebox - Backup and disaster recovery on steroids |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#45 | ||
Too lazy to set a custom title
Industry Role:
Join Date: Sep 2005
Location: Springfield
Posts: 13,826
|
you can send it to celebempire{at}gmail.com also
thanks Quote:
![]() ![]() ![]() ![]() Quote:
it's not free but it's good and easy to use... http://nginx.org/ my services http://www.awmzone.com/services
__________________
Make a bank with Chaturbate - the best selling webcam program ![]() ![]() ![]() Ads that can't be block with AdBlockers !!! /// Best paying popup program (Bitcoin payouts) !!! PHP, MySql, Smarty, CodeIgniter, Laravel, WordPress, NATS... fixing stuff, server migrations & optimizations... My ICQ: 27429884 | Email: ![]() |
||
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#46 | |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
Quote:
__________________
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#47 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
got it setup fine, the only issue was the rewrite rules, its a different system than apache
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |