Hi all, I'm looking to improve the setup of the web application I work on. This isn't my own, just happens that I work for a company on the dev team. Anyway, the application is written in PHP (4) & MySQL (4). The application is used by about 1,000 clients (each a small company - around 5 users) and it sits on 3 servers. Each installation is seperate. That is on each box we have the web-server root directory and then about 300 subdirectories all of which contain a copy of the application. 99% of these copies are exactly the same. Very few clients have a few custom mods which means they need a different copy of code. I've never seen anything like this and it seems to me to be really redundent design. Each installation takes up about 5Mb, so we're using 5GB of storage where I figure we could use under 100MB! That's a starter. My question is what impact this sort of design would have on the performane of PHP. If we were to restructure so we had only a few dirctories, each containing versions of the applications (e.g. /version1, /version2, /compnay1_custom) would this improve performance? I'm kinda wondering about how PHP caches scripts etc. In the current setup would it consider the same files as different because they sit in different sub-directories? I.e. /site1/index.php would be cached and then so would site2/index.php despite them being the same file? If this is so then it seems to me that having site1 and site2 etc run from the same source files would make caching much more efficient. I've rambled a bit, apologies. Any advice you guys can give is greatly appreciated. If you want clarification then just let me know! Cheers, Mike
Your main problem is not the performance of PHP, but the fact you have 300 installations of almost identical code mean that if you make changes to one installation, you have to go through 299 more making changes. If it is possible, you should come up with an object orientated design which allows various modifications without changing the core code. That way all installations can use the 99% of the same files / classes making it more manageable.