有关ecshop CPU100%

2016-07-07 15:38 来源:www.chinab4c.com 作者:ecshop专家



未命名-1.jpg Kill1855rootlocalhost:3729数据库Query1Copying to tmp tableSELECT DISTINCT SUM(goods_number) AS num FROM `表`.`ecs_order_info` AS o, `mayunfei`.`ecs_orde




Kill1856rootlocalhost:3730数据库Query1Copying to tmp tableSELECT g.goods_id, g.goods_name, g.goods_img, SUM(og.goods_number) as goods_number FROM `mayunfei`.`

好像在进行这两个语句的时候cpu突然一下就上去了(特别是下面那句),如果很多条语句则CPU就100%

看了写介绍,似乎把MyISAM转为InnoDB,请问大家是否有效果?可以转吗?有无副作用

回答:


SELECT g.goods_id, g.goods_name, g.goods_img, SUM( og.goods_number ) AS goods_number
FROM `ecshopdb`.`ecs_goods` AS g, `ecshopdb`.`ecs_order_info` AS o, `ecshopdb`.`ecs_order_goods` AS og
WHERE g.is_on_sale =1
AND g.is_alone_sale =1
AND g.is_delete =0
AND og.order_id = o.order_id
AND og.goods_id = g.goods_id
AND o.order_status = '1'
AND (
o.pay_status = '2'
OR o.pay_status = '1'
)
AND (
o.shipping_status = '1'
OR o.shipping_status = '2'
)
GROUP BY g.goods_id
ORDER BY goods_number DESC , g.goods_id DESC
LIMIT 10

还有类似这个

我的也是,如何解决呢?这个问题很严重

原来有人比我出现的问题更早。。。如何解决?

CPU占用过高和服务器环境配置及程序都有关系。你可以把服务器的相关权限和程序后台用站内信发给我,我帮你排查优化一下。

我总结下几种解决方法,都没有彻底解决,如果大家有这方面的问题,来看看http://blog.youyiweb.cn/post/61.html