Jump to content

Problem with CPU usage


konoha

Recommended Posts

Hi everyone.

 

I have received this warning from my provider:

"Your hosting account has been warned due to high CPU usage - it has reached the limit allowed by your hosting plan.

 

Your plan is allowed to use: 4.5 % CPU average.

Your account has used: 4.55 % CPU average the last 3 days.

 

Your account will be automaticaly blocked if you use more CPU load than your plan is allowed in the next 48 hours."

 

If they are useful:

- version of Prestashop 1.4.4.1

- server provider LiquidNet Ltd

- number of categories 45 / about 500 products.

 

Anyone have any idea?

Server provider told me that: "try reducing the number of MySQL/PostgreSQL queries and optimize your scripts to use less processing time"

How can do this? How to get down CPU Usage?

Please reply as fast as you can! :unsure:

Greetings.

Link to comment
Share on other sites

  • 3 weeks later...

Resource Limit Is Reached

 

I am now having the same problem. In over ten years with ZenCart (same number of products and categories), I had never had this problem. Not once.

 

My original thought was to redevelop with Magento, but I was persuaded that Prestashop was LIGHTER on resources, leaner and faster.

 

The site is on a lightly-loaded business grade VPS:

 

SAS RAID Disk Space - 60 GB

Monthly Data Transfer - 1,000 GB

Dedicated DDR3 Memory - 2 GB

Dedicated CPU Cores- 4 Cores

Link to comment
Share on other sites

I have the same problem. Problem occurs when when you hit search engine.

I had also problems with manufacturer and supplier ajax.error. Host provider managed to help me about ajax problem, but no success with resource limite.

I am using prestashop 1.4.4.0 - upgraded to 1.4.6.2 but did not get rid of the problem, so I downgraded back to 1.4.4.0.

Have you found solution?

Link to comment
Share on other sites

  • 6 months later...
  • 5 months later...

It's a shared server, not sure about details...

 

Apache version

2.2.23

 

PHP version 5.2.17

MySQL version 5.1.66-cll

Architecture x86_64

Operating system linux

 

I'm trying now to backup and upgrade to 1.5.3.1, hoping to succeed - tried once before and didn't manage to do it... If I solve anything I'll let everyone know... Maybe an upgrade is useful :)

Link to comment
Share on other sites

I have several sites hosted there, some exact copies of this one and there are no problems with the others. I have unlimited disk space usage and Monthly Bandwidth Transfer.

I'm trying to upgrade now and I get a xml error, so the upgrade apparently is not a solution for me... I'm going crazy

Link to comment
Share on other sites

Yes, prestashop, copies of this one - Imean copied and different themes. And also others, wp, opencart, osc etc....

 

For those info I need to ask the host I suppose. The only info I saw is:

 

Service Details Status named up green-status.gif imap up green-status.gif ftpd up green-status.gif exim-26 up green-status.gif cpsrvd up green-status.gif Server Load 1.83 (6 cpus) green-status.gif Memory Used 23.3 % green-status.gif Swap Used 0 % green-status.gif Disk /dev/simfs (/) 37 % green-status.gif Disk /home/muccelmi (/home/muccelmi) 37 % green-status.gif

Link to comment
Share on other sites

Oh, and now I'm on a blank page, with debug on - no info shown... Going back, restauring a backup. I have no idea what to do! Is it possible to take products, cleints, etc from the old database and put it in a new one after installing a fresh copy of ps? Now I'm running on 1.4.8.2

Link to comment
Share on other sites

  • 2 weeks later...

I have also problem with cpu resources. My host provider gave me ultimat: I have to find another host provider and select VPS account in few days, or he will kick me out of server.

 

Please help me! My email: [email protected]

 

I am using: PrestaShop™ 1.4.4.0 cPanel Version 11.34.1 (build 7) Izbrana predloga cpanel-a x3 Apache verzija 2.2.23 PHP verzija 5.3.19 MySQL verzija 5.5.28-cll Arhitektura strežnika x86_64 Operacijski sisem linux PERL verzija 5.10.1 Kernel verzija 2.6.32-320.17.1.lve1.1.7.3.el6.x86_64 cPanel Pro 1.0 (RC1)

