How to balance webserver bandwith usage?

房东的猫 提交于 2019-12-10 22:04:25

问题


I have a drupal commerce website in which users upload a lot of images all the time. Each commerce order has n images.

I would like balance network traffic in order to save bandwidth (bandwidth is limited for each server). I cannot use a conventional load balancing solution because the balancer server also will have a limited bandwidth. My database will be on the separated server.

I would like to find a solution for handle request directly in each server and persist the connections by session in order to get all user's uploads on the same server, I think DNS round robin balancing isn't a good solution because the requests will be received in any server and all the files will not be at the same.

I had thought that I can put one subdomain for each server and redirect from my main drupal instance to another server, then all subsequent requests will be received for this server... but I'm not secure it is a good solution.. and I don't know if is possible and practical.

Can anyone suggest me an alternative?

My site runs on PHP 5.x


回答1:


Excuse me for my weak English. To give you a better understanding of the picture

Making a Sub-domain is not a good solution. Because it uses the bandwidth of the same domain.

so

This solution has the least bandwidth consumption on the main site

You can use Ajax technology to upload to multiple servers or servers (with unlimited bandwidth) And in those servers, after storing the image, use the API (REST or SOAP) to store the URL in the original server or get the registered number from (Web server). (image ) This method creates a very small amount for the original server and your images will be displayed from another server for display on the website.

or use other solution : image

Please see the pictures



来源:https://stackoverflow.com/questions/46764591/how-to-balance-webserver-bandwith-usage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!