πͺServer Runbook: MariaDB + PHP-FPM Performance Tuningtled
This document summarizes what we diagnosed, what we changed, why it helped, and how to check the same things again later.
1) Initial symptoms
What we saw
2) Root cause
Why
Effect of small InnoDB buffer pool
3) Process priority after diagnosis
First priority
Second priority
Why PHP-FPM was not the first fix
4) PHP-FPM facts we checked
Command
Result pattern
PHP-FPM pool config we found
Important note
5) MariaDB facts we checked
Check DB process memory
Check InnoDB buffer pool size
6) Buffer pool efficiency checks
Command
Before change
After change
7) Slow query we caught in processlist
Why that is expensive
8) MariaDB change we made
File
Content
9) Command used to create/update the tuning file
10) Restart MariaDB
Verify service health
11) Verify new buffer pool size
12) Check server RAM before/after
13) Check MariaDB runtime memory usage
Important note
14) Disk IO check command
What to watch
Before tuning
After tuning
15) Enable and verify slow query log
Check if slow query logging is enabled
16) Fix slow log path if the file does not exist
Create directory and file
Restart MariaDB after that
Verify
17) Test slow query log manually
Read the last entries
Live watch
18) Useful slow-query workflow
What to look for in slow queries
19) Command to inspect active running queries
20) Optional: lower slow-query threshold temporarily
21) Commands used to inspect PHP-FPM settings
Show PHP-FPM worker sizes
Show pool config values
Validate PHP-FPM config after changes
Reload PHP-FPM
Check PHP-FPM service
22) Recommended PHP-FPM tuning for later
Suggested PHP-FPM pool config
Why
23) Suggested PHP-FPM change procedure for later
Backup config
Edit config
Test config
Reload service
24) Revert MariaDB tuning if needed
Option A: remove custom tuning file
Option B: edit and reduce the values
25) Revert PHP-FPM tuning if needed later
26) Health-check command set for future troubleshooting
General memory
Disk IO
MariaDB memory + CPU
PHP-FPM memory
InnoDB buffer pool size
InnoDB read efficiency
Slow query log status
Live slow queries
Active DB queries
MariaDB service status
PHP-FPM service status
27) Summary of what was actually done
We identified
We changed
Result
28) Recommended next actions
29) One-line conclusion
Last updated