• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Apache -vs- nginx -vs- lighttpd?

Apache -vs- nginx -vs- lighttpd?

  • Apache

    Votes: 10 17.9%
  • Nginix

    Votes: 28 50.0%
  • Lighttpd

    Votes: 9 16.1%
  • Other

    Votes: 9 16.1%

  • Total voters
    56

Luke F

Well-known member
#4
nginx - simpler configuration than any other web server, while also being arguably the fastest and lightest.

I've got it constantly handling 200 or so simultaneous connections (mostly static images and keep-alive) with ~5MB memory usage and ~0.0002% cpu time over the past 45 days (assuming I did the maths right).

Plus some of the stuff you can do in its config files is incredible, like if statements, variables, and even embedded perl.
 
#5
nginx - simpler configuration than any other web server, while also being arguably the fastest and lightest.

Plus some of the stuff you can do in its config files is incredible, like if statements, full embedded perl, etc.
Speaking of fast, your gaming forum has blazing speed compared to the other XenForo forums I have seen, its almost double this forum speed. Whats the secret ?
 

Luke F

Well-known member
#6
Speaking of fast, your gaming forum has blazing speed compared to the other XenForo forums I have seen, its almost double this forum speed. Whats the secret ?
Could be any of: Nginx (with a 2500+ line config >.>), PHP-FPM, APC (with XenForo set to use it for internal caches), decently configured MySQL (around 0.004s spent on queries in XF on most pages), decent hardware (quad core server, though probably cancelled out by the amount of other stuff running :p), Linux (<3 Fedora), decent network/isp.

Over the 2 or so years I've been fiddling with this server, the most noticeable improvements in forum performance (phpBB 3, vB 3.8, vB 4.0 and XF) have come from the switch to Nginx from Apache (anyone using Apache or similar servers such as Litespeed or Zend should seriously consider switching), and then from standalone FastCGI processes (used to run Windows; was still faster than proxying to Apache) to PHP-FPM. And of course the switch from Windows to Fedora, but I doubt that's a concern for many :)
 

dutchbb

Well-known member
#7
I'm also considering switching from Apache to Nginx, I've heard good things about it, especially for big boards / sites. Just the loss of a control panel is something to get used to, but I'm not using it a lot anyway.
 
#8
Could be any of: Nginx (with a 2500+ line config >.>), PHP-FPM, APC (with XenForo set to use it for internal caches), decently configured MySQL (around 0.004s spent on queries in XF on most pages), decent hardware (quad core server, though probably cancelled out by the amount of other stuff running :p), Linux (<3 Fedora), decent network/isp.

Over the 2 or so years I've been fiddling with this server, the most noticeable improvements in forum performance (phpBB 3, vB 3.8, vB 4.0 and XF) have come from the switch to Nginx from Apache (anyone using Apache or similar servers such as Litespeed or Zend should seriously consider switching), and then from standalone FastCGI processes (used to run Windows; was still faster than proxying to Apache) to PHP-FPM. And of course the switch from Windows to Fedora, but I doubt that's a concern for many :)
2500+ line config o.o sounds like a recipe book XD

Most likely its the MySQL (0.004s are incredible for those JOINS) and Nginx config then. Whats the memory usage for loading the mainpage? Fedora and Debian <3 for me. The only reason I used Lighty was because php5.2 was required for a project and it was easier to let Lighty handle the fcgi part. I really have to benchmark XenForo on Nginx later. Any -hint- for getting Nginx config running a little smoother?
 

Luke F

Well-known member
#9
Whats the memory usage for loading the mainpage?
Code:
Page Time: 0.0431s
Memory: 2.5909 MB (Peak: 3.1432 MB)
Queries (12, time: 0.0042s, 9.8%)
The only reason I used Lighty was because php5.2 was required for a project and it was easier to let Lighty handle the fcgi part.
Why not just use the PHP-FPM patch on PHP 5.2?

Any -hint- for getting Nginx config running a little smoother?
Use a nice long keepalive time (I use 5 minutes, probably a bit too far for large forums :p), stick to 1 worker process (might be just me, but performance seems to deteriorate otherwise), use epoll, sendfile, etc.
 
#10
Code:
Page Time: 0.0431s
Memory: 2.5909 MB (Peak: 3.1432 MB)
Queries (12, time: 0.0042s, 9.8%)
Wow, certainly a well tuned MySQL! Memory might have improvement with xCache rather than APC however o.o

