#53845 closed enhancement (fixed)
Add some more MySQL information to the Debug section in Site Health
Reported by: | zodiac1978 | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Site Health | Keywords: | has-patch needs-docs |
Focuses: | Cc: |
Description
After having some trouble on a big multisite installation I needed to find the bottle neck. Unfortunately the Site Health debug info wasn't helpful in my case.
At the end it was some bad default configuration from the hoster. A limited number of mysql connections was causing the issue.
Therefore I would like to propose adding these three values to the debug info in the database section:
MYSQL Maximum Packet Size
MYSQL Maximum No. Connection
MYSQL Query Cache Size
I found this information via https://github.com/lesterchan/wp-serverinfo (https://wordpress.org/plugins/wp-serverinfo/).
I don't think we need the complete list ("Display MYSQL Information" in the plugin mentioned), but those three values from the overview page seem to be very helpful.
Attachments (2)
Change History (19)
This ticket was mentioned in PR #1533 on WordPress/wordpress-develop by donmhico.
3 years ago
#1
- Keywords has-patch added; needs-patch removed
#2
@
3 years ago
Hello @zodiac1978,
Thanks for the request, I actually had a recent experience where I had trouble finding the cause of an issue where an option is not being updated and after diving deeper, I found out that it's because of a Max Packet size issue. This info would definitely help.
I've created a PR above, feel free to test it out and let me know if you have any feedback.
#4
@
3 years ago
- Keywords needs-refresh added
@donmhico The PR fails in PHP coding standards. Can you please correct it so others can test the PR/Patch?
#5
@
3 years ago
- Keywords needs-refresh removed
@donmhico has added some fixes and now all checks pass.
Thanks for the PR/patch!
#6
@
3 years ago
- Keywords dev-feedback removed
Thanks for the PR! It looks good to me.
Some minor tweaks in 53845.diff:
- I think we should not use
size_format()
here. As previously noted in comment:1:ticket:52471, the purpose of the Site Health Info screen is to provide raw data as reported by PHP or MySQL for debugging purposes, so we'd want to avoid any modifications of the displayed data. This can be reconsidered later in #52471 if necessary. - Pretty much like database server version or client version, I don't think these new values should be marked as "private". That would prevent them from being copied when the "Copy site info to clipboard" button is clicked.
- The labels should use sentence case rather than title case, for consistency with other labels.
- The
::get_mysql_var()
method@return
value should mention the expected result first.
#7
@
3 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 51522:
#9
follow-up:
↓ 12
@
3 years ago
- Keywords needs-patch added; has-patch removed
- Resolution fixed deleted
- Status changed from closed to reopened
Any query_cache_*
variable lookups need to be excluded when the MySQL version is 5.7.20 or higher as the query cache is deprecated. Details: https://github.com/johnbillion/query-monitor/pull/313.
johnbillion commented on PR #1533:
3 years ago
#10
This ticket was mentioned in Slack in #hosting-community by javier. View the logs.
3 years ago
#12
in reply to:
↑ 9
@
3 years ago
Replying to johnbillion:
Any
query_cache_*
variable lookups need to be excluded when the MySQL version is 5.7.20 or higher as the query cache is deprecated. Details: https://github.com/johnbillion/query-monitor/pull/313.
Deprecation does not mean it is not used, or not? This setting is not removed until MySQL 8, so we could add a check for MySQL 8 to show it or not.
The docs (https://dev.mysql.com/doc/refman/5.7/en/query-cache-configuration.html) are also mentioning a second value query_cache_type
. If this is set to 0 or OFF the cache is not used.
So we could just show it for MySQL < 8 and query_cache_type set to ON/1 or 2/DEMAND.
Or we remove this third value completely and just go with max. connections and max. allowed packet size.
#13
@
3 years ago
To keep the data in Site Health small and useful I made a patch for removing the "Query cache size" info. If anyone thinks it should be added, we just need a further patch with a test for MySQL < 8 (or 5.7.20 if we go with the deprecation to prevent warnings in errorlogs) and query_cache_type
set to ON/1 or 2/DEMAND.
#16
follow-up:
↓ 17
@
3 years ago
- Keywords needs-docs added
This ticket may involve some Docs changes as well.
#17
in reply to:
↑ 16
@
3 years ago
Replying to audrasjb:
This ticket may involve some Docs changes as well.
I looked a little bit around and found this documentation page for the site health feature.
But it looks like the whole "database" section is still empty:
https://wordpress.org/support/article/site-health-screen/#database
This PR adds additional DB info in Site Debug.
Trac ticket: https://core.trac.wordpress.org/ticket/53845