大网数据广告活动
服务器运维问答

pthread_create failed (EAGAIN) with most software

· 52CE 我爱测

I have a vServer (16GB RAM, 6 vCores) running Ubuntu Server (Linux 4.15.0) with a few docker containers. A few days ago, I deployed a new container, and it would simply refuse to start with weird native crashdumps from docker-com…

问题原文

原帖链接 · Twometer · CC BY-SA 4.0

I have a vServer (16GB RAM, 6 vCores) running Ubuntu Server (Linux 4.15.0) with a few docker containers.

A few days ago, I deployed a new container, and it would simply refuse to start with weird native crashdumps from docker-compose, most including these error message:

fork/exec /usr/bin/containerd-shim-runc-v2: resource temporarily unavailable: unknown
runtime/cgo: pthread_create failed: Resource temporarily unavailable SIGABRT:
failed to create new OS thread (have 5 already; errno=11) runtime: may need to increase max user processes (ulimit -u)

After that, this happened with many previously working containers as well. However, I restarted dockerd and all my containers, and the problem seemed to go away.

Today, I wanted to start up my Minecraft server (Forge modded 1.16 on Java 11 without docker) and the problem is back:

[136,281s][warning][os,thread] Failed to start thread - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.

And the weirdest thing so far, it cannot open the TTY device?:

java.io.IOException: Cannot run program "stty": error=11, Resource temporarily unavailable

After these messages, the SSH session just locked up, and a second terminal showed me that I haven't reached a single limit of ulimit -a, and with Minecraft running I still have 9GB of RAM free. htop shows 90 tasks running. I've been working with Linux servers for years now, never seen errors like these - what could be the cause for this?

I know errors like these have been asked before on SF, but not a single one of the answers changed something for me.

已采纳解答

原帖链接 · Twometer · CC BY-SA 4.0

Finally found the problem: My hoster is limiting the number of threads to 700 in their OpenVZ config.

I can see that in the /proc/user_beancounters. It seems that if numproc goes near 700, these errors occur. Nothing I can do except reduce the number of threads / docker containers.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-08-18)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。