You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -18,29 +19,29 @@ Long running processes can indicate that the the site might benefit from an inde
18
19
19
20
To identify long running SQL processes you can use the tool `Mytop`. `Mytop` displays the running mysql processes in real time. To identify a long running SQL process with `Mytop`, you can run the following command to inspect the duration of your SQL processes:
20
21
21
-
```nginx
22
+
```bash
22
23
mytop
23
24
```
24
25
25
26
The output will look like something like this:
26
27
27
28
Alternatively you can request the processlist from MySQL yourself by using the commands:
28
29
29
-
```nginx
30
+
```bash
30
31
mysql -Be 'SHOW FULL PROCESSLIST;'
31
32
```
32
33
33
34
The outcome will look like this (screenshot includes the commands that been used):*To make your life easier, we created an alias myprocs to watch the processlist while devving. In some cases using this alias instead of `mytop` will provide more accurate information.*
34
35
35
36
Once you’ve identified the long running process(es) you can kill them with the command `kill` and it’s ID number. The example below shows how we kill the longest running query:
36
37
37
-
```nginx
38
+
```bash
38
39
kill 47630
39
40
```
40
41
41
42
If that doesn’t work, there is a more aggressive method of killing using the `-9` flag. This instructs the kernel to kill the process without running any cleanup handling and instantly stops a process:
42
43
43
-
```nginx
44
+
```bash
44
45
kill -9 47630
45
46
```
46
47
@@ -52,7 +53,7 @@ And the outcome will be:
52
53
53
54
To identify a long running PHP process you can run the following command to inspect the duration of your FPM processes in real time:
54
55
55
-
```nginx
56
+
```bash
56
57
livefpm
57
58
```
58
59
@@ -69,7 +70,7 @@ By typing several ID numbers after the kill command you can kill multiple long r
69
70
70
71
To find long running shell processes you can use this command:
0 commit comments