Link to comment
Share on other sites

I gave up... I tried upgrade, cloning another prestashop store and upgrade, fresh install and import products and some other variations... everything ends up in some kind of unsolvable error. Now I'm trying to clone a v 1.2 prestashop store of mine and change the theme and sticking to that. Because a fresh install and manually adding 1500 products gives me headackes :)

Link to comment
Share on other sites

same situation here... already move to a vps, but still got a warning from the vps hosting...

 

4 cpu cores, 60 Gb SSD cached storage, 1024 Ram, 3 TB bandwidth, with only 2000 visitor per day. but still the CPU usage is above normal..

 

dedicated server is still too costly for me... hope someone would give some info...

Link to comment
Share on other sites

Ok... We really need to figure tis out! I'm losing time, money, customers... I did this: cloned a working 1.3.2.3 v of a functional ps store of mine, upgraded to 1.4.8.2 (because I can't upgrade to v 1.5 - gives a xml error, something on row 28, didn't save it), modified it - theme and some modules installed. This morning my site is closed again: www.shopbebe.eu, I believe because of the same cpu problem. Visitors? I think I have up to 100 a day, converting very well into customers, it was just beginning to grow... With the same host I have another 7 shops, 2 osc, 5 ps, with no noticeable problems, versions from 1.2 to 1.4.7.3

 

So, my conclusion: it could be a problem with v 1.4.8.2 or a theme problem or a modules problem. Here are the modules installed making the difference between the orginal shop I cloned and the cloned one ( I think, because I don't have acces to folders on server now):

 

- block reinsurance

- canonical url

- extramanufacturer

- fblikeboxsocialplugin

- homefeaturedcustom

- likealotmodule

- productscategory

- productpagetags

- productvideos

- pss_carousel

- blocktopmenu

 

I think these are all... So, the problem reported by my host was having to do with category.php. Which one of these would have to do with that file affecting it?

 

Could you recommend me an import/export (working) tool so I can install a fresh 1.5.3 version and move my products from one of my other shops (there are exactly the same products)? Not cart2cart, I understand it's a one time only transfer, having 6 ps shop needing an upgrade it's not a good financial solution... Oooor... someone bright and smart and nice :) come up with a solution... :) Pleease ...

Link to comment
Share on other sites

Hi,

I have the same problem, i have a prestashop store since 2009 and in December of 2012 the file catergory.php start high CPU usage resources.

If i delete the file category.php from my store the cpu usage is above 12%, but if i have the file in the store, the cpu usage is over 96% or 100%.

This situation appears without any changes in the store, i not understand whats cause this issue.

 

The prestashop support team not have any solution?

Link to comment
Share on other sites

So... if its not a newly installed module, if on another ps shop the same file another version works just fine... it's either a 1.4.8.2 bug or the category.php file is somehow hacked... Just thoughts... Posting the file would help? It seems we really need an experts help.

Link to comment
Share on other sites

This is my category.php content:

