如何平衡网络服务器带宽使用?
我有一个 drupal 商务网站,用户一直在其中上传大量图片.每个商业订单有 n 张图片.
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.
我想直接在每台服务器中找到处理请求的解决方案,并通过会话保持连接,以便在同一台服务器上获取所有用户的上传,我认为 DNS 循环平衡不是一个好的解决方案,因为请求将在任何服务器中接收,并且所有文件都不会相同.
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.
我以为我可以为每台服务器放置一个子域并从我的主drupal实例重定向到另一台服务器,然后将收到该服务器的所有后续请求......但我不安全这是一个很好的解决方案..我不知道是否可行和实用.
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?
我的网站在 PHP 5.x 上运行
My site runs on PHP 5.x
推荐答案
对不起,我的英语不好.为了让你更好地理解图片
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.
所以
此解决方案在主站点上的带宽消耗最少
您可以使用 Ajax 技术上传到多个服务器或服务器(无限带宽)并且在这些服务器中,存储图像后,使用 API(REST 或 SOAP)将 URL 存储在原始服务器中或从(Web 服务器)获取注册号码.(图片 )这种方法会为原始服务器创建一个非常小的数量,并且您的图像将从另一个服务器显示以显示在网站上.
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.
或使用其他解决方案:image
or use other solution : image
请看图片
相关文章