Polling vs Async notification

Polling vs Async notification

Post by Demetri Mourat » Wed, 15 Mar 1995 05:39:17



Sybase SQL servers running on our AIX machines use up rediculous amounts
of CPU even when completely idle.  Running a trace of the system
indicates that they are calling select() over and over and over.

AIX trace does not let me see the arguments to system calls, but
I must assume that they call select with timeout pointing to a zero-
valued timeval, to affect a poll of the incoming TCP connections.

Sybase states that they do this as a performance improvement.  Are
they really going to get better response by polling each TCP socket
individually rather than using SIGIO?

--

The Northern Trust Company              Voice:  +1 312 630-0735
Chicago, IL  60675                      FAX:    +1 312 630-6797

"The mere act of drinking beer in an attempt to measure your tolerance
 is likely to affect your impression of how many beers you've drunk."
        -- The Heineken uncertainty principle.

 
 
 

Polling vs Async notification

Post by Steve Kapp » Thu, 16 Mar 1995 23:54:53



>Sybase SQL servers running on our AIX machines use up rediculous amounts
>of CPU even when completely idle.  Running a trace of the system
>indicates that they are calling select() over and over and over.

>AIX trace does not let me see the arguments to system calls, but
>I must assume that they call select with timeout pointing to a zero-
>valued timeval, to affect a poll of the incoming TCP connections.

>Sybase states that they do this as a performance improvement.  Are
>they really going to get better response by polling each TCP socket
>individually rather than using SIGIO?

Signals are expensive.  Not to mention that when using SIGIO that you then
have to wrap all critical sections of code with blocks/unblocks of that
signal.  And that gets even more expensive.

If they are saying that they use select to poll and not to actually wait
for some interval and that makes the performance better, then there must
be something flaky about AIX.  Perhaps they are using the polling to keep
the process (or at least tiny parts of it) from being paged out.  Even that
doesn't make sense as AIX has the plock call.

--
______________________________________________________________________

Apertus Technologies, Inc.
7275 Flying Cloud Drive      
Eden Prairie, MN 55344        

 
 
 

Polling vs Async notification

Post by Ade Bark » Fri, 17 Mar 1995 10:49:43


: Sybase SQL servers running on our AIX machines use up rediculous amounts
: of CPU even when completely idle.  Running a trace of the system
: indicates that they are calling select() over and over and over.

: AIX trace does not let me see the arguments to system calls, but
: I must assume that they call select with timeout pointing to a zero-
: valued timeval, to affect a poll of the incoming TCP connections.

: Sybase states that they do this as a performance improvement.  Are
: they really going to get better response by polling each TCP socket
: individually rather than using SIGIO?

Yes and no. Yes, polling with select() on multiple sockets is
more efficient than waiting for SIGIO. No, the above scenario
doesn't make sense. If select was called with a zero timeval,
during idle periods select() should poll (wait) until there
is activity. It should not keep calling select() over and
over again when there is no activity!

-Ade Barkah

 
 
 

Polling vs Async notification

Post by Jens-Uwe Mag » Fri, 17 Mar 1995 08:52:15



Quote:> Sybase SQL servers running on our AIX machines use up rediculous amounts
> of CPU even when completely idle.  Running a trace of the system
> indicates that they are calling select() over and over and over.

> AIX trace does not let me see the arguments to system calls, but
> I must assume that they call select with timeout pointing to a zero-
> valued timeval, to affect a poll of the incoming TCP connections.

> Sybase states that they do this as a performance improvement.  Are
> they really going to get better response by polling each TCP socket
> individually rather than using SIGIO?

I agree that it helps their process, but it will probably not help
anything else running on the system. From my experiences a select which
causes a process to go to sleep causes much greater latency even if no
other process is ready to run. By avoiding the sleep they may be able
to react to incoming packets faster.

______________________________________________________________________________


Brahmsstr. 3                    Tel.: +49 511 660238

 
 
 

Polling vs Async notification

Post by David Spenc » Sun, 19 Mar 1995 05:21:40




