简体   繁体   English

扩展文件系统

[英]Scaling File Systems

This could be a question for serverfault as well, but it also includes topics from here. 这也可能是服务器故障的问题,但其中也包含此处的主题。

I am building a new web site that consist of 6 servers. 我正在建立一个由6个服务器组成的新网站。 1 mysql, 1 web, 2 file processing servers, 2 file servers. 1个mysql,1个Web,2个文件处理服务器,2个文件服务器。 In short, file processing servers process files and copy them to the file servers. 简而言之,文件处理服务器处理文件并将其复制到文件服务器。 In this case I have two options; 在这种情况下,我有两个选择。

I can setup a web server for each file server and serve files directly from there. 我可以为每个文件服务器设置一个Web服务器,并从那里直接提供文件。 Like, file1.domain.com/file.zip. 就像file1.domain.com/file.zip。 Some files (not all of them) will need authentication so I will authenticate users via memcache from those servers. 有些文件(并非全部)都需要身份验证,因此我将通过这些服务器中的内存缓存对用户进行身份验证。 90% of the requests won't need any authentication. 90%的请求不需要任何身份验证。

Or I can setup NFS and serve files directly from the web server, like www.domain.com/fileserve.php?id=2323 (it's a basic example) 或者,我可以设置NFS并直接从Web服务器提供文件,例如www.domain.com/fileserve.php?id=2323(这是一个基本示例)

As the project is heavily based on the files, the second option might not be as effective as the first option, as it will consume more memory (even if I split files into chunks while serving) 由于项目很大程度上取决于文件,因此第二个选项可能不如第一个选项有效,因为它将消耗更多的内存(即使我在提供服务时将文件分割成多个块)

The setup will stay same for a long time, so we won't be adding new file servers into the setup. 该设置将在很长一段时间内保持不变,因此我们不会在该设置中添加新的文件服务器。

What are your ideas, which one is better? 您有什么想法,哪个更好? Or any different idea? 还是有其他不同的想法?

Thanks in advance, 提前致谢,

Just me, but I would actually put a set of reverse proxy rules on the "web server" and then proxy HTTP requests (possibly load balanced if they have equal filesystems) back to a lightweight HTTP server on the file servers. 仅我一个人,但实际上我会在“ Web服务器”上放置一组反向代理规则,然后将HTTP请求(如果它们具有相等的文件系统,则可能是负载均衡的)代理回到文件服务器上的轻量级HTTP服务器。

This gives you flexibility and the ability implement future caching, logging, filter chains, rewrite rules, authentication &c, &c. 这为您提供了灵活性,并能够实现将来的缓存,日志记录,过滤器链,重写规则,身份验证&c,&c。 I find having a fronting web server as a proxy layer a very effective solution. 我发现将前端Web服务器用作代理层是一种非常有效的解决方案。

I recommend your option #1: allow the file servers to act as web servers. 我建议您选择#1:允许文件服务器充当Web服务器。 I have personally found NFS to be a little flaky when used under high volume. 我个人发现,在高容量下使用时,NFS有点片状。

您也可以使用诸如Simplecdn.com之类的Content Delivery Network,它们可以解决带宽和服务器负载问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM