I create a Joomla website before 1 year, but before 1 month my Godaddy hosting said we have reached all resources and the CPU 100%, when I contact the support they said we have a PHP Script that start and not ended. how can I find this script?
During a similar situation to your own, I did some research and collected potential reasons for exceeding resource limitations on a shared hosting plan and you may find the following list useful in tracking down your issue.
Memory and CPU resource utilisation are often linked. For example, if memory resources are in short supply, memory might be paged to disk causing a CPU overhead. If CPU resources are in short supply, more memory might be requested to help alleviate the CPU issue. Some of the items in the following list might relate more to memory and some might relate more to CPU but are probably all worth checking if you are hitting a resource limitation.
Some of the potential reasons are easier to check for or test than others and it makes sense to check the easiest ones first. For example, you may end up having to do number 22 (temporarily disabling extensions one by one) but it probably makes sense to do some of the basic checks like nos. 1 to 9 first as these are relatively quick to do and may help narrow down the culprit fairly quickly.
- increase the PHP memory_limit by creating or editing the php.ini and adding
memory_limit = 512Mor change settings via cPanel -> "Select PHP Version" or similar
- check for any recent changes by looking at file and folder dates in components, plugins, modules, images/slideshow folders etc
- check for and apply updates to Joomla and third party extensions
- check the error logs in the /logs folder for anything unusual
- check the error log in cPanel (or similar)
- in phpMyAdmin (or similar), run "Repair" on the session table
- run Admin Tools "Fix Permissions" and "Repair and Optimise Tables" tools
- in cPanel (or similar), check for any CRON jobs that might be causing an excessive load
- in Awstats (or similar), check for excessive "Robots/Spiders visitors" visits - 20,000 hits / 500MB per month or thereabouts from Google and similar is probably reasonable - if necessary, you can use Admin Tools Pro firewall
.htaccesssecurity feature to detect and block spammers - reference: https://stackoverflow.com/a/17822758
- if the Joomla cache is enabled, temporarily increase the cache time to 45 minutes or so
- try temporarily switching to one of the default templates to see if the issue is with the template
- if GZip is enabled in Global Configuration, try temporarily switching it off and also try switching it on if it is currently disabled
- clear and purge the Joomla cache
- if using sh404SEF, purge sh404SEF urls
- purge unpublished urls in Components -> Redirect Manager
- try temporarily disabling SEF (SEF consumes CPU)
- try temporarily setting RewriteEngine Off in
.htaccess(SEF consumes CPU)
- temporarily disable anti flood measures in sh404SEF, Kunena and similar extensions
- run a security audit to check for malware using myJoomla.com or similar
- run gtmetrix.com or similar report to see what, if anything, is taking a long time to load
- temporarily enable Joomla debug mode & check the amount of database queries? (Should ideally be under 30)
- temporarily disable third party modules/plug-ins one by one and check changes in database queries
- log a support request with your hosting provider asking about recent changes and if they can help determine the high resource process and narrow down the issue to a specific extension
- try asset table fix from Elin: http://github.com/elinw/AssetFix
- install CJSpeed (http://www.conquerjoomla.com/index.php?option=com_cjdownload&view=info&id=1&Itemid=116) or similar to see which extensions may be slowing down your website
- tweak MySQL: http://videos.cpanel.net/mysql-optimization
Moving to a web hosting company with more generous resource limits might be a reasonable solution too.
How do I know if the issue is fixed?
Hosting providers often include tools in cPanel (or similar) so you can see the resource utilisation of your account. Checking these graphs will soon show you any change in memory or CPU utilisation etc.
I've never had a looping PHP script, thus never had to track it, however looking around and doing some research (hint), you could use a tool such as Xdebug. It will require a little patience and work. Also make sure you read the documentation so you know exactly what to do:
It might be worth asking GoDaddy if they know which file is causing the loop before starting the above