nginx load balancer help

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


Hello,

There is hardware I have:

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

nginx piece of config (located at 1.1.1.1):

upstream phpcgi {
    server 1.1.1.2:9000 weight=5 max_fails=10  fail_timeout=30s;
    server 1.1.1.3:9000 weight=5 max_fails=10  fail_timeout=30s;
    server 127.0.0.1:9000 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 (1.1.1.1) and backend's (1.1.1.2
and 1.1.1.3) 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
problem?

Best regards,

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,746,147580#msg-147580




More information about the nginx mailing list