[torqueusers] Torque 2.1.x pbs_server process hogging cpu

garrick at speculation.org garrick at speculation.org
Tue Jun 13 03:56:08 MDT 2006


On Tue, Jun 13, 2006 at 10:38:48AM +0200, Martin Schafföner alleged:
> On Tuesday 13 June 2006 09:42, garrick at speculation.org wrote:
> 
> > First determine the state of HAVE_BINDRESVPORT and NOPRIVPORTS in
> > src/include/pbs_config.h.
> 
> Sure did that anyway. So here it is:
> 
> /* Define to disable priviledged ports */
> /* #undef NOPRIVPORTS */
> 
> /* Define to 1 if you have the `bindresvport' function. */
> #define HAVE_BINDRESVPORT 1
> 
> > What OS is this?
> 
> SuSE SLES 9 SP3.
> 
> >
> > It looks like that goto needs to be wrapped around an #ifndef
> > HAVE_BINDRESVPORT.  But it should still exit that function if tryport
> > gets too low.
> 
> tryport isn't used at all if HAVE_BINDRESVPORT is defined (as in my case). 
> When stepping through the code with gdb, I noticed the compiler had entirely 
> eliminated tryport. Is this expected behavior?

So after a successful bindresvport(), the connect() is failing with errno
EADDRINUSE or EADDRNOTAVAIL and you are hitting the goto?  tryport is
being decremented just before the goto so the loop should exit after a
maximum of 512 times (though I'm not sure how it would loop at all with
bindresvport().)

If you aren't seeing the decrement, it is probably just compiler
optimization.  Rebuilding with -O0 might help there.  You can also
change the initial value of tryport to something like 515 to see if the
loop exits after 3 times so it is quicker to watch.

Assuming bindresvport() and connect() succeed on their first try, it is
expected that tryport is never used.  It is only used on OSes that don't
have bindresvport().



More information about the torqueusers mailing list