Our site is setup in this manner:

We have a domain and and all our individual hotel pages are under that domain. However, the setup is that each page has its own WordPress installation and corresponding theme template that is associated with that hotels individual page.

This template is a custom template that has many loops i.e. loop-accomadations.php , loop-services.php that give way the customization and functionality of the template. This template is thus repeated over 30 times - not every site gets equal traffic… only a few way more than others. Everything about the template is the same except for the CSS associated with that team page.

The result is our php scripts are causing a massive server load sometimes 100% of cpu or a 5 - 7 server load when it should be below a 1.

The reaction from the VPS hosting company is that we need to optimize our php scripts.

Question 1. — Will optimizing scripts do much or is this an issue mainly due to the hardware via the VPS?

Question 2. — The fact we are running an equal template repeated 30 times is this an issue? And is it possible to centralize the loops and includes and only have the corresponding css to that hotels page be the point of difference? Is this better than having the same instances repeated throughout the server?

Question 3. — If we were able to centralize the loops and includes of the theme would that be sufficient to handle high traffic by a few sites?

Question 4. — What does traffic do to the handling of those scripts i.e. is it making it worse when traffic is high and thus is that an issue more with the hosting company than the fact we have heavy scripts associated with the theme?

Any help is appreciated.

Read more here: Optimizing a PHP WordPress template with edits that have many includes and loops to index.php causing massive server load on VPS


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , , , , , , , , ,

Wordpress related questions and answers: