thread limit

To see the current thread limint in RHEL

cat /proc/sys/kernel/threads-max

To set thread limit

echo 5000 > /proc/sys/kernel/threads-max

You may also want to have a look at

vi /etc/security/limits.con

elasticsearch hard nproc 3000