Portal Home > Knowledgebase > Articles Database > Pre-compiling most used PHP files
Pre-compiling most used PHP files
Posted by Harzem, 10-03-2008, 05:03 AM |
Hello,
My shared server has about 90 websites, all SMF forums. So we have almost 90 copies of every file (unmodified ones) in the server. Many websites has modified files, but still the majority of files are unmodified.
Due to the php+mysql usage, the server load is high. We made optimizations, but we want to decrease the load further if possible.
Is there any way to cache/precompile those php files, so the server uses a single source for all copies? Or do you have totally different suggestions for such a setup, which will decrease the load?
Thank your for the help
|
Posted by 040Hosting, 10-03-2008, 06:07 AM |
How did you find out that PHP is the one causing the server load to be high?
Why i ask is the following: if your MySQL server is the bottleneck your PHP scripts will stay active longer as well (they need to wait for the SQL process to finish). Hence if a SQL server is slower it will eventualy choke up the server with PHP processes as well when there are many concurrent requests.
|
Posted by JulesR, 10-03-2008, 06:47 AM |
As far as I'm aware, the "PHP acceleration" methods out there precompile scripts based on their path and not script content, so having 90 different copies of the same script is irrelevant since they're in different places.
Your only alternative to get caching/precompilation working as you've requested would be to look into having one base installation of SMF running multiple forums, similar to what Wordpress MU achieves. I'm not sure if this is possible, but the principle is sound.
|
Posted by Harzem, 10-03-2008, 07:11 AM |
MySQL is heavy too, we optimized it as we can, now we are also thinking to optimize PHP along with MySQL. Server load is not *that* high, it is at acceptable levels (3 or 4 at a quad core), but we want to decrease PHP service times, since a page with 20 queires spend about 0.2s with MySQL queries, 0.8s with PHP code.
I would love to make a base installation configuration, but many clients modify some of the files with mods or theme changes, so that option is not viable. I will look into the PHP acceleration methods if I can't find a way to cope with the copies
Thank you both.
|
Add to Favourites Print this Article
Also Read