即使站点流量很低,我的RDS服务器的CPU使用率也接近100%。
该RDS服务器有20〜30个会话。在mysql服务器上检查进程列表后,我可以看到一个复杂的查询正在消耗所有CPU使用率。
但是,我不确定此查询代码是Magento自然mysql查询还是恶意软件查询。
SELECT
count(DISTINCT e.entity_id)
FROM `sales_flat_order_item` AS `order_items`
INNER JOIN `sales_flat_order` AS `order` ON `order`.entity_id = order_items.order_id AND `order`.state <> 'canceled'
LEFT JOIN `catalog_product_entity` AS `e` ON (e.type_id NOT IN ('grouped', 'configurable', 'bundle')) AND e.entity_id = order_items.product_id AND e.entity_type_id = 4
LEFT JOIN `catalog_product_flat_1` AS `cpl` ON e.entity_id = cpl.entity_id
INNER JOIN `catalog_category_produc
***************************************
SELECT
count(DISTINCT e.entity_id)
FROM `sales_flat_order_item` AS `order_items`
INNER JOIN `sales_flat_order` AS `order` ON `order`.entity_id = order_items.order_id AND `order`.state <> 'canceled'
LEFT JOIN `catalog_product_entity` AS `e` ON (e.type_id NOT IN ('grouped', 'configurable', 'bundle')) AND e.entity_id = order_items.product_id AND e.entity_type_id = 4
LEFT JOIN `catalog_product_flat_2` AS `cpl` ON e.entity_id = cpl.entity_id
INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id='2' AND cat_index.visibility IN(2, 4) AND cat_index.category_id = '2'
INNER JOIN `cataloginventory_stock_item` AS `at_inventory_in_stock` ON (at_inventory_in_stock.`product_id`=e.entity_id) AND ((at_inventory_in_stock.use_config_manage_stock = 0 AND at_inventory_in_stock.manage_stock=1 AND at_inventory_in_stock.is_in_stock=1) OR (at_inventory_in_stock.use_config_manage_stock = 0 AND at_inventory_in_stock.manage_stock=0) OR (at_inven
************************
我不确定这些查询是恶意软件还是magento自然查询。
我的网站基于Magento 1.9.3.8。
RDS实例类型为m5.xlarge,CPU为4,RAM容量为16GB。
服务器支持团队建议我确认是否为恶意软件,除非我必须对其进行调整以节省资源。