Find out why the process is consuming high CPU.
The process consumes high CPU, generally because the process consumes CPU for a long time, and does not actively release the occupation. If you want to actively release the CPU, you can call sleep. When writing a program, pay particular attention to where the while and other loops are.
Find out which code the PHP process is executing
$sudo gdb-p10434 (gdb) print (char *) executor_globals.active_op_array->filename$13 =0x2924118"/home/admin/gearman_manager/pecl-manager.php" (gdb) Print executor_globals->current_execute_data->opline- >lineno$14 =(GDB) Ccontinuing.^cprogram received signal SIGINT, interrupt. 0x00000031d32306d0 in sigprocmask () from/lib64/libc.so. 6 (gdb) print Executor_globals->current_execute_data->opline->lineno$15 = Span class= "Hljs-number" >71 (gdb) ccontinuing.^Cprogram received signal sigint, Interrupt. 0x00000000006250e1 in Zend_hash_find () (gdb) Print Executor_ Globals->current_execute_data->opline->lineno$16 = 53
If you have questions about the above command, you can look at the lines of code that might be problematic in PHP when the CPU soars
According to the above information, we can know that when the CPU is high, the/home/admin/gearman_manager/pecl-manager.php file is being executed. and executing code near lines 53 and 71.
can also be debugged via Strace
PHP Application CPU 100% Debugging method