dongpan8439 2013-05-11 11:47
浏览 38

平衡httpd和保存项目文件

I have this project I'm working on for already 3years+. It's big. And I'm thinking of future updates / scenarios as I am finishing it up, as well as work on my final touchs.

I recently looked over the net into Apache / webserver daemon balancing, which brings to life more than 1 server that serves the files with threads, for balancing purposes.

My question is, as I am saving files (images) with my projects in selected folders in the linux box :

when page is served from another secondary server (balancing), and user needs to save the picture, where does he save it ? I need to know this so if I end up with multiple httpd servers, I need to know all the files saved by my users are where they should be, so the app displays them neatly.

  • 写回答

1条回答 默认 最新

  • doucan957495 2013-05-11 15:07
    关注

    There are a lot of solutions here, depending on budget, skills, etc. First off your load balancing software should have the facility to make sure a session is sticky so that your user doesn't get switched to a different server mid way through the upload, or pick a server to handle all of the uploads. Once the image is uploaded you could: (I only have experience with linux when it comes to servers, you didn't say which OS)

    A note on uploading to CDN, if the local copy dies it might be expensive to download them all in one go, so not necessarily a solution to use by itself

    Best not use to an NFS share (mounting the dir of the images across the network) as that means if the one server goes down best case no images served, worst it drags the other servers down with it (had that happen!)

    DB update

    I had discounted storing blobs a long time ago because in the project where I need to have images on multiple servers we have portrait, landscape and square versions in about 6 sizes each (articles, galleries, list pages, mobile etc) but now that I think of it. I might look into just storing the largest/original in the DB and generating the others on demand with caching, that might work quite well

    评论

报告相同问题?

悬赏问题

  • ¥15 ogg dd trandata 报错
  • ¥15 高缺失率数据如何选择填充方式
  • ¥50 potsgresql15备份问题
  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错