We have a java application hosted on two different Application Servers with 64GB RAM and 32vCPU each. And HaProxy as a Loadbalancer in front.
With this setup in our VPS servers, we cannot reach 100 concurrent users. The application keeps throwing the below error message even if we have enough free memory(Approximately 40GB RAM).
ERROR org.springframework.boot.context.web.ErrorPageFilter - Forwarding to error page from request [/create-new] due to exception [unable to create new native thread]
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method) [na:1.8.0_262]
at java.lang.Thread.start(Thread.java:717) [na:1.8.0_262]
at org.codehaus.groovy.runtime.DefaultGroovyStaticMethods.createThread(DefaultGroovyStaticMethods.java:104) ~[groovy-2.4.5.jar:2.4.5]
at org.codehaus.groovy.runtime.DefaultGroovyStaticMethods.start(DefaultGroovyStaticMethods.java:58) ~[groovy-2.4.5.jar:2.4.5]
at sun.reflect.GeneratedMethodAccessor2752.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_262]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_262]
at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:54) ~[groovy-2.4.5.jar:2.4.5]
at org.codehaus.groovy.runtime.metaclass.NewStaticMetaMethod.invoke(NewStaticMetaMethod.java:53) ~[groovy-2.4.5.jar:2.4.5]
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrapNoCoerce.invoke(StaticMetaMethodSite.java:151) ~[groovy-2.4.5.jar:2.4.5]
RAM
App1 # free -m
total used free shared buff/cache available
Mem: 65536 21480 44056 2 10341 33715
Swap: 0 0 0
However, on AWS with the same configuration and setup, the app can handle more than 200 concurrent users.
We are hopeless, any suggestions will be greatly appreciated!