>Sybase SQL servers running on our AIX machines use up rediculous amounts
>of CPU even when completely idle.  Running a trace of the system
>indicates that they are calling select() over and over and over.

>AIX trace does not let me see the arguments to system calls, but
>I must assume that they call select with timeout pointing to a zero-
>valued timeval, to affect a poll of the incoming TCP connections.

>Sybase states that they do this as a performance improvement.  Are
>they really going to get better response by polling each TCP socket
>individually rather than using SIGIO?

I would think that the question would be, why are they not doing a
*blocking* select - I mean, if they are polling are they doing something
inbetween each poll?  There's nothing that annoys me more than "idle"
processes that eat the cpu because they're written to poll just like
some lamo DOS program.

--
     + ------------------------+
     | David Spencer           |

     + ------------------------+

 
 
 

Polling vs Async notification

Post by Demetri Mourat » Mon, 20 Mar 1995 06:32:18


| I would think that the question would be, why are they not doing a
| *blocking* select - I mean, if they are polling are they doing something
| inbetween each poll?  There's nothing that annoys me more than "idle"
| processes that eat the cpu because they're written to poll just like
| some lamo DOS program.
  ^^^^^^^^^^^^^^^^^^^^^
  I absolutely, 100% agree.  We joke here that they took their
  Very Best DOS Programmers, and put them to work on Unix. :-)

  The reason they are not doing a blocking select is that they need to
  be doing real work in the meantime.  The whole database server is
  a single Unix process, so it needs to do database-type things when not
  servicing socket I/O.

--

The Northern Trust Company              Voice:  +1 312 630-0735
Chicago, IL  60675                      FAX:    +1 312 630-6797

"The mere act of drinking beer in an attempt to measure your tolerance
 is likely to affect your impression of how many beers you've drunk."
        -- The Heineken uncertainty principle.

 
 
 

Polling vs Async notification

Post by Wade Scholi » Wed, 22 Mar 1995 01:20:32




>| processes that eat the cpu because they're written to poll just like
>| some lamo DOS program.
>  ^^^^^^^^^^^^^^^^^^^^^
>  I absolutely, 100% agree.  We joke here that they took their
>  Very Best DOS Programmers, and put them to work on Unix. :-)
>  The reason they are not doing a blocking select is that they need to
>  be doing real work in the meantime.  The whole database server is
>  a single Unix process, so it needs to do database-type things when not
>  servicing socket I/O.

You'd think that they'd either split it into multiple processes or
use SIGIO (yeah, I know somebody said that's expensive, but so is
doing zillions of nonblocking selects per second...)
--
Wade L. Scholine              | All I can think of is a platter
c_farer associates, inc.      | of organic PRUNE CRISPS being
Delray Beach, FL.             | *led by an army of swarthy,
                              | Italian LOUNGE SINGERS...
 
 
 

1. Q: accept w/ ASYNC (SIGIO) notification possible???

Hi there!

Under SunOS, I could call (for a socket)

  fcntl(s, F_SETFL, O_NDELAY | FASYNC)

and then

  accept

and it would return right away. Once there was something to accept,
a SIGIO signal would be generated, which I caught in a handler.

Is there a flag FASYNC for fcntl() under Solaris 2.x? It seems that
there should be since async. signalling seems to exist in the kernel
(see /usr/include/sys/socketvar.h) but I don't see it in the fcntl()
interface (/use/include/sys/fcntl.h).

Any help appreciated,


WWW: http://www.informatik.hu-berlin.de/~mueller

2. REQUEST : UNIX ICON help

3. EDO vs FP ram, async vs burst-mode cache

4. file date stamp

5. async poll for 2.5

6. /bin/sh:/bin/tar:0403-027:parameter list is too long

7. Close notification in poll/select (works on all OS except Linux)

8. Audit configuration

9. epoll (was Re: [PATCH] async poll for 2.5)

10. poll/select not async-signal safe

11. polling verses notification

12. Async Programming with poll/AIO

13. New: Close notification in poll/select never arrives