Near 100% CPU caused by DM Heartbeat / Check domain propagation before mapping


After suffering a near 100% CPU and near full memory for over an hour on a VPS with a Miltisite and Domain Mapping, it turns out that it's the option "Check domain propagation before mapping" that was causing the issue.

In the access log there where more than ten thousend requests for /wp-admin/admin-ajax.php?action=domainmapping_heartbeat_check&check=xxx (where the xxx appears to be different each time) in and as it turns out all coming from the servers own IP. Each request taking between 20 - 40 seconds before a response is given.

Here's an example from the access log: 22.612 BYPASS [24/Apr/2015:19:56:30 +0200] "GET /wp-admin/admin-ajax.php?action=domainmapping_heartbeat_check&check=5986d28e873fe2bcb806a19a29d76f1ecc240b97 HTTP/1.0" 200 0 "-" "WordPress/4.2;" 22.774 BYPASS [24/Apr/2015:19:56:31 +0200] "GET /wp-admin/admin-ajax.php?action=domainmapping_heartbeat_check&check=95a814f732e431f82f220fcb56ac64d30d5e4312 HTTP/1.0" 200 0 "-" "WordPress/4.2;"
2001:41d0:52:d00::3fa 23.203 BYPASS [24/Apr/2015:19:56:32 +0200] "GET /wp-admin/admin-ajax.php?action=domainmapping_heartbeat_check&check=0f69079515de4c0f2d187745657c76002b9f886c HTTP/1.0" 200 0 "-" "WordPress/4.2;"
2001:41d0:52:d00::3fa 26.256 BYPASS [24/Apr/2015:19:56:34 +0200] "GET /wp-admin/admin-ajax.php?action=domainmapping_heartbeat_check&check=5986d28e873fe2bcb806a19a29d76f1ecc240b97 HTTP/1.0" 200 0 "-" "WordPress/4.2;"

First, I thought because one of the domains in question had just been changed and was waiting for propagation, these request would stop but they did not. Had to switch off the option "Check domain propagation before mapping" which is not easy on a server with 100% CPU (had to try several times to even reach the domain mapping network settings page) to stop the issue. CPU went straight to normal again.

Apparently, the issue started after I switched "Cross-domain autologin" to "No" because it keeps locking site owners out of their admin and preventing them from even seeing their front page. "Verify domain's DNS settings" was off all the time.