<?php
include(dirname(__FILE__).'/config/config.inc.php');
include(dirname(__FILE__).'/init.php');
//will be initialized bellow...
if(intval(Configuration::get('PS_REWRITING_SETTINGS')) === 1)
$rewrited_url = null;
/* CSS ans JS files calls */
$css_files = array(__PS_BASE_URI__.'css/jquery.cluetip.css' => 'all', _THEME_CSS_DIR_.'scenes.css' => 'all');
include(dirname(__FILE__).'/header.php');
include(dirname(__FILE__).'/product-sort.php');
$errors = array();
if (!isset($_GET['id_category']) OR !Validate::isUnsignedId($_GET['id_category']))
$errors[] = Tools::displayError('category ID is missing');
else
{
$category = new Category(intval(Tools::getValue('id_category')), intval($cookie->id_lang));
if (!Validate::isLoadedObject($category))
 $errors[] = Tools::displayError('category does not exist');
elseif (!$category->checkAccess(intval($cookie->id_customer)))
 $errors[] = Tools::displayError('you do not have access to this category');
else
{
 /* rewrited url set */
 $rewrited_url = $link->getCategoryLink($category->id, $category->link_rewrite);

 /* Scenes  (could be externalised to another controler if you need them */
 $smarty->assign('scenes', Scene::getScenes(intval($category->id), intval($cookie->id_lang), true, false));
 /* Scenes images formats */
 if ($sceneImageTypes = ImageType::getImagesTypes('scenes'))
 {
  foreach ($sceneImageTypes AS $sceneImageType)
  {
   if ($sceneImageType['name'] == 'thumb_scene')
 $thumbSceneImageType = $sceneImageType;
   elseif ($sceneImageType['name'] == 'large_scene')
 $largeSceneImageType = $sceneImageType;
  }
  $smarty->assign('thumbSceneImageType', isset($thumbSceneImageType) ? $thumbSceneImageType : NULL);
  $smarty->assign('largeSceneImageType', isset($largeSceneImageType) ? $largeSceneImageType : NULL);
 }
 $category->name = Category::hideCategoryPosition($category->name);
 $category->description = nl2br2($category->description);
 $subCategories = $category->getSubCategories(intval($cookie->id_lang));
 $smarty->assign('category', $category);
 if (Db::getInstance()->numRows())
  $smarty->assign('subcategories', $subCategories);
 if ($category->id != 1)
 {
  $nbProducts = $category->getProducts(NULL, NULL, NULL, $orderBy, $orderWay, true);
  include(dirname(__FILE__).'/pagination.php');
  $smarty->assign('nb_products', $nbProducts);
  $cat_products = $category->getProducts(intval($cookie->id_lang), intval($p), intval($n), $orderBy, $orderWay);
 }
 $smarty->assign(array(
	    'products' => (isset($cat_products) AND $cat_products) ? $cat_products : NULL,
	    'id_category' => intval($category->id),
  'id_category_parent' => intval($category->id_parent),
  'return_category_name' => Tools::safeOutput(Category::hideCategoryPosition($category->name)),
	    'path' => Tools::getPath(intval($category->id), $category->name)
 ));
}
}
$smarty->assign(array(
'allow_oosp' => intval(Configuration::get('PS_ORDER_OUT_OF_STOCK')),
'suppliers' => Supplier::getSuppliers(),
'errors' => $errors));
if (isset($subCategories))
$smarty->assign(array(
 'subcategories_nb_total' => sizeof($subCategories),
 'subcategories_nb_half' => ceil(sizeof($subCategories) / 2)));
$smarty->display(_PS_THEME_DIR_.'category.tpl');
include(dirname(__FILE__).'/footer.php');
?>

In error log i have this error more than 3000 times:

PHP Warning:  htmlentities() [<a href='function.htmlentities'>function.htmlentities</a>]: Invalid multibyte sequence in argument in /home/username/public_html/shop/classes/Tools.php on line 312

This can be the problem?

Link to comment
Share on other sites

  • 6 months later...

but if you delete the category.php file you shop don't work?

 

because i've the same issue, my hosting 0zed.com is suspended me 10-15 times in 10 day, before my shop is always work fine.

 

I've about 1500 items, 20-30 category, 20-100 visit daily and i've configured attribute like size and colors..

Link to comment
Share on other sites

  • 10 months later...

