doutao5499 2011-05-21 23:20
浏览 73
已采纳

多步图像提交加载平衡服务器问题

We have two apache/php web servers load balanced with squid page caching proxy. The squid caching is not active on image submission pages. We have a form where users can submit images.

It's a two step process. They first upload the images. The second step they can enter details about the images and images are then moved over to correct folders once they submit the image details.

Problem is when there is high traffic the second step might be served from a different server then the one with the uploaded images. So the second step might not find the uploaded images and upload fails to complete.

We have thousands of image files on these servers so the syncing between them is slow. Is there anyway that we can force a specific page to always to be served from a specific server? Basically to bypass the load balancing feature.

  • 写回答

2条回答 默认 最新

  • doumanshan6314 2011-05-28 10:19
    关注

    There are a few solutions to this.

    1. Switch to nginx as a reverse proxy and you can stick clients to the host
    2. Make the upload directory a NFS share mounted on both hosts
    3. Upload the file into a mysql table (probarbly best to use a hash table) so both servers can access it.

    Personally I would go with option 1 as you still get round robin load balancing, but each connection is stuck to the host that it was initially connected to.

    Option 2 has the benefit of still equally balancing requests, but the downside is the NFS share is a single point of failure.

    Option 3 can cause issues if there is not enough ram on the DB server if you use a hash table.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上