Jump to content

PHP Site causing huge load, need advice


toxicious

Recommended Posts

My website recently got suspended because it was causing high load on my shared hosts servers, and this is not the first time.Though they were kind and unsuspended it and told me to fix it. I am not sure what is causing the load so it would be awesome with some advice or a point in the right direction (maybe how I can test what script is the thief). A little about the website: It's built using PHP only, along with a MySQL DB. It relies heavily on the DB, a lot of queries are made to list stuff.There's basically only one file that is called directly by the user, index.php. That file then includes the right other files depending on the URL the user typed and so on (URL Rewriting is happening).So yeah, a lot of includes are made. The thing is, it didn't have a lot of visitors on it when it got suspended. I can't tell exactly how many were on the site at the moment they suspended it, but I can tell there were only 500 unique visitors that day (normally ~400) and a total of 800 visits. Not that much. I would love to improve the performance of my site, but as I said I have no idea where to start!Is there any program that could run through my site, checking which scripts causing high load so I then could analyze those files in particular?I have a local dev server I could do some testing on at least.

Link to comment
Share on other sites

Your host should be able to tell you which scripts are causing issues. You're not going to have access to that kind of information without root server access. If they're suspending your account, you don't have root access. If they are suspending your account because of high CPU usage, that's difficult to detect inside PHP itself. PHP can figure out how much memory it's using, but CPU usage is harder to calculate. You need other server tools to get that information. High CPU usage might be an indication that you have inefficient loops, like database queries inside loops.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...