So I had this issue for a while, where starting my Play app on one of my Digital Ocean VM was very slow... it used to be stuck after configuring the logs.
I finally had some time to look into it today and managed to reduce the startup time to close to nothing. It was some DNS thing again...
Upon startup, the MongoDB ObjectId apparently uses the local IP address or something and the stack trace clearly indicated that the DNS lookup from Java was slow. After some googling, the culprit was the actual DNS server.
Anyways - long story short, make sure the Google DNS is first in the
You can certainly edit it - you should in fact. The 18.104.22.168 was my first in the list on that box and simply by putting it last, the startup became instant.
cat << EOF >> /etc/resolv.conf nameserver 22.214.171.124 nameserver 126.96.36.199 nameserver 188.8.131.52 EOF
I have no clue why this box was setup differently, but it was.