Page MenuHomePhabricator

Turn on Redis, Functional locks
Closed, ResolvedPublic1 Estimated Story Points

Description

We have 2 things that would be helpful to us to turn on that we just haven't done. Initially the reason was code freeze for Redis but that is over. The actual work involved in this change is around 10 minutes but logging a phab so we can track when we make the change & can keep an eye on queues / grafana for a bit immediately afterwards

They are

Redis - from our testing this gives around 10-15% UI page load performance improvement (no impact on queues)
Functional locks - this will reduce deadlocks a little - although probably more so if we start to make code changes to take advantage of it - the define is

define('CIVICRM_SUPPORT_MULTIPLE_LOCKS', TRUE);

https://github.com/civicrm/civicrm-core/pull/13854

Event Timeline

@DStrine Can we prioritise this - it's about 20 minutes work + being aware of it at the team level & having a plan to revert if anything weird happens. Would be nice to get it done now as it should help with performance at UI level & reduce deadlocks (or at least give us a way to reduce them in our own scripts)

XenoRyet set the point value for this task to 1.Jul 1 2019, 8:05 PM

I've made the following change on frpm - ready to deploy.....

+++ b/civicrm/sites/default/civicrm.settings.php
 
+// mysql support for 5.7 locks - this is not yet the default
+// but should become the default once we can support successful prod testing.
+// https://github.com/civicrm/civicrm-core/pull/13854
+// note to use this we need to make more use of Civi::lockManager()->acquire();
+// in our own queue consumers.
+define('CIVICRM_SUPPORT_MULTIPLE_LOCKS', TRUE);

@Ejegg wanna check the change on frpm before I deploy - am doing the locks only first - that seems very safe - we can talk about when to enable Redis in terms of timing

Just noting that before redis was enabled the highest peak processing in the last 90 days was 13 donations per second - with a few peak over 10 per second. If we see this falling below that we will need to investigate cache-misses. I see a few cases where we might be missing the cache in redis monitor. Reasons for this are generally

  1. treating a cachehit that returns FALSE as a cache miss
  2. going to Redis rather than using a php cache in the first instance

Some related upstream work taking place - https://github.com/civicrm/civicrm-core/pull/14675