Hi all. THIS IS VERY URGENT. I am SOOOO lost and confused here :(

 

I too have been notified by my host (Rochen in UK) that I am abusing the shared server CPU resources and using well over 100% in any given 24 hour period. 

They have asked me to fix it, upgrade to a VPS (for 100 pounds a month, ouch) or move to another server and they only give me 5 days to solve the issue. Below is the mail they sent me with links to resources on how to fix it but I am not a programmer and don't understand why my prestashop is using so much CPU. Any help or tips would be great. I am using PS 1.5.3.1 and have about 500 products. 

It seems that my "index.php" (homepage is causing the problem. I usually get about 40 visits a day according to google analytics but on the dates noted by my host below (July 2, 3, 4, 5, 6) the visits went up over 100 but I can't imagine just 100-150 visits a day would use so much CPU.  

My shop is at http://www.fixgear.info and while it uses a lot of HEAVY images, i am not sure that could cause the CPU abuse, can it with just 100-150 visits a day. 

I have read about crawlers but do not know how to stop that or even if it is my case? 

I would be happy to pay someone to help me fix this issue if need be. 

Thanks in advance. 

mail from my host.

______________________________________________________________________________


Dear Client

Please read this notice in full before replying to this ticket.

[Please note that this ticket is in our Security and Policy Queue and is not actively monitored 24/7 like a Tech Support ticket. After you update this ticket we will always reply within 24 hours. Be sure to submit a normal Support Ticket for any separate issues.]

***IMPORTANT: You must provide daily updates to this ticket until we notify you that the issue can be considered resolved and the ticket is closed. If we do not receive daily updates from you during the resolution process the account may be suspended without additional warning, thank you.***


This ticket has been opened under your account as a high resource usage warning as CPU usage has exceeded the level permitted by our Acceptable Use Policy (AUP) on shared plans.

The above account is currently using up to an average of 120% of the available CPU on the server. This figure is a 24 hour average. This level of usage is not permitted under a shared account and is affecting performance for other customers on this shared server.

Below are examples from the daily usage logs:

Jul 01 2014:
fixgear fixgear.info 6.03 0.04 0.1 
Top Process %CPU 166 /usr/bin/php /home/fixgear/public_html/lyncayden/index.php 
Top Process %CPU 127 /usr/bin/php /home/fixgear/public_html/index.php 
Top Process %CPU 125

 

Jul 02 2014:
fixgear fixgear.info 7.81 0.07 0.2 
Top Process %CPU 161 /usr/bin/php /home/fixgear/public_html/index.php 
Top Process %CPU 151 /usr/bin/php /home/fixgear/public_html/admin/index.php 
Top Process %CPU 111 /usr/bin/php /home/fixgear/public_html/index.php 

Jul 03 2014:
fixgear fixgear.info 8.46 0.08 0.1 
Top Process %CPU 130 /usr/bin/php /home/fixgear/public_html/index.php 
Top Process %CPU 119 /usr/bin/php /home/fixgear/public_html/index.php 
Top Process %CPU 112 /usr/bin/php /home/fixgear/public_html/index.php 

Jul 04 2014:
fixgear fixgear.info 6.20 0.07 0.0 
Top Process %CPU 179 /usr/bin/php /home/fixgear/public_html/index.php 
Top Process %CPU 112 /usr/bin/php /home/fixgear/public_html/index.php 
Top Process %CPU 103 /usr/bin/php /home/fixgear/public_html/index.php 

Jul 05 2014:
fixgear fixgear.info 5.42 0.07 0.1 
Top Process %CPU 145 /usr/bin/php /home/fixgear/public_html/index.php 
Top Process %CPU 109 /usr/bin/php /home/fixgear/public_html/index.php 
Top Process %CPU 104 /usr/bin/php /home/fixgear/public_html/index.php 

Jul 06 2014:
fixgear fixgear.info 4.90 0.04 0.0 
Top Process %CPU 144 /usr/bin/php /home/fixgear/public_html/index.php 
Top Process %CPU 133 /usr/bin/php /home/fixgear/public_html/index.php 
Top Process %CPU 106 /usr/bin/php /home/fixgear/public_html/index.php 

Jul 07 2014 (partial stats, 19 hours into the day):
fixgear fixgear.info 5.93 0.04 0.1 
Top Process %CPU 126 /usr/bin/php /home/fixgear/public_html/index.php 
Top Process %CPU 112 /usr/bin/php /home/fixgear/public_html/index.php 
Top Process %CPU 105 /usr/bin/php /home/fixgear/public_html/index.php 


------------------------------------------------------------------------------------------------------------------------------


The following Knowledge Base (KB) article will help to explain the figures above:

https://my.rochen.com/knowledgebase.php?action=displayarticle&catid=2&id=4


For details on possible causes of excessive CPU/memory usage and troubleshooting steps please see this PDF document:

https://my.rochen.com/docs/RochenLtd-CPU-usage-information.pdf


You can review the resource limits for a shared plan in section 2 of our AUP here:

http://www.rochenhost.com/legal/acceptable-use-policy

Please ensure that you respond to this ticket within 24 hours to let us know that you are actively working to resolve the issue. We can provide a 14 day grace period from this notice (or only 7 days for accounts with CPU or Memory Usage above 8.0%/24hrs) for you to resolve the matter as long as you keep us updated on your progress via this ticket on a daily basis. At the moment the account is not suspended however should usage rise further we may be forced to temporarily suspend the account without prior warning. This will typically happen if resource utilization nears the 10.0%/24hr. threshold.

Please note that extensions to the grace period cannot be provided, so it is important to begin resolving this issue as soon as possible after receipt of this high resource usage notice. If the high resource usage issue cannot be resolved within the grace period 1) the responsible script will need to be removed, 2) the account will need to be upgraded to a Managed Dedicated Environment with Rochen (such as our MVS plan or any larger MDS plan), or 3) the site will need to be moved to another hosting provider.

