0

I keep on getting emails from the host that the php script on shared hosting uses excessive resources.

I do not know what resources the host is talking about - whether it's the cpu, ram or the disk i/o ?

Where do I start to find out what part of the script is causing the excessive resource usage? Is it the php code or the database/queries?

Once I find out the above, how do i go about correcting it?

user481913
  • 1,022
  • 1
  • 13
  • 36

2 Answers2

0

Probably a good idea to contact the host and ask if they can give you more information. Going through all code in a project to find a potential resource-hog (and even worse, not even knowing what type of resource it is eating up) would be a very very long and annoying task.

You could try run the same scripts on your own home computer and see what happens and try to locate it that way.

When it comes to fix the bug, try create a case where it always does the bad thing, then comment away parts of the code and locate where the issue arises that way. When you find it, fix it (can't give a general advice on fixing a specific bug, sorry, hehe).

Jite
  • 5,761
  • 2
  • 23
  • 37
  • This of course depending on how much code there is, if its a 10 line script it might be a better idea just pasting the code here! :P – Jite Nov 30 '13 at 10:06
0

Ask your service provider for a complete details. Regarding Disk and DB space, you can check it out from the hosting control panel.

Running the whole complete project in your local pc is a good idea but in case of shared hosting account the scenario becomes different. As you know only about hosting space and bandwidth allotted to you other then RAM and processor.

Can you explain here what kind of project you have hosted on shared server.

Umesh Sinha
  • 11
  • 1
  • 4