Speeding up Play application startup Subscribe Pub

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 /etc/resolv.conf file:

You can certainly edit it - you should in fact. The was my first in the list on that box and simply by putting it last, the startup became instant.

cat << EOF >> /etc/resolv.conf

I have no clue why this box was setup differently, but it was.

Was this useful?    

By: Razie | 2014-10-29 .. 2016-05-16 | Tags: post , scala , play , programming , devops

See more in: Cool Scala Subscribe

Viewed 1418 times ( | Print ) this page.

You need to log in to post a comment!