Why not just use the PHP-FPM patch on PHP 5.2?
I had trouble compiling the patch right with the latest version at the time, so I went with Lighty to save time so I can work on getting the site 5.3 compatible. However I find Lighty's rewrite rules a pain in the ...

Use a nice long keepalive time (I use 5 minutes, probably a bit too far for large forums :p), stick to 1 worker process (might be just me, but performance seems to deteriorate otherwise), use epoll, sendfile, etc.
5mins or 5seconds o.o? 5mins is aloong keepalive (though Nginx should be able to handle it still) Also what about tcp_nopush, tcp_nodelay both 'on'?

Thanks for the tips !
 
#12
Yeah I have those both on, also you should ideally have access_log off for static content.
Code:
        location /forum/ {
            try_files   $uri $uri/ /forum/index.php?$uri&$args;
            access_log  off;
            expires     max;
        }
I'm doing that, its very effective especially if not much changes. Only wish Nginx could merge files (multiple CSS and JS) like Lighty does with LUA, though your PHP version works pretty good too.
 

Luke F

Well-known member
#13
Code:
        location /forum/ {
            try_files   $uri $uri/ /forum/index.php?$uri&$args;
            access_log  off;
            expires     max;
        }
I'm doing that, its very effective especially if not much changes. Only wish Nginx could merge files (multiple CSS and JS) like Lighty does with LUA, though your PHP version works pretty good too.
That could probably be done with the embedded perl - it's certainly possible to use it to minify JS anyway.
 

Blandt

Well-known member
#14
Anyone tried Cherokee ?

decent little guy with a GUI admin for people with a gazillion sites .. click click and the siteS are live :D http://www.cherokee-project.com/

I will post the config files for xenforo tomorrow, it's actually super simple via the admin panel few clicks and full SEO is on
 

SneakyDave

Well-known member
#15
I tried Cherokee, the fact that the administration is all the GUI confused me! I needed a command line to feel better about myself. Is it still being actively supported? I haven't visited it in a few months.
 

Blandt

Well-known member
#16
I tried Cherokee, the fact that the administration is all the GUI confused me! I needed a command line to feel better about myself. Is it still being actively supported? I haven't visited it in a few months.
hahahaha ... same here :D
but you know ... the new version (came out last week) is just out of this world ... they added a store thing, you pick your application ... and .. install ... done.! Everything is configured a la Windows !! :D
I love it ... it's just that no big sites are using it yet (unlike nginx proven reliability) ... but I will give these guys couple of years, and I'll bet they will rival nginx, especially the GUI thing, and the click-install are so easy .. will bring regular Joes in masses .. I mean you don't even need cPanel
 

Slavik

XenForo moderator
Staff member
#17
Anyone tried Cherokee ?

decent little guy with a GUI admin for people with a gazillion sites .. click click and the siteS are live :D http://www.cherokee-project.com/

I will post the config files for xenforo tomorrow, it's actually super simple via the admin panel few clicks and full SEO is on
I was considering using cherokee on my new server, the results seem amazing. If you could post your config would be great.
 

Blandt

Well-known member
#18
I was considering using cherokee on my new server, the results seem amazing. If you could post your config would be great.
Very simple 2 rules :

click on your vServers tab, then your domain (vserver) >>> select behavior tab >>> click Rule Management >>> click the plus sign to ad a rule >>> select Redirection >>> Click Add new Regex
Select Internal redirection
On the Regular Expression text box enter : /?(.*)
on the Substitution Text box enter : /index.php?/$1 (assuming xenforo is located at the root, if it's in a subfolder like community then >>> /community/index.php?/$1 )

Next

click + to add another rule select directory and enter : (data|js|styles|install)
on the handler screen select : HTTP Error
and on the HTTP Error drop down menu select : 403 forbidden



Hit save, >> Graceful Restart


I will take screen shots / or record a video when I get the chance :)
 

SilverCircle

Well-known member
#20
Cherokee looks indeed like a very viable alternative. Nice feature set, good performance, easy configuration - it's all there. What it needs is to prove its reliability and robustness in a production environment. The last version I tested (though quite a while ago, so lots of things might have changed) had some issues with (simulated) high load scenarios.