This really is something I have never witnessed done, and I am not arriving during my research, but my boss has an interest within the idea. We're searching at some load balancing options, and question if you'll be able to have apache and php placed on multiple servers, handled with a load balancer, but have the particular php code on a single server, using the various apache servers pointing towards the one central code base?

For example NFS mounts are extremely possible, however i wouldn't recommend it. Many of the benefit of loadbalancing sheds, and you are reintroducing just one reason for failure. When syncing code, and rsync cronjob are designed for itself very nicely, or perhaps a manual rsync on deployment can be achieved.

What's the reason you'd want this central code base? I am about 99% sure there's a much better solution a single server doling out code.

I believe that it is possible. To increase Wrikken's answer, I know NFS might be a sensible choice. However, you will find some disadvantages and caveats. For just one, when Apache tries access files with an NFS share which has gone away (connection dropped, host unsuccessful, etc) very bad unexpected things happen. Apache locks up, and continues to try and retrieve the file. The processes trying to gain access to the proportion, for reasons uknown, don't die, which is essential to re-boot the server.

Should you choose find yourself carrying this out, I would suggest an opcode cache, for example APC. APC will cache the pre-processed php in your area, and eliminate round outings for your storage. Just be ready to obvious the opcode cache if you improve your application/

PHP needs to run under something to do something like a web processor, Apache is easily the most popular. I have done NFS mounts across servers without problem. Odds are if NFS is lower, the network is lower. However it does not take lengthy to complete an rsync across servers to duplicate files, and can be a better idea.

I am unsure what your articles is much like, however, you can separate static files like javascript, css and pictures so that they are by themselves server. lighttpd is a great, lightweight web server for such things as this. Then you definitely finish track of a "devoted" php server. You do not even require a load balancer with this setup.

Bear in mind that PHP stores periods around the local file system. So if you're using periods, you have to make certain customers always go back to exactly the same server. Otherwise you must do something similar to store periods in memcache.