Hi,
My site can't be accessed and i check get MySql use cpu %190,check processlist get like below(using ps:1.4.2.5):
+-----+----------+-----------+-------------+---------+------+----------------+------------------------------------------------------------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+----------+-----------+-------------+---------+------+----------------+------------------------------------------------------------------------------------------------------+
| 246 | AA | localhost | AA_db | Query | 387 | Sorting result | SELECT cp.`id_product_attribute`, cp.`id_product`, cu.`id_customization`, cp.`quantity` AS cart_quan |
| 250 | AA | localhost | AA_db | Query | 366 | Sorting result | SELECT cp.`id_product_attribute`, cp.`id_product`, cu.`id_customization`, cp.`quantity` AS cart_quan |
| 252 | AA | localhost | AA_db | Query | 351 | Sorting result | SELECT cp.`id_product_attribute`, cp.`id_product`, cu.`id_customization`, cp.`quantity` AS cart_quan |
| 260 | AA | localhost | AA_db | Query | 325 | Sending data | SELECT cp.`id_product_attribute`, cp.`id_product`, cu.`id_customization`, cp.`quantity` AS cart_quan |
| 265 | AA | localhost | AA_db | Query | 308 | Sorting result | SELECT cp.`id_product_attribute`, cp.`id_product`, cu.`id_customization`, cp.`quantity` AS cart_quan |
| 267 | AA | localhost | AA_db | Query | 298 | Sorting result | SELECT cp.`id_product_attribute`, cp.`id_product`, cu.`id_customization`, cp.`quantity` AS cart_quan |
| 268 | AA | localhost | AA_db | Query | 273 | Sorting result | SELECT cp.`id_product_attribute`, cp.`id_product`, cu.`id_customization`, cp.`quantity` AS cart_quan |
| 274 | AA | localhost | AA_db | Query | 244 | Sorting result | SELECT cp.`id_product_attribute`, cp.`id_product`, cu.`id_customization`, cp.`quantity` AS cart_quan |
| 276 | AA | localhost | AA_db | Query | 234 | Sorting result | SELECT cp.`id_product_attribute`, cp.`id_product`, cu.`id_customization`, cp.`quantity` AS cart_quan |
| 278 | AA | localhost | AA_db | Query | 218 | Sorting result | SELECT cp.`id_product_attribute`, cp.`id_product`, cu.`id_customization`, cp.`quantity` AS cart_quan |
| 321 | root | localhost | NULL | Query | 0 | NULL | show processlist |
| 324 | AA | localhost | AA_db | Query | 5 | Sending data | SELECT cp.`id_product`
FROM `ps_category_group` cg
INNER JOIN `ps_category_product` cp ON cp.`id |
+-----+----------+-----------+-------------+---------+------+----------------+------------------------------------------------------------------------------------------------------+
Uptime: 3463 Threads: 10 Questions: 260447 Slow queries: 26071 Opens: 22654 Flush tables: 1 Open tables: 126 Queries per second avg: 75.208
Is there anyone can help,many thanks!
And now it's changed like below:
+-----+----------+-----------+-------------+---------+------+----------------+------------------------------------------------------------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+----------+-----------+-------------+---------+------+----------------+------------------------------------------------------------------------------------------------------+
| 739 | AA | localhost | AA_db | Query | 276 | Locked | UPDATE `ps_cart_product`
SET `quantity` = `quantity` + 1
WHERE `id_product` = 50228 AND `i |
| 747 | AA | localhost | AA_db | Query | 276 | Locked | UPDATE `ps_cart_product`
SET `quantity` = `quantity` + 1
WHERE `id_product` = 50228 AND `i |
| 752 | AA | localhost | AA_db | Query | 277 | Sorting result | SELECT cp.`id_product_attribute`, cp.`id_product`, cu.`id_customization`, cp.`quantity` AS cart_quan |
| 759 | AA | localhost | AA_db | Query | 277 | Sorting result | SELECT cp.`id_product_attribute`, cp.`id_product`, cu.`id_customization`, cp.`quantity` AS cart_quan |
| 773 | AA | localhost | AA_db | Query | 277 | Sorting result | SELECT cp.`id_product_attribute`, cp.`id_product`, cu.`id_customization`, cp.`quantity` AS cart_quan |
| 778 | AA | localhost | AA_db | Query | 276 | Locked | SELECT cp.`quantity`
FROM `ps_cart_product` cp
WHERE cp.`id_product` = 405 AND cp.`id_product |
| 780 | AA | localhost | AA_db | Query | 276 | Locked | SELECT cp.`quantity`
FROM `ps_cart_product` cp
WHERE cp.`id_product` = 405 AND cp.`id_product |
| 782 | AA | localhost | AA_db | Query | 276 | Locked | SELECT cp.`quantity`
FROM `ps_cart_product` cp
WHERE cp.`id_product` = 405 AND cp.`id_product |
| 786 | AA | localhost | AA_db | Query | 277 | Sorting result | SELECT cp.`id_product_attribute`, cp.`id_product`, cu.`id_customization`, cp.`quantity` AS cart_quan |
| 788 | AA | localhost | AA_db | Query | 277 | Sorting result | SELECT cp.`id_product_attribute`, cp.`id_product`, cu.`id_customization`, cp.`quantity` AS cart_quan |
| 881 | AA | localhost | AA_db | Query | 228 | Locked | SELECT cp.`quantity`
FROM `ps_cart_product` cp
WHERE cp.`id_product` = 3039 AND cp.`id_produc |
| 882 | AA | localhost | AA_db | Query | 219 | Locked | SELECT cp.`quantity`
FROM `ps_cart_product` cp
WHERE cp.`id_product` = 69407 AND cp.`id_produ |
| 895 | root | localhost | NULL | Query | 0 | NULL | show processlist |
+-----+----------+-----------+-------------+---------+------+----------------+------------------------------------------------------------------------------------------------------+