Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a udp server, it is a central part in my business process. in order to handle the loads I'm expecting in the production environment I'll probably need 2 or 3 instances of the server. The server is almost entirely stateless, it mostly collects data, and the layer above it knows how to handle the minimal amount of stale data that can arise from the the multiple server instances.

My question is, how can I implement load balancing between the servers? I would prefer to distribute the requests as evenly as possible between the servers. I would also would like to have some fidelity, I mean if client X was routed to server y, then I want all of X's subsequent requests to go to server Y, as long as it is sensible and not overloads Y.

By the way it is a .NET system... what would you recommend?


the state is internal within the servers, not a transaction of some sort. the state is some data the servers aggregate from the data they receive, and is quaryable with a simple WCF WebService. The application is based on UDP, and though i dont agree with the decision, its "Above my pay grade"

I'm currently trying out MS's NLB, it works ok, it does the fidelity thing out of the box, but it generates noise on the entire network...

Also no DNS... Oh and it's a completely costume protocol.

share|improve this question
    
Just a note for future reference - questions can be moved between stackexchange sites in many cases by moderators and high-reputation users. This helps preserve any answers that were already placed, so it's usually better than reposting on your own (unless there are no answers, in which case delete the old question so nobody accidentally answers it). If you agree with a suggestion to move, just add a comment to that effect and (if possible) flag your post for moderator attention, and the post should end up moved for you. –  bdonlan Feb 12 '11 at 15:27
add comment

4 Answers 4

up vote 4 down vote accepted

I have a udp server, [...] server is almost entirely stateless [..] have some fidelity, I mean if client X was routed to server y, then I want all of X's subsequent requests to go to server Y, as long as it is sensible and not overloads Y.

So, you're using an undisclosed application protocol that keeps some application state, and runs on top of UDP? You're kind of going in a difficult direction. UDP is not a reliable data transport, that's the whole point of it -- for reliable data transport see its popular friend TCP. The only way you can get your 'fidelity' is by having a load balancing proxy which understands your application layer protocol, and which knows what your current application state is and can act accordingly.

I see 3 approaches that come close to providing what you seek:

  • Statically spread incoming connections out over 3 IP addresses, based on source (end user) IP address. This way a given user will always be directed to the same server. Most professional firewalls can do this for you. You may have to make the 3 servers highly available yourself, as most firewalls won't do backend health checks for you.

  • Use DNS, and use DNS Round Robin, as already suggested by Matt Simmons.

  • Use Windows's built-in Network Load Balancing (NLB). Honestly, I don't know how the failover scenario would play out with NLB and your semi-stateful UDP based service -- you would have to investigate that yourself, based on how your application handles state. On the plus side, NLB is very easy to set up, free of charge with the Windows license, mature, and well performing.

share|improve this answer
    
i edited my question –  Hellfrost Jan 31 '11 at 8:18
add comment

Linux Virtual Server is a highly scalable and highly available server built on a cluster of real servers. LVS supported UDP protocol and source hash algorithm(this is used when you want a client to always appear on the same realserver).

I use LVM to balancing DNS(rr),SIP(sh).

share|improve this answer
add comment

Interesting. Most of the proxy software I've seen is admittedly TCP based.

Most of the UDP-specific load balancing that I've seen in my meager experience has been DNS-based (ie: time servers, DNS servers, etc). Is there any way to provide multiple A records? If that would work, the normal DNS Round Robin would ensure fair distribution of requests (probably fair enough, anyway) and client caching would ensure that the fidelity was retained (assuming you're using a cache-based platform on the client end).

share|improve this answer
    
no DNS's at all. –  Hellfrost Jan 30 '11 at 17:22
add comment

You can use any kind of load balancer to perform this, either hardware or software, you can choose from different load balancers based on what you need.

Level 3 load balancer: Will load balance only by looking at the incoming IP and the available backend IPs, this kind of load balancer will ensure stickiness by always sending the same incoming IP address to the same backend, although this kind of strategy can overload one of the backends if lots of clients com from the same IP (be it a proxy or a corporate gateway)

Level 7 load balancer: A level 7 load balancer will not only balance as a level 3 balancer but it'll also look at the content of the package, which will give you a lot more flexibility for your balancing policies.

Considering that you're using UDP both balancers should give a good performance, also deep packet inspection in UDP is a bit more limited than on TCP (just due to protocol reasons).

Depending on your budget you can start by using a software load balancer (linux + IPVS for example) and then start going up to hardware load balancers like the ones offered by Cisco or Netapp

share|improve this answer
    
-1 for the L7 part. A Layer/Level 7 load balancer works at the application layer -- but since OP is using UDP, he's not using plain old HTTP, and he hasn't disclosed which application he is using. We can't know that a L7 load balancer exists for the protocol OP is using. –  Jesper Mortensen Jan 31 '11 at 1:52
    
I was just commenting his options in load balancers, and we don't know what he is using over UDP, I think you're cutting this one too tight ;) –  lynxman Jan 31 '11 at 8:01
    
There is something between NLB/linux and Cisco/netapp: KEMP loadbalancers. You can get a virtual edition of it wich doesnt cost tons of money, we're using it and we're very happy. –  pauska Jan 31 '11 at 9:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.