Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: TCP server: How to reject connections when busy?

by TJPride (Pilgrim)
on Nov 29, 2011 at 19:52 UTC ( [id://940691]=note: print w/replies, xml ) Need Help??


in reply to TCP server: How to reject connections when busy?

Here's a possibly stupid question - if you have multiple boxes accepting the same type of connection, why not just have the client randomly choose between them? This will balance the load. Is there some reason to dump everything on one until it maxes out?
  • Comment on Re: TCP server: How to reject connections when busy?

Replies are listed 'Best First'.
Re^2: TCP server: How to reject connections when busy?
by squirrel (Novice) on Nov 29, 2011 at 21:54 UTC

    The client does choose randomly among the boxes, but they may be busy.

    Think SMTP & MX records with multiple primary and secondary servers. The client connects to one of the primary servers. All is good if it can be processed quickly. If not, I want the connection to be rejected so the client tries another primary box. If none of the primaries can take it, then it goes to the secondaries. It should be handled by the primaries if possible, but it should not queue for them: it is more important that it is handled by something quickly, whether primary or secondary.

Re^2: TCP server: How to reject connections when busy?
by dd-b (Monk) on Dec 01, 2011 at 17:36 UTC

    Don't know the original poster's exact situation, but for example if you have a relatively small load of long-running transactions, random isn't good enough; if you happen to hit a busy system you really want to at least consider trying another system. (A real load-balancer is the brute force solution of course; one that understands the present load and can accurately predict the future load. But that's often beyond the budget of this kind of setup; and the commercial ones are optimized for large numbers of small transactions rather than the reverse.)

Log In?
Username:
Password:

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

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

    No recent polls found