I need help fast. For a mount or so, I noticed that my php script is overloading the cpu. The problem is I cann't see what script is the trouble. I get around 12000 processes each day, causing a 5% load. And the limit is 4.5%. The web hoasting company said they will close my site if I don't sort it out quick. I don't know what to do. Can you please help me?
i got kicked off of a server once for using too many mySql resources. does your script make any db calls?
The reason can be too many db queries as lbalance said or some empty loops that have no effect and load the cpu. tell what kind of site is it
i have the same problem. my host told me to optimize my database without telling me how to do it. how do you optimize your database for a less strain on the server? what queries use more resources, and what should they be changed to?
WebDivx, see my post to your other thread. Dugo, there has to be clues somewhere? Even at 12,000 hits, it would be uncommon for a site to use 5% CPU time on a server unless they all happened at once or the processes were hanging (poor design) or the database was incredibly huge and/or poorly designed. With link directories, sometimes the problem ends up being with someone scraping your content or a spider crawling your site. Unfortunately, some spiders are ruthless and ask for hundreds of pages per minute (or more, I've seen it be in the thousands) and if all of those pages are dynamic, that sudden load increase can bring a shared server to its knees. Look in the log files for a lot of page accesses from the same IP address in a very short period of time. You can also shell in and watch top to see what processes are using a lot of time/memory.
well, it is a phpldscript, and I simply added some mod. I belive it has to be some processes hanging, but I cann't find the error. I'll look into it more closely.
Is it a shared host of VPS environment. I've found the VPS environments to be incredibly frustrating in that they often impose overly restrictive memory and cpu restrictions and will end a process (sometimes without freeing the memory) when they exceed those restrictions. I had a VPS once that had to be rebooted very frequently. The sites were very active Perl based sites back in the late 90's. The code was very efficient, it was just a lot of hits coming in (I ran a banner exchange, remember those old things ).
Virtual Private Server... It's a shared hosting solution that acts like a dedicated server. They are almost always labeled and sold as VPS (look at www.tektonic.net for example). The advantage is that every user gets their own kernel and root login. You can compile modules, edit apache and bind configuration files ,everything you'd expect to do on a dedicated server. But because its a shared environment, the cost is WAY lower than the costs on a shared server. The problem is, because each user environment is a separate encapsulated kernel, there are usually some really severe server restrictions (CPU Time, Memory Usage) in place. This causes problems on dynamic sites. If you're mainly just static pages, then no biggie, but why would you need virtual root access if that were the case.