optimize for 2k request / second

#1
Hi,

I'm having some problem lately with load on my webserver.

I have 2 G of ram and processor is P4 3.4Ghz with SCSI drive.
php accelerator is installed.

The web content is using php, mysql.


I setup 1000 concurrent connection with max keep alive of 1000.

I setup php module to be 100 module and 100 max connections.

The problem I had was my concurrent connection were still going up and php connection were not able to follow the beat. Page were long to respond etc.

I changed the value for php from 100 to 200 (module and max connection) and it helped a little.

Following your doc and stuff i'm suppose to be able to reach 4000 concurrent connection with 2G of ram. Is there a way i can optimize my setup ?
 

xing

LiteSpeed Staff
#2
The problem is not litespeed but your php code combined with mysql access. Your php application/database (mysql) is not opimized/tuned for 2000 connections per second. In fact, very few php/mysql apps can sustain 2000 concurrent connections. This optimization is out of the realm of litespeed. Please consult mysql.com, php.net, and most importanlty profile the sql queries you run and the php code you run them with.

Setting php max instances to above 200 is not recommended. In fact, a setup configured with 50 php instances can outperform one configured with 200 value. The goal is throughput per connection and speed of page processing per request. It doesn't matter if what's the configured php instance value if each php requeste + queries take 2 seconds to complete.
 
#3
In fact, very few php/mysql apps can sustain 2000 concurrent connections.
Are there any other known limitations to concurrent connections? Would faster servers with more RAM continue to increase the number of possible concurrent connections, or is there some other bottleneck somewhere?
 

mistwang

LiteSpeed Staff
#4
It is not a problem of concurrent connections, it is how fast PHP/MySQL driven page can be served. It depends on where is the bottle neck of your application. CPU bound, disk I/O bound, network bound, etc. You need to identify and target the bottle neck. And the bottle neck may change from time to time. For a Disk bound application, adding faster CPU and more RAM may not help much.
 
Top