|
1 | 1 | --- |
2 | 2 | myst: |
3 | 3 | html_meta: |
4 | | - description: 'If you have a PHP process that has been running for a long while, it can be difficult to find out what it’s currently doing. |
5 | | - With livestack.py you can see a point-in-time stack trace of a running process, and have a place to start debugging further.' |
| 4 | + description: If you have a PHP process that has been running for a long while, |
| 5 | + it can be difficult to find out what it’s currently doing. With livestack.py |
| 6 | + you can see a point-in-time stack trace of a running process, and have a place |
| 7 | + to start debugging further. |
6 | 8 | title: How to debug long running PHP processes with livestack on Hypernode? |
7 | 9 | --- |
8 | 10 |
|
@@ -93,7 +95,6 @@ You may not yet know what exactly is causing the problem, but you can start your |
93 | 95 | You may already know how to use livefpm and hypernode-fpm-status to see [what kinds of requests your Hypernode is currently serving](/hypernode-platform/tools/what-kind-of-request-is-my-hypernode-serving.md). |
94 | 96 | You can investigate any long running requests further using livestack.py. |
95 | 97 |
|
96 | | - |
97 | 98 | As `hypernode-fpm-status | grep '/some/url'` would give you current PHP process generating some url, you can also run `livestack.py --fpm '/some/url'` to find the current stack trace of that PHP process. |
98 | 99 |
|
99 | 100 | When using the `--fpm` flag, you are basically grepping through the output of `hypernode-fpm-status`, so you can search for a url, ip or user-agent. |
@@ -134,9 +135,9 @@ Besides the regular GDB commands, two extra PHP specific commands are added by l |
134 | 135 | - `php-print-stack` This is the same as a regular incantation of livestack.py, and prints the stack trace PHP was currently executing. |
135 | 136 |
|
136 | 137 | - `php-frame-info <frame-number>` Using the frame number from `php-print-stack`, get some more information about this function call. |
137 | | -Currently this only shows the contents of "simple" function arguments. |
138 | | -As internally this uses json_encode, object arguments are not supported. |
139 | | -However, you can see the sql insert command or the bindings of the `Magento\Framework\DB\Adapter\Pdo\Mysql::query` function for example. |
| 138 | + Currently this only shows the contents of "simple" function arguments. |
| 139 | + As internally this uses json_encode, object arguments are not supported. |
| 140 | + However, you can see the sql insert command or the bindings of the `Magento\Framework\DB\Adapter\Pdo\Mysql::query` function for example. |
140 | 141 |
|
141 | 142 | Using interactive mode requires a bit more GDB knowledge, and ideally knowledge of the PHP/Zend C code internals. |
142 | 143 | One interesting command to get started may be the `bt full` command, which shows you a stack trace of the PHP internals. |
|
0 commit comments