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 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