Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^8: Help designing a threaded service (go back to sleep)

by tye (Sage)
on Jan 26, 2014 at 18:51 UTC ( [id://1072139]=note: print w/replies, xml ) Need Help??


in reply to Re^7: Help designing a threaded service
in thread Help designing a threaded service

On at least some versions of some Unix systems, multiple processes waiting on the same socket will cause all of them to be awoken but only the first one to ask will get the connection or data that triggered them to be awoken. Since nginx is setting up "necessary work queue requests" in order to handle the connection coming it, it is useful for only one process to do that. Though I'm not completely convinced that the nginx authors didn't implement this protection out of misunderstanding rather than real need.

I believe that it is the case that you don't need to worry about this implementation detail at least in most cases.

My vague memory of one report of this "every process wakes up" "problem" was just noting the wasted resources and that only one of the waiting processes would return from select(2) (or equivalent). I certainly don't expect more than one process to actually return from accept() when many of them are blocked inside an accept() call.

- tye        

  • Comment on Re^8: Help designing a threaded service (go back to sleep)

Replies are listed 'Best First'.
Re^9: Help designing a threaded service (Your belief versus the collective finding of t'internet)
by BrowserUk (Patriarch) on Jan 26, 2014 at 20:05 UTC
    I believe...

    Again I say, this is a well used, well-tested server.

    I'll add, it is also, by all accounts, extremely well designed and implemented, such that it is known and proven to knock the spots off Apache and most other servers for concurrency and throughput.

    Your "belief" that it might be badly implemented out of "misunderstanding" does not accord with *any* other opinion I have found. Accordingly, I give your "belief" due weight commensurate with that finding.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1072139]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (12)
As of 2024-04-23 08:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found