ECSHOP High CPU Usage: Additional Performance Optimization Notes

       Previously, I published an article titled ecshop CPU Usage Extremely High or 100% – MySQL Optimization, which covered various optimization methods. However, no matter how I tweaked the settings, the CPU would still hit 100% during high traffic.

After observing MySQL, I found that the following statement specifically caused the CPU to spike immediately when executed:

Brush Code
  1. This is used for the sales ranking statistics. When the order volume is large, the indexing is poor, or the data size is huge, you can imagine 鈥?if multiple users execute this statement simultaneously, it is no wonder the CPU spikes. After running a MySQL EXPLAIN analysis on this statement, the index appeared to be fine. I hadn’t considered this issue before and could only resolve it by deleting orders. Initially, that worked, but as soon as the orders built up again, the server would go down. Since my product details page does not display the sales ranking, I edited goods.php and include/goods.php, found the condition f ($sales_count > 0), and changed the 0 here to 100000.


<<<

Leave a Comment

Your email address will not be published.