linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Slow signal delivery to server process with heavy I/O
@ 2010-07-10 23:08 Dallas Clement
       [not found] ` <AANLkTin9wvP1p3rp3Lv6-APEfvq9jZACF0TEas9a2f6l@mail.gmail.com>
  2010-07-11 13:18 ` Glynn Clements
  0 siblings, 2 replies; 7+ messages in thread
From: Dallas Clement @ 2010-07-10 23:08 UTC (permalink / raw)
  To: linux-c-programming

Hi All,

I've noticed that asynchronous signals such as SIGINT, SIGTERM etc are
delivered to my process long after the signal is sent if the receiving
process is handling lots of I/O.  My process is a multi-threaded web
server.  It's got one thread waiting on 'select' to accept incoming
connections and a thread pool which reads the data with 'recv'.

When I batter the web server with incoming traffic and I try to
shutdown the server by sending a SIGINT or SIGTERM, I have observed
that the web server finishes handling the incoming traffic before the
kernel dispatches the signal to the process.  It appears that the
'select' and 'recv' calls are getting highest priority with regard to
scheduling.

I realize this test may appear unnatural and is perhaps unrealistic,
but I would like to be able to shutdown my server gracefully within a
reasonable amount of time, no matter what kind of load it is handling.
 Don't want to have to wait several minutes for my signals to get
handled under heavy load.  Could someone please explain why signal
delivery is slow under these conditions?

Thanks in advance,

Dallas

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-07-12 16:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-10 23:08 Slow signal delivery to server process with heavy I/O Dallas Clement
     [not found] ` <AANLkTin9wvP1p3rp3Lv6-APEfvq9jZACF0TEas9a2f6l@mail.gmail.com>
2010-07-10 23:46   ` Dallas Clement
2010-07-11 13:18 ` Glynn Clements
2010-07-11 22:56   ` Dallas Clement
2010-07-12  2:48     ` Glynn Clements
2010-07-12  7:06       ` ern0
2010-07-12 16:14         ` Glynn Clements

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).