Maximizing Linux (CentOS) for Maximum Concurrent users

flysarescary

New member
Sep 15, 2008
713
17
0
Hello, I am running lighttpd and eccelerator.

I have stripped the php-cgi.

I have tried forking anywhere from 50 to 300 to 1000 fastcgi children with PHP_FCGI_CHILDREN (through lighttpd, I'll attempt to do with same with spawn-fastcgi and fpm)

Server stats:

Intel Core i7 920
12GB DDR
250GB 7.2k RPM SATAII 16MB Cache

I am using to lighttpd's lighttpd-status to estimate concurrent connections.

When I refresh the panel, it shows that there are around 100-150 connections and around 150 requests/s in the last 5 seconds.

My vmstats show that CPU is 98% idle. Blocks written/read is neglible. MySql key_buffer set to 2gb and I'm pretty sure it's not mysql. The overwhelming majority of requests do not access mysql.

EDIT: Uh oh, I just realized that tcp_mem could be a huge bottle neck.

I just set it to:

net.ipv4.tcp_mem = 4096000 87380000 4194304000

It was previously:
net.ipv4.tcp_mem = somenumber somenumber 393,216 <<<--- WTF!!!!!!!

x1000 for my read values (it's an access server only). I can't benchmark the server right now so let me know if you have any suggestions besides this. I do think that this was the problem. When under load images could not be accessed either.

Please let me know of any sysctl or other values I should look at. I think I'm okay on Mysql and web server config. I'm mainly interested in optimizing the OS.

Also, has anyone had experience with the LiteSpeed LSAPI server? Was the performance increase significant. Let's say I'm buying 12 servers running lighttpd, would it bring that down to 8 in your opinion? Also, do you know if their licensing when it says, 8-CPU etc, is it cool to run it on 8 different computers with 8 CPUS or is it 8 CPU in one box. I just sent a question to contact but thought'd I'd ask.
 


010100000110111101110011011101000010000001111001011011110111010101110010001000000111000101110101011001010111001101110100011010010110111101101110001000000110100101101110001000000111010001101000011001010010000001100110011101010110001101101011011010010110111001100111001000000110010001100101011101100110010101101100011011110111000001101101011001010110111001110100001000000110011001101111011100100111010101101101001000000111100101101111011101010111001000100000011011100110010101100001011100100111001101101001011001110110100001110100011001010110010000100000011100000110100101100101011000110110010100100000011011110110011000100000011100110110100001101001011101000010111000100000
 
what are your max workers set to in lightttpd? can you post your whole lighttpd config file.

I've had my fair share of headaches scaling out lighttpd/php to the loads it looks like you're getting :)

Is all the static content you're serving large enough to get cached in ram so you're not hitting the HD with a bunch of reads?

If all you're handling is around 200 connections, i wouldn't imagine the default tcp settings being a huge bottlenecks.

And i've used litespeed before, but wasn't quite too impressed with it. Especially the clause they have in their terms of agreement that prohibit using it to serve porn. It seems nice though if you're looking for an Apache drop in replacement and you're working with a shared hosting environment though.
 
We ran into a similar problem trying to get mathopd (another light weight http server) to scale to hundreds of concurrent sessions.

Linux (and most UNIX-based/like) operating systems enforce a maximum file descriptor limit per machine/user/process. I think the default is 256 per process. You'll need to bump this much higher than 256 for it to handle many sessions concurrently.

Try this:

# ulimit -n 65535
# command-to-launch-http-server
 
78 111 32 111 110 101 32 114 101 97 100 115 32 116 104 101 32 100 101 118 101 108 111 112 109 101 110 116 32 102 111 114 117 109 32 58 40
 
Hello, I am running lighttpd and eccelerator.

I have stripped the php-cgi.

I have tried forking anywhere from 50 to 300 to 1000 fastcgi children with PHP_FCGI_CHILDREN (through lighttpd, I'll attempt to do with same with spawn-fastcgi and fpm)

Server stats:

Intel Core i7 920
12GB DDR
250GB 7.2k RPM SATAII 16MB Cache

Clearly this is the optimal forum for asking questions that require an IQ over 70 to answer.

Plus, your server specs get me bothered and hot. It's like a huge, muscular dude in perfect fitness with a 1.5 inch cock.

To answer your questions as vaguely as possible, your server settings are dependent upon the applications you are running. 150 concurrent connections is NOTHING. My old Pentium 4 server could handle over 1,000 without blinking. It could actually saturate the 100 Mbps pipe without flinching because...wait for it...it had a fast disk subsystem. Back then we called it SCSI (Ultra 320) but today SSDs would be the smartest choice for speed, with SATA mech drives for storage.

The biggest site that I can think of which uses Lighty is Mininova...and that site is slow as shit. Sometimes being different is good, but sometimes Apache 2.0 owns you because Mod_php on Apache is >>>>>>>> FastCGI.


List of Fail #1:
Wants fast throughput but has no disk subsystem. Doesn't even have raid 0. If you just want one disk, get an SSD. It's expensive, but if you want FAST you need that.


List of Fail #2:
Tweaking the default settings which provide a stable foundation without actual knowledge or understanding of what said changes will affect.


List of Fail #3:

Choosing a web server platform that performs well in specific conditions vs a well-established platform that performs well in many conditions, and can be honed to work even better in specific conditions.

HTH and if u got any other Q's holla at me yO