Thank you for your urgent attention to this matter.

----
Rochen Limited

______________________________________________________________________________

 

 

Link to comment
Share on other sites

  • 1 month later...

 

Hi all. THIS IS VERY URGENT. I am SOOOO lost and confused here :(

 

I too have been notified by my host (Rochen in UK) that I am abusing the shared server CPU resources and using well over 100% in any given 24 hour period. 

 

They have asked me to fix it, upgrade to a VPS (for 100 pounds a month, ouch) or move to another server and they only give me 5 days to solve the issue. Below is the mail they sent me with links to resources on how to fix it but I am not a programmer and don't understand why my prestashop is using so much CPU. Any help or tips would be great. I am using PS 1.5.3.1 and have about 500 products. 

 

It seems that my "index.php" (homepage is causing the problem. I usually get about 40 visits a day according to google analytics but on the dates noted by my host below (July 2, 3, 4, 5, 6) the visits went up over 100 but I can't imagine just 100-150 visits a day would use so much CPU.  

 

My shop is at http://www.fixgear.info and while it uses a lot of HEAVY images, i am not sure that could cause the CPU abuse, can it with just 100-150 visits a day. 

 

I have read about crawlers but do not know how to stop that or even if it is my case? 

 

I would be happy to pay someone to help me fix this issue if need be. 

 

Thanks in advance. 

mail from my host.

 

______________________________________________________________________________

Dear Client

Please read this notice in full before replying to this ticket.

 

[Please note that this ticket is in our Security and Policy Queue and is not actively monitored 24/7 like a Tech Support ticket. After you update this ticket we will always reply within 24 hours. Be sure to submit a normal Support Ticket for any separate issues.]

 

***IMPORTANT: You must provide daily updates to this ticket until we notify you that the issue can be considered resolved and the ticket is closed. If we do not receive daily updates from you during the resolution process the account may be suspended without additional warning, thank you.***

 

 

This ticket has been opened under your account as a high resource usage warning as CPU usage has exceeded the level permitted by our Acceptable Use Policy (AUP) on shared plans.

 

The above account is currently using up to an average of 120% of the available CPU on the server. This figure is a 24 hour average. This level of usage is not permitted under a shared account and is affecting performance for other customers on this shared server.

 

Below are examples from the daily usage logs:

 

Jul 01 2014:

fixgear fixgear.info 6.03 0.04 0.1 

Top Process %CPU 166 /usr/bin/php /home/fixgear/public_html/lyncayden/index.php 

Top Process %CPU 127 /usr/bin/php /home/fixgear/public_html/index.php 

Top Process %CPU 125

 

 

Jul 02 2014:

fixgear fixgear.info 7.81 0.07 0.2 

Top Process %CPU 161 /usr/bin/php /home/fixgear/public_html/index.php 

Top Process %CPU 151 /usr/bin/php /home/fixgear/public_html/admin/index.php 

Top Process %CPU 111 /usr/bin/php /home/fixgear/public_html/index.php 

 

Jul 03 2014:

fixgear fixgear.info 8.46 0.08 0.1 

Top Process %CPU 130 /usr/bin/php /home/fixgear/public_html/index.php 

Top Process %CPU 119 /usr/bin/php /home/fixgear/public_html/index.php 

Top Process %CPU 112 /usr/bin/php /home/fixgear/public_html/index.php 

 

Jul 04 2014:

fixgear fixgear.info 6.20 0.07 0.0 

Top Process %CPU 179 /usr/bin/php /home/fixgear/public_html/index.php 

Top Process %CPU 112 /usr/bin/php /home/fixgear/public_html/index.php 

Top Process %CPU 103 /usr/bin/php /home/fixgear/public_html/index.php 

 

Jul 05 2014:

fixgear fixgear.info 5.42 0.07 0.1 

Top Process %CPU 145 /usr/bin/php /home/fixgear/public_html/index.php 

Top Process %CPU 109 /usr/bin/php /home/fixgear/public_html/index.php 

Top Process %CPU 104 /usr/bin/php /home/fixgear/public_html/index.php 

 

Jul 06 2014:

fixgear fixgear.info 4.90 0.04 0.0 

Top Process %CPU 144 /usr/bin/php /home/fixgear/public_html/index.php 

Top Process %CPU 133 /usr/bin/php /home/fixgear/public_html/index.php 

Top Process %CPU 106 /usr/bin/php /home/fixgear/public_html/index.php 

 

Jul 07 2014 (partial stats, 19 hours into the day):

fixgear fixgear.info 5.93 0.04 0.1 

Top Process %CPU 126 /usr/bin/php /home/fixgear/public_html/index.php 

Top Process %CPU 112 /usr/bin/php /home/fixgear/public_html/index.php 

Top Process %CPU 105 /usr/bin/php /home/fixgear/public_html/index.php 

 

 

------------------------------------------------------------------------------------------------------------------------------

 

 

The following Knowledge Base (KB) article will help to explain the figures above:

 

https://my.rochen.com/knowledgebase.php?action=displayarticle&catid=2&id=4

 

 

For details on possible causes of excessive CPU/memory usage and troubleshooting steps please see this PDF document:

 

https://my.rochen.com/docs/RochenLtd-CPU-usage-information.pdf

 

 

You can review the resource limits for a shared plan in section 2 of our AUP here:

 

http://www.rochenhost.com/legal/acceptable-use-policy

 

Please ensure that you respond to this ticket within 24 hours to let us know that you are actively working to resolve the issue. We can provide a 14 day grace period from this notice (or only 7 days for accounts with CPU or Memory Usage above 8.0%/24hrs) for you to resolve the matter as long as you keep us updated on your progress via this ticket on a daily basis. At the moment the account is not suspended however should usage rise further we may be forced to temporarily suspend the account without prior warning. This will typically happen if resource utilization nears the 10.0%/24hr. threshold.

 

Please note that extensions to the grace period cannot be provided, so it is important to begin resolving this issue as soon as possible after receipt of this high resource usage notice. If the high resource usage issue cannot be resolved within the grace period 1) the responsible script will need to be removed, 2) the account will need to be upgraded to a Managed Dedicated Environment with Rochen (such as our MVS plan or any larger MDS plan), or 3) the site will need to be moved to another hosting provider.

 

Thank you for your urgent attention to this matter.

 

----

Rochen Limited

______________________________________________________________________________

 

 

same problem here...

Link to comment
Share on other sites

  • 1 year later...

Well, I am bumping the thread because I've received a mail from my hosting provider that I am using too much of CPU. I am attaching a screen with usage just from one day.

I red that a lot of people is having issue with this index.php file and CPU usage. Any help?

If this is an index maybe it is because some crawler or chinese bots? But this is weird, because another index.php in admin area is having high usage as well and robots do not have access to this file.

 

post-1146962-0-52099700-1466405874_thumb.jpg

  • Like 1
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...