Diagnosing database issues

Sometimes databases can misbehave and this in turn can affect Drone. Bellow are some common scenarios and their causes.

  • “Optimistic Lock Error” - sometimes this shows up in drone logs, but it is 100% normal, this is a technique used by drone runners, to make sure that a single build only occurs once and on a single runner. It can also occur when cancelling builds through the UI.
  • “postgres or mysql is using lots of connections / 100% CPU” - a thundering herd problem can occur where so much traffic occurs causing the CPU of the DB to hit 100% then the UI becomes un-responsive. This is incredibly rare and you dont need to do anything. However if you want to limit the connections you can use, DRONE_DATABASE_MAX_CONNECTIONS | Drone
  • “other things to check” - check IOPS for your database, check the logs of the db, check the cpu usage and memory usage on your system. finally check the available disk space.