RHEL 6.2 pthread_create EAGAIN

Latest response

I am using RHEL 6.2 on x64, on a physical box with 32GB RAM and a 2-socket ( 24 logical cores), no virtualisation.

I'm getting EAGAIN from pthread_create from a batch job, when there's no other users (except myself) connected to the box. There's almost no swap used.

I can restrict the number of threads the batch job starts, but it starts only 23 threads I believe.

I'm not a sysadmin - are there any tuneable RHEL 6.2 parameters that I can adjust to reduce the incidence of pthread_create EAGAIN errors?



Hi Mike,
Do you have adequate memory and swap space on the host? (Does 'free' show any low values?) Does the process have adequate system limits associated with it? ('ulimit -a' should show you.) Is the system-wide limit on threads being reached? (Check /proc/sys/kernel/threads-max).

Thanks for your comment.

The box has 32Gigabytes RAM.

It has adequate swap space (64 gigabytes).

During the batch-job I run "free -m" and it shows swap is either 0 or less than 20.

This suggests the limit is not RAM.

The 'free -m' command shows USED is almost all of physical ram and FREE at its lowest during the run is 175.

As previously stated, there are no users (except me) using the box, and I used it only via SSH.

I also checked /var/log/messages and there are no interesting entries during the batch run (only some time-sync stuff).


I ran "ulimit -a" and found that nproc = 1024.

That might be the limiting factor.

I will change /etc/security/limits.conf to add soft+hard limits for nproc for the relevant group-name to see if this helps.