#56040 closed enhancement (fixed)
Port Persistent Object Cache Health Check from performance plugin to core
Reported by: | furi3r | Owned by: | furi3r |
---|---|---|---|
Milestone: | 6.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Site Health | Keywords: | has-patch has-unit-tests has-dev-note |
Focuses: | performance | Cc: |
Description
As part of the performance module life cycle, we want to port this site health check to the core.
โhttps://github.com/WordPress/performance/tree/trunk/modules/object-cache/persistent-object-cache-health-check
Change History (37)
#2
@
2 years ago
Performance issue GH link: โhttps://github.com/WordPress/performance/issues/391
This ticket was mentioned in โPR #2890 on โWordPress/wordpress-develop by โmanuelRod.
2 years ago
#3
- Keywords has-patch has-unit-tests added
Adding Persistent Object cache check to Site Health.
Trac ticket: #56040
#4
@
2 years ago
- Keywords changes-requested added
I and thanks for the PR! I reported a few Docblock issues to fix before it's ready to ship. Thanks :)
โmanuelRod commented on โPR #2890:
2 years ago
#5
Thanks for the nitpicks @audrasjb, I've fixed them.
โmanuelRod commented on โPR #2890:
2 years ago
#6
I think this one is ready to be merged.
cc: @felixarntz
โmanuelRod commented on โPR #2890:
2 years ago
#7
@tillkruss @Clorith I've implemented the changes.
- Removed badge color for different statuses.
- Added ignore comment for interpolation/CS.
- Do we agree that the tests stay direct instead of async? the query is light and fast.
- Do we agree on the extra filters to allow more flexibility to hosting companies?
Thanks!
#8
@
2 years ago
- Keywords changes-requested removed
- Milestone changed from Awaiting Review to 6.1
- Owner set to furi3r
- Status changed from new to assigned
โmanuelRod commented on โPR #2890:
2 years ago
#9
I think this is good to go now! cc: @Clorith @tillkruss @felixarntz
โtillkruss commented on โPR #2890:
2 years ago
#10
LGTM
โfelixarntz commented on โPR #2890:
2 years ago
#11
@Clorith Can you please give this another review this week or early next week? It now has 3 approvals, from my perspective it's ready to commit.
โfelixarntz commented on โPR #2890:
2 years ago
#13
@manuelRod Committed in https://core.trac.wordpress.org/changeset/53955 ๐
#14
@
2 years ago
- Keywords needs-dev-note added
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening this to write a dev note eventually. It probably makes sense to write a single combined dev note for this together with #56041, which is likely to be committed this week as well.
@furi3r Is that something you would be interested in working on? Definitely happy to support/review as needed. The primary purpose of the dev note is to explain the feature to developers, specifically focusing on the customization points (e.g. explaining the filters, with brief code examples etc.).
#15
@
2 years ago
@flixos90 thanks for the commit! Yes, I will try to get a draft before I'm going on holiday next week.
#16
@
2 years ago
@flixos90 one thing I've just realized, the committed code is linking to โhttps://wordpress.org/support/article/optimization/#object-caching
While I can see that anchor has been updated to โhttps://wordpress.org/support/article/optimization/#persistent-object-cache
It needs to be updated.
#17
@
2 years ago
Great catch @furi3r, I will prepare a follow-up commit to fix the link. Thank you!
#19
@
2 years ago
The test added in [53955] appears to occasionally fail:
Could there be a race condition somewhere?
This ticket was mentioned in โSlack in #core by flixos90. โView the logs.
2 years ago
This ticket was mentioned in โSlack in #core by sergey. โView the logs.
2 years ago
This ticket was mentioned in โSlack in #core by flixos90. โView the logs.
2 years ago
This ticket was mentioned in โSlack in #core by clorith. โView the logs.
2 years ago
#27
@
2 years ago
@SergeyBiryukov With the additional commits above, the occasional test problems here should be addressed now. Please flag here if you notice additional failures. Thank you!
#28
@
2 years ago
- Resolution set to fixed
- Status changed from reopened to closed
It looks like everything is wrapped up on this with the exception of the dev note. Let's close this out with beta 1 today. The dev note can be tracked with needs-dev-note
on closed tickets.
#29
@
2 years ago
- Keywords add-to-field-guide added
There is a draft of a dev note available โhere.
#30
follow-up:
โย 31
@
2 years ago
- Keywords add-to-field-guide removed
@spacedmonkey Thanks for drafting that! I had a rough outline written down, but had not written it out. I'll take a look in the next few days!
#31
in reply to:
โย 30
@
2 years ago
Replying to desrosj:
@spacedmonkey Thanks for drafting that! I had a rough outline written down, but had not written it out. I'll take a look in the next few days!
For the record, @furi3r did all the hard work and @flixos90 did the review. As far as I understand it is basically good to publish.
#33
@
2 years ago
- Type changed from enhancement to defect (bug)
As a WordPress host, there's nothing "healthy" about this new recommendation.
Even the memecached documentation agrees with me:
"If you have a database host, give as much ram as possible to the database. When cache misses do happen, you'll get more benefit from ensuring your indexes and data are already in memory."
โhttps://github.com/memcached/memcached/wiki/Hardware
Read the memcached documentation, and use common sense. In most cases, it makes a more sense to allocate "extra" memory to other areas: Innodb, database connections, more php-fpm children, etc. I've been hosting WordPress for almost 20 years, that's how you do it.
More caching is rarely the solution, you're just asking for trouble.
To spin up an additional memcached server that will eat up all free memory, that is a recipe for disaster, as the memcached documentation itself warns about.
"Will take as much memory as you give it."
Sounds like a good way to end up with an unstable system. Oh wait, that's not a bug, it's a feature LOL.
"Assign physical memory, with a few percent extra, to a memcached server. Do not over-allocate memory and expect swap to save you. Performance will be very, very poor. Take extra care to monitor if your server is using swap, and tune if necessary." โhttps://github.com/memcached/memcached/wiki/Hardware
And you're actually recommending we use this? Do you really expect hosts to have a separate memcached server, with special swap and network requirements, just for memcached? Who is going to pay for and administer that?
And will this make blogs faster? No, because adding more software and unnecessary network traffic never makes things faster or more reliable. Even the memcached documentation warns about it:
"Network requirements will vary greatly by the average size of your memcached items. Your application should aim to keep them small, as it can mean the difference between being fine with gigabit inter-switch uplinks, or being completely toast."
Yeah, that's a "healthy" recommendation. Sarcasm off.
On top of that, the recommended plugins look to be almost experimental.
Do you think I am going to configure and manage TWO databases (Redis + MySQL) to satisfy this little nag message? I already spent years of my life getting MySQL to work well. There is no way I am going to reinvent the wheel (as if WordPress hosting is not complicated enough) to add Redis into the mix, when MySQL has all kinds of caches that work perfectly fine.
If people have slow WordPress performance, it's NOT because they lack an object cache.
I am really sick of all the silly "health" recommendations that are shoved in the face of my clients on the dashboard. I can't help but wonder if there are any conflicts of interest here. Who really benefits from an object cache? Not the blogger. Not the host. Who then?
Show me any proof memory is better allocated to an object cache and not the database or php-fpm. And even if you can prove it on a poorly configured system, we're talking about a few milliseconds.
#34
@
2 years ago
- Severity changed from normal to trivial
Who do I invoice every time I add the following line to a new blog:
<?php add_filter( 'site_status_should_suggest_persistent_object_cache', '__return_false' );
#35
follow-up:
โย 37
@
2 years ago
- Type changed from defect (bug) to enhancement
Good points. Cache isn't for ground speed. With a large database indexes and data can not stay in memory. With high traffic, it saves database queries. So it's about what Health Check tests before recommending, I havn't studied yet. But I have seen a lot of small and low traffic sites getting this recommendation, I think it's a bad approach and needs discussion. But
This ticket was closed on a completed milestone.
If you have a bug or enhancement to report, please open a new ticket. Be sure to mention this ticket, #56040.
#37
in reply to:
โย 35
@
2 years ago
I don't see this as a software problem that can be solved with a ticket, as much as it is a vision/perspective problem. WordPress is popular today because it was easy to install and because PHP was universally supported by the thousands of hosting companies out there. More or less that is still true today.
If this change is allowed to continue, you're essentially changing the installation requirements to include Redis (because apparently nobody is using the memcache plugin.) Adding a whole new database as a requirement for WordPress is not a small thing. It is difficult enough maintaining MySQL/MariaDB. Small example, a new version of MySQL came out recently that required upgrading all WordPress databases to a new format. โhttps://pjbrunet.com/upgrade-from-10-7-4-to-10-8-3-crashes-mysql-mariadb/
As a WordPress host, I have many pages of notes that keep growing over the years, and that includes tons of MySQL documentation, which involves memory management, caching, monitoring, swapping, backups, etc. It's not easy. I'm not looking to make everything more complicated than necessary by adding Redis, unless there is a very good reason. And it's not just me. Working for a billion-dollar startup, I saw firsthand that MySQL is a huge painpoint for other companies, even companies using 3rd party services like Pantheon.
In a perfect world, WordPress would not need a database and would manage its own data, but I have sacrificed a significant portion of my life to learn to use and maintain MySQL/MariaDB, and to keep it running however I can, which is frankly why I had to learn Linux in the first place.
I disagree that large blogs "can not stay in memory." If that is happening, the hosting company is overselling its hardware. For example, a blog with 30,000 posts will easily fit into small amount of InnoDB memory without swapping. It's just text. Even in extreme cases, when I had a blog with millions of posts in MySQL, the entire database fit into a few gigabytes of ram.
I hear what you're saying, I think. But IMO you don't want bloggers nagging their sysadmin to install Redis. That is not a small request, and the benefit is not really there. In most cases it will create worse problems.
I think I agree with you this kind of recommendation only makes sense in certain scenarios, like organizations with unlimited budgets. (Or "This nag is sponsored by Google Cloud, yay more technology to buy!") But I don't think traffic has anything to do with it. Doesn't the "Query Monitor" plugin already monitor database performance?
If somebody is actually struggling with a slow database, I'd assume their host is "overselling" the hardware, or is at the wrong data center, or has a lot to learn about the basics: php-fpm, mysql, hosting, linux, virtualization, etc.
Replying to knutsp:
Good points. Cache isn't for ground speed. With a large database indexes and data can not stay in memory. With high traffic, it saves database queries. So it's about what Health Check tests before recommending, I havn't studied yet. But I have seen a lot of small and low traffic sites getting this recommendation, I think it's a bad approach and needs discussion. But
This ticket was closed on a completed milestone.
If you have a bug or enhancement to report, please open a new ticket. Be sure to mention this ticket, #56040.
#56041 was marked as a duplicate.