Common filesystem for servers behind a rackspace load balancer

load balancingnetwork-filesystem

Our PHP application consists of a single web server that will receive files from clients and perform a CPU-intensive analysis on them. Right now, analysis of a single user upload can take 3sec to conclude and take 100% CPU. This makes our system capacity amount to 1/3 requests per second.

My team's requirement is to increase capacity without a lot of code reengineering. A possible solution would be to set up a load balancer in front of multiple servers running the same app, connecting to a common DB. The problem is that the analysis outputs files on disk.

A load balancer would increase capacity, but then files won't be available between servers so consequent client requests may fail. We are hosted on Rackspace, is there a way to configure some sort of "common" storage for all servers, without having to rewrite our file persistance code? Current code relies on simple fopens etc. What are our options?

Best Answer

GlusterFS will provides a full POSIX filesystem export that can be mounted just as most other local filesystems. It will replicate to a configured degree for redundancy and otherwise will only pull data on request. As long as each server is configured so that the files created have unique paths even in a blind situation, you should be in a very good spot.