« first day (3996 days earlier)      last day (948 days later) » 

8:11 AM
Been working quite a lot with queries lately. Stumbled upon this one. Try typing one letter in the search box. How can they make the search results so instant? Surely they are fetching it server side (via a DB query) rather than client side.
Looks like they are using algolia.
Algolia actually looks really promising. Anyone tried them out?
And wow, it takes account for misspelling.
 
 
1 hour later…
9:49 AM
@TomJNowell I thought that cron has a lock to make sure it does not run twice which can happen on even a single server, although it does sound like a good idea to reduce possible race conditions even further.
As for admin, not convinced about that because at least I feel that the definition of what is admin is a little too fluid.
 
 
6 hours later…
3:34 PM
@MarkKaplun you're assuming option writing and reading is atomic
just because it tries to use a lock
does not mean it's foolproof
and in practice it regularly isn't
A fetches lock value
B fetches lock value
A acquires lock
B acquires lock
database sees lock option already has that value so it's a non-operation
A and B both proceed with job
 
 
2 hours later…
5:06 PM
sure @TomJNowell but how is it different from several requests running cron from different apache threads at the same time. The core problem is that the lock is not atomic which admitedly it is easier to solve when cron runs on a specific server (but core do not do it for some reason)
 
 
3 hours later…
8:05 PM
@MarkKaplun it's much more likely with multiple machines since a single machine will probably have the database on the same server, and object caches mean locking can happen on the same machine
whereas with multiple machines there's the added latency of a network connection
overall it makes more sense to manage cron jobs using a dedicated machine/VPS or a service
especially if there aren't many users who need WP Admin, you can get a cheaper smaller machine spec and still make things super fast for users
even give the frontend read only access and use read only database servers replicating the main database server
it's particularly notable if you set it up so that pages can be served from multiple data centres
 
 
4 hours later…
11:53 PM
IIRC godaddy uses a separate DB server. but not providing a locking on a local machine running cron and hoping that it will just be ok with the help of some plugin is a core bug. I assume that it is more likely you will get into problem with multiple servers as it is an indication of having more traffic. but anyway, I assume you will also use the OS cron as well on the "cron server" which is actually what will eliminate the race condition
As for admin, I just can't imagine how it happens in practice. Isn't all wp-json request are basically admin, and those requests can come from the frontend especially when you try to do an headless WP
 

« first day (3996 days earlier)      last day (948 days later) »