diff --git a/templates/CRM/common/civicrm.settings.php.template b/templates/CRM/common/civicrm.settings.php.template
index e2993b81bd59..bb575170a44a 100644
--- a/templates/CRM/common/civicrm.settings.php.template
+++ b/templates/CRM/common/civicrm.settings.php.template
@@ -420,6 +420,13 @@ if (!defined('CIVICRM_DB_CACHE_PREFIX')) {
 // define('CIVICRM_GETTEXT_NATIVE', 1);
 // }
 
+/**
+ * Define how many times to retry a transaction when the DB hits a deadlock
+ * (ie. the database is locked by another transaction). This is an
+ * advanced setting intended for high-traffic databases & experienced developers/ admins.
+ */
+define('CIVICRM_DEADLOCK_RETRIES', 3);
+
 /**
  * Configure MySQL to throw more errors when encountering unusual SQL expressions.
  *