HikariCP warning - Retrograde clock change detected

1,654 views
Skip to first unread message

Jakub Kahovec

unread,
Jun 15, 2017, 2:04:56 AM6/15/17
to Slick / ScalaQuery
Hi,
I'm getting a weird error from slick 3.2 + hikaricp 2.5.1 - occasionaly it logs 
HikariPool$HouseKeeper.run(HikariPool.java:607) - Retrograde clock change detected (housekeeper delta=29s544ms), soft-evicting connections from pool . 
It happens on my local dev machine as well as when it's deployed. 
Any ideas why is this happening ?

Brett Wooldridge

unread,
Jun 23, 2017, 2:17:07 PM6/23/17
to Slick / ScalaQuery
Unexpected retrograde or prograde clock motion is generally caused by:
  • Computers, esp. laptops but also servers, that drop into power-saving modes.
  • Virtual Machines dependent on container host clock synchronization.
In the case of portable computers, there is not much to do because disabling energy saving is generally undesirable.

Servers should generally have power-saving disabled.  However, newer generation CPUs often have multiple and varying levels of power conservation, some of which may be safe.  I say "may" because system timers are often based on CPU clock speeds, which can cause trouble when clock throttling is allowed to occur to conserve power.  Basically, unless you want to become an expert in CPU power states, just disable power-saving on servers.

Finally, repeat after me, "NTP is my friend".  It is absolutely essential in all servers, and particularly virtual machines, to run an NTP daemon (client).  In the case of VMs, you must also ensure that the container host (VMware, XenServer, etc.) is not set to manage the virtual machine clock.  VMware used to default to clock synchronization, I don't know what they does now.  Amazon (AWS) definitely does not externally manage the clock -- they know what they're doing.  In fact, I believe AWS provides free Cesium/Rabidium-based hardware NTP servers (likely, Seiko) accessible within the datacenter and enabled by default in AWS provided AMI images.

In summary:
  • Disable power-saving modes.
  • Enable NTP

- Brett Wooldridge (author of HikariCP)

Reply all
Reply to author
Forward
0 new messages