douyanjing8287 2012-04-12 15:58
浏览 21
已采纳

PHP处理大型文件上传的理想Web服务器?

I'm in the middle of technically speccing a file uploading API that will be dealing with a lot of large (250MB+) files.

What I want to avoid as much as possible is the web server eating up a whole load of memory during the file upload, which I know to some degree is possible to avoid.

Also, I can't use Flash or Silverlight to split the files, which would probably significantly decrease memory usage.

I understand that PHP is largely dependent on its host web server software for upload performance. With this in mind, is Apache the best one for the job or should I consider nginx or others?

If PHP itself is the largest bottleneck, then would it be worthwhile considering some sort of hybrid solution? And if so, what language would it be?

  • 写回答

3条回答 默认 最新

  • duanmei2805 2012-04-12 16:18
    关注

    Despite what Daniel Ribeiro says, I'd suggest you keep these uploads well away from Apache. You need an event based server (Apache's implementation is good but IMHO not as polished as nginx / lighttpd). The problem is only indirectly going to be memory - it's about the number of clients and bandwidth. Splitting the files isn't really going to help.

    OTOH there's nothing to stop you using nginx to handle the uploads and apache to serve up the rest of the site.

    You'll get a lot of benefit out of tuning the TCP/IP stack to handle LFNs (large congestion window, tcp window scaling).

    I understand that PHP is largely dependent on its host web server software for upload performance

    The performance of uploads is nothing to do with PHP unless you try to implement the upload using raw socket / web socket with PHP at the back end. Indeed it would make sense to invoke a (forking) PHP interpreter from nginx to process the file - since this only is started when the file is uploaded

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

报告相同问题?

悬赏问题

  • ¥15 关于#java#的问题:找一份能快速看完mooc视频的代码
  • ¥15 这种微信登录授权 谁可以做啊
  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”
  • ¥15 网络设备配置与管理这个该怎么弄
  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!