Closed kadamwhite closed 1 year ago
@kovshenin has noted that the cavalcade-jobs
group should be non-persistent in Redis, https://github.com/humanmade/Cavalcade/blob/master/inc/namespace.php#L31 so theoretically these set
commands won't make it through to Redis and will only be persisted in-memory. So, this isn't triggering as much cache writing as expected. My question remains, however, why are we querying for and processing all of this information in every request? Why does every request on the frontend need to have Cavalcade data loaded?
Why does every request on the frontend need to have Cavalcade data loaded?
I agree. However, I think this might happen because of altis/aws-analytics that's perhaps trying to make sure the events exist on a front-facing request, rather than wp-admin, plugin activation or another low-frequency request. Cavalcade simply obeys by querying its jobs and making sure the event is scheduled:
😬 @kovshenin Thank you, I had entirely overlooked that entry in the trace. I have opened humanmade/aws-analytics#490 and will move the discussion over there.
My understanding of Cavalcade's architectural model is that it was intended to remove the dependency on page-view-triggered behavior within WP-Cron. However, I'm seeing that a significant percentage of the processing needed to render any page view on an Altis site is spent in Cavalcade-related functions, DB calls, and cache interactions. Why does Cavalcade do so much on every page view?
This is a typical backtrace within the wp-redis
wp_set_cache
function when Cavalcade is firing:In my local, 19
wp_set_cache
requests are triggered on every page load—my mental model of how Cavalcade works may well be flawed, but querying for and then re-setting all of this data on every single request feels inefficient.I have not fully reproduced this in a deployed environment, but can do so if needed.