nginx load balancer help

N3rdMaster nginx-forum at
Thu Nov 4 15:28:40 MSK 2010


There is hardware I have:

- 1 web server (nginx + spawn-fcgi with php) IP:
- 2 web-server(spawn-fcgi with php) IP:
- 3 web-server(spawn-fcgi with php) IP:
- 1 db server (mysql)

nginx piece of config (located at

upstream phpcgi {
    server weight=5 max_fails=10  fail_timeout=30s;
    server weight=5 max_fails=10  fail_timeout=30s;
    server weight=5 max_fails=10  fail_timeout=30s;

Doing siege tests I received this info:

siege aborted due to excessive socket failure; you
can change the failure threshold in $HOME/.siegerc                      
                 Transactions:                     567 hits
Availability:                  31.78 %
Elapsed time:                 214.11 secs
Data transferred:              14.38 MB
Response time:                  0.78 secs
Transaction rate:               2.65 trans/sec
Throughput:                     0.07 MB/sec
Concurrency:                    2.07
Successful transactions:         610
Failed transactions:            1217
Longest transaction:            5.18
Shortest transaction:           0.05

Availability and Transaction rate is too low. The problem, I think, is
that requests to MySQL server from php-fcgi backends are very slow
(pings from all backends to MySQL server 0.2ms average).

While siege testing load on frontend ( and backend's (
and servers was 1 average. MySQL load is ok.

The question is:
How have you achieved good performance with the backend's MySQL server?
Is this just a network problem only or there other variants of the

Best regards,

Posted at Nginx Forum:,746,147580#msg-147580

More information about the nginx mailing list