Skip to content

Commit 07d90df

Browse files
author
haier
committed
fixed tomcat startup slow cause
'SessionIdGeneratorBase.createSecureRandom'
1 parent 07d6eb9 commit 07d90df

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/lcy/tinympi4j/slave/AppSlave.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import jodd.http.HttpRequest;
2121
import jodd.util.ClassLoaderUtil;
22+
import jodd.util.SystemUtil;
2223
import lcy.tinympi4j.common.SplitableTask;
2324

2425
public class AppSlave {
@@ -32,6 +33,11 @@ public static void main(String[] args) throws ServletException, LifecycleExcepti
3233
return;
3334
}
3435

36+
//fixed slow SessionIdGeneratorBase.createSecureRandom
37+
if(SystemUtil.isHostLinux())
38+
System.setProperty("java.security.egd", "file:/dev/./urandom");
39+
40+
3541
final Tomcat tomcat = new Tomcat();
3642
tomcat.setPort(Integer.valueOf(args[0]));
3743
tomcat.setBaseDir(System.getProperty("java.io.tmpdir"));

0 commit comments

Comments
 (0)