0

While running apache-jmeter test on single docker container I am facing below issue.

[489.013s][warning][os,thread] Failed to start thread - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached. Uncaught Exception java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached. See log file for details.

I am not able to generate Load beyond 2k concurrency. Even though in distributed mode on same docker host I am easily achieving 5k users concurrency. It seems single docker container is not fully utilizing CPU and memory available to it.

Below are the configurations:

  • RAM of server - 90GB
  • No of CPU - 16
  • Ulimit of container (ulimit -n) - 1048576
  • Java - open jdk-14
  • JVM arguments - -Xms80G -XMX80G
James Z
  • 12,209
  • 10
  • 24
  • 44
raizen
  • 23
  • 6

1 Answers1

0

unable to create native thread

it means that you cannot create more than 2000 threads on your operating system level, check what ulimit -u and ulimit -T commands produce and if you see something around 2000 there - this is the setting you need to blame.

Also your Heap allocation seems way to high to me for 2000/5000 virtual users, you don't need to allocate all your physical RAM to JVM, you need to tune your JVM.

If the occupancy of the Java heap is too high, garbage collection occurs frequently. If the occupancy is low, garbage collection is infrequent but lasts longer... Try to keep the memory occupancy of the Java heap between 40% and 70% of the Java heap size...

More information:

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Hii @Dmitri T, I tried below tricks suggested by you... 1. I checked ulimit of my operating system, it was 1024. I increased it to 40000. ulimit -t = unlimited 2. I allocate java heapspace in between 40-70% for runs. when I am using single container. I have checked from top command during run my cpu utilisation is not being used properly, it is only using 16-17%. while doing same run in multiple container it is utilising them properly and I am not getting error. I did try allocating '--cpus' as mentioned in link provided by you, but it did not work. – raizen Aug 04 '20 at 05:09