During the recent website activities, the order volume was several times more than usual. During this period, the cpu usage of the two APIs reached 60%, and the memory usage was normal. Preliminary suspicion is the reason for the large amount of orders, so I am reading the code for shopping cart, settlement, and order submission, but I don't feel useful, so I want to have something... during the recent website activities, the order volume was several times more than usual. During this period, the cpu usage of the two APIs reached 60%, and the memory usage was normal. Preliminary suspicion is the reason for the large amount of orders, so I am reading the code for shopping cart, settlement, and order submission, but I don't feel it is useful, so what tools can be used to track the code cpu usage in the program, and then optimize the Code accordingly. I searched the internet and found that xdebug is only for the running time of the code, but what I want to know is the cpu, I don't know if you have any methods or tools to help find the code block to be optimized.
Reply content:
During the recent website activities, the order volume was several times more than usual. During this period, the cpu usage of the two APIs reached 60%, and the memory usage was normal. Preliminary suspicion is the reason for the large amount of orders, so I am reading the code for shopping cart, settlement, and order submission, but I don't feel it is useful, so what tools can be used to track the code cpu usage in the program, and then optimize the Code accordingly. I searched the internet and found that xdebug is only for the running time of the code, but what I want to know is the cpu, I don't know if you have any methods or tools to help find the code block to be optimized.
It is recommended to understand the APM, such as: http://www.oneapm.com/ai/php.html
"Performance" is ultimately time
High cpu usage is a phenomenon. The more fundamental reason is that the old request is not complete when the new request comes (assuming you are not writing thread scheduling, spin locks, and other things in php)