简体   繁体   中英

Programming a load balancer with sockets using C

I'm trying to make a load balancer for 3 HTTP servers{hosts= "web1", "web2", "web3"}{load balancer ports="8081","8082","8083"}.

This load balancer transfers HTTP requests randomly to one of the servers and then returns the result of the request to the sender.

I'm begining with sockets so if any one could tell me what would the program look like?

If it is not clear I'm ready to give more details.

You need to figure out if the requests are stateful, meaning - the requests belong to a valid session, then such requests should be consistently routed to the same server to avoid failures and inconsistencies. Fresh requests can be routed to any of the servers based on load balancing algorithm eg. round robin or least loaded server etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM