Solving TeamCity slow start

Last Updated On

I have Droplet on DigitalOcean 2GB / 2 CPUs. Sometimes I need to reboot my server and I realized that it may take a while to start TeamCity (starting time may vary from 10 minutes to 30 minutes). That’s too slow.

I finally found the root of the problem and solution.

The Problem

During startup, teamcity needs access to /dev/random as a RNG and the default /dev/random does not hold enough entropy to fulfill that need. This blocks the startup process, until enough entropy has been gathered again.

This is a quote from StackOverflow.

There is also a ticket for that in YouTrack: TW-41035.

The solution

As you can find from the problem, we basically need to install haveged. Fortunately, it is in official Ubuntu repository.

To install, we need to go to the terminal and run:

sudo apt-get update
sudo apt-get install haveged

That’s it. You may need to restart your server.

Additional info can be found on DigitalOcean.