NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/41019: pthreads: high load when using varnish (locking/unlocking causes 98% WCPU)



The following reply was made to PR lib/41019; it has been noted by GNATS.

From: christos%zoulas.com@localhost (Christos Zoulas)
To: gnats-bugs%NetBSD.org@localhost, lib-bug-people%netbsd.org@localhost, 
        gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost, 
        michael+netbsd%stapelberg.de@localhost
Cc: 
Subject: Re: lib/41019: pthreads: high load when using varnish 
(locking/unlocking causes 98% WCPU)
Date: Sun, 22 Mar 2009 10:32:58 -0400

 On Mar 22,  2:10pm, michael+netbsd%stapelberg.de@localhost (Michael 
Stapelberg) wrote:
 -- Subject: Re: lib/41019: pthreads: high load when using varnish (locking/un
 
 |  Hi,
 |  
 |  I just wanted to inform you that this problem report can be closed as I was
 |  wrong with the cause of the clock_gettime()-calls. They were, in fact, 
issued
 |  by varnish.
 |  
 |  They were issued so often because the return code of usleep() wasnâ??t 
checked
 |  and NetBSD does not handle values >= 1,000,000. See ticket #475 [1] in 
varnish
 |  bugtracker.
 |  
 |  So, sorry to have wasted your time and thanks for your help.
 |  
 |  Best regards,
 |  Michael
 |  
 |  [1] http://varnish.projects.linpro.no/ticket/475
 
 It is not a NetBSD issue:
 
        http://opengroup.org/onlinepubs/007908799/xsh/usleep.html
 
 And in your fix you are not using nanosleep because you claim it has
 similar issues. I think it does not, so in reality the code should be
 converted to use nanosleep(), or if you want to use something like your
 patch:
 
 #define U2S    1000000
        if (usec >= U2S) {
                unsigned int sec = usec / U2S;
                usec %= U2S;
 
                sleep(sec);
                usleep(usec);
        }
 
 christos
 


Home | Main Index | Thread Index | Old Index