bash:fork:retry:Resource temporarily unavailable

问题解决:bash: fork: retry: Resource temporarily unavailable

1.参考其它帖子,limit.conf里进程数文件数等已经设置得很大,但是问题依然存在

2.用脚本不断创建线程发现ps -eLf|wc -l 到达10800就会到达瓶颈然后报错
(参考文章 https://www.tutorialfor.com/questions-314508.htm )

用于复现问题的脚本
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>

void *threadRun(void *arg)
{
    sleep(60 * 3);
}

int main()
{
    int num = 0;
    pthread_t tid;
    while (pthread_create(&tid, NULL, threadRun, NULL) == 0)
        printf("create thread(%llu) %d OK.\n", tid, ++num);

    sleep(60 * 3);

    return 0;
}

gcc -o main main.c -lpthread
./main

3.查看发现系统得任务数最大值


4.修改

5.重新加载系统配置

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值