RE: High Cpu usage

From: Remco Verhoef <remco.verhoef#redfive.biz>
Date: Fri, 27 Mar 2009 21:11:51 +0100


Cpu back at 100% after a few hours again, the maxaccept -1 is no solution.



Van: Remco Verhoef [remco.verhoef#redfive.biz] Verzonden: vrijdag 27 maart 2009 19:13
Aan: haproxy#formilux.org
Onderwerp: RE: High Cpu usage

I've added tune.maxaccept -1 to haproxy.cfg global, this seems to work with 1.3.16.

default maxaccept has been changed from 15.7 to 15.8 in haproxy.c:

        if (global.tune.maxaccept <= 0) {
                if (global.nbproc > 1)
                        global.tune.maxaccept = 8;  /* leave some conns to other processes */
                else
                        global.tune.maxaccept = -1; /* accept all incoming conns */
        }

maxaccept is used in client.c for handling the events, and when max_accept is -1, it tests the (p->feconn < p->maxconn ).

        while (p->feconn < p->maxconn && max_accept--) {
                struct sockaddr_storage addr;
                socklen_t laddr = sizeof(addr);


________________________________________
Van: Remco Verhoef [remco.verhoef#redfive.biz] Verzonden: vrijdag 27 maart 2009 18:00
Aan: haproxy#formilux.org
Onderwerp: Re: High Cpu usage

I've also reverted to 1.3.15.8 but seems to have the same issue. Not tried the 1.3.15.7 yet, I've compared sources and it seems the maxaccept behaviour has changed. Tried to add tune.maxaccept 100 to the cfg with version 1.3.16, but issue still occurs.

The epoll_wait / poll and gettimeofday is called too often:

% time seconds usecs/call calls errors syscall

------ ----------- ----------- --------- --------- ----------------
 47.81    0.005649           0    169141           epoll_wait
 42.82    0.005059           0    169140           gettimeofday

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 76.98    0.144607           0    982302           poll
 16.42    0.030855           0    982303           gettimeofday




________________________________________
Van: Alex Forrow [alex#fav.or.it]
Verzonden: vrijdag 27 maart 2009 17:34
Aan: haproxy#formilux.org
Onderwerp: Re: High Cpu usage

    2009/3/25 Corin Langosch <corinl#gmx.de>:
/> Hi,/
/>/
/> I see exactly the same problem here, running a 2.6.26 kernel on
    amd64./
/>/
/> 1.3.15.7 is working fine without any problems, so it seems to be
    a bug in/
/> 1.3.16./
/>/
/> Corin/
/>/

    I think so too, going back to version 1.3.15.7, cpu peaks at 2% with     the same load (about 10-20 concurrent sessions) and config.

/Sune

I am getting this also, on Linux 2.6.18 (CentOS 5) x86_64. Reverted to 1.3.15.7 and problem disappears.

Using a basic config doing simple http balancing.

Alex Received on 2009/03/27 21:11

This archive was generated by hypermail 2.2.0 : 2009/03/27 22:30 CET