Why does Tomcat's first servlet request take so long?

Alex Chaffee

Sounds like it is the SecureRandom class initializing. Please disable this (set the value in server.xml to "java.util.Random") and see if it helps.

However, be warned that this method leaves your sessions open to attack. It would take a dedicated hacker, but if you're storing any sensitive data, this is a big no-no. So put it back to SecureRandom when you're done testing this.

See also Currently, Tomcat uses the "java.security.Sec...