4

I am coming into an environment where they are using NFS to access PHP scripts and static web content that is stored on a server that is on the same network as the front end Apache server. Only one front end Apache server is accessing these files over NFS so it isn't a situation where they are load balancing the front end Apache boxes.

We are in the process of virtualizing the Apache and NFS servers. We are in disagreement over if it makes sense to still be using NFS in this situation or just having all the web content stored locally on the same machine as the web server. What do you all think?

Thanks for any input.

Ted S
  • 41
  • 1
  • 3

4 Answers4

3

You only need NFS if you need multiple-client access at a filesystem level. Since you don't need multiple-client access, I really wouldn't recommend NFS as the best choice.

Even if you do have multiple Apache servers, I still wouldn't recommend using NFS as the means of sharing your code between machines. Automated deployment tools can easily distribute code to as many locations as you like near-simultaneously. NFS might be the best choice for user-provided assets, but that's still not as cut-and-dried as it might initially appear (my opinions on this topic are available in this other answer).

womble
  • 96,255
  • 29
  • 175
  • 230
2

It sounds like in the situation you've presented, that there would be very little benefit from using NFS in this scenario.

You would get the most benefit from a single-source, multi-server type of setup (though there are other ways you can deal with that). For static pages, especially if there is something caching in the mix, performance shouldn't be a big concern. It is possible that you'd run into a performance impact with many machines hitting PHP scripts. That is going to depend on your environment though.

To give you an idea how it could be beneficial though: We have a Netapp filer that we dual-present volumes as CIFS to Windows clients (marketing folks) and NFS to the Apache servers, which are load balanced across 4 servers. We have all the Apache servers mounted read-only and marketing is able to make the modifications they need to directly from Dreamweaver or whatever else they use and then save directly to a windows share.

I should mention that this setup is only used for one-off marketing initiatives. Our main site is properly managed with a CMS and goes through a proper workflow.

Alex
  • 6,603
  • 1
  • 24
  • 32
  • Mmm mmm, developmestuction goodness. – womble Aug 07 '11 at 01:20
  • Yeah, the bad news is that Marketing has direct access to push content to the website. But they don't listen to anything we say anyway, and we end up doing whatever they want...so it just takes out the argument step :) – Alex Aug 07 '11 at 01:53
2

We're currently running nginx & Apache serving data from an NFS share on a NetApp FAS2050 with no performance issues. The drawback of NFS seems to be that directory lookups of relatively large directories (> 200 files) is quite slow, I'd recommend that you put nginx as a cache in from of that Apache server for the least performance impact on the SAN.

petertonoli
  • 613
  • 3
  • 12
1

There are some situations when using NFS may make sense. One case is if performance of your local disk subsystem is sub-optimal but your NFS storage is on high performance disk array. In all other cases you are just adding your network as failure point with no benefits.

dtoubelis
  • 4,677
  • 1
  • 29
  • 32