nginx服务器出现如下信息:

[crit] 17221#0: accept4() failed (24: Too many open files)
[crit] 17221#0: accept4() failed (24: Too many open files)
[crit] 17221#0: accept4() failed (24: Too many open files)
[crit] 17221#0: accept4() failed (24: Too many open files)
[crit] 17221#0: accept4() failed (24: Too many open files)
原回是nginx进程打开文件数过多
 

解决方法:

修改/etc/security/limits.conf文件
* soft nofile 10240
* hard nofile 10240

星号代表全局,soft为软件,hard为硬件,nofile为这里指可打开文件数。

root soft nofile 10240
root hard nofile 10240
nobody soft nofile 10240
nobody hard nofile 10240
修改nginx.conf,添加如下代码:
worker_rlimit_nofile 10240;

重启nginx服务器。

nginx accept() failed (24: Too many open files)的更多相关文章

  1. Nginx Parsing HTTP Package、header/post/files/args Sourcecode Analysis

    catalog . Nginx源码结构 . HTTP Request Header解析流程 . HTTP Request Body解析流程 1. Nginx源码结构 . core:Nginx的核心源代 ...

  2. PHP+mysql系统报错:PHP message: PHP Warning: Unknown: Failed to write session data (files)

    PHP+mysql系统报错:PHP message: PHP Warning:  Unknown: Failed to write session data (files) 故障现象,后台页面点击没有 ...

  3. centos7 ngxin启动失败:Job for nginx.service failed(80端口被占用的解决办法)

    问题描述:(flaskApi) [root@67 flaskDemo]# service nginx start Redirecting to /bin/systemctl start nginx.s ...

  4. Python错误提示:[Errno 24] Too many open files的分析与解决

    背景 最近在工作中发现了一个错误,在执行多线程扫描脚本的时候频繁出现下面这个错误 HTTPConnectionPool(host=‘t.tips', port=80): Max retries exc ...

  5. Socket accept failed

    启动tomcat显示如下错误: java.net.SocketException: select failed at java.net.PlainSocketImpl.socketAccept(Nat ...

  6. Nginx 报错: nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory) 的解决方法

    今天测试域名访问不了,登陆 Linux(Ubuntu)重启Nginx: nginx -s reload 结果报错: nginx: [error] open() : No such file or di ...

  7. python socket.error: [Errno 24] Too many open files

    以openwrt AR9331开发板为例,socket连接到1019个就报错 “python socket.error: [Errno 24] Too many open files” 1.查看开发板 ...

  8. [ISSUE] [Centos] Centos Start Nginx Show: Failed to start nginx.service:unit not found

    CMD Line:systemctl start nginx.serviceFailed to start nginx.service: Unit not found. Solution: 1.vim ...

  9. nginx ../logs/nginx.pid" failed (2: No such file or directory)

    [1]nginx.pid相关 (1)可能出现两种场景: 1.1 nginx.pid文件不存在 发生现象:nginx: [error] open() "/usr/local/lib/ubcsr ...

随机推荐

  1. 不重启修改'log_slave_updates'变量

    Variable 'log_slave_updates' is a read only variable 不重启修改mysql变量 执行复制的时候遇到的问题 mysql> show variab ...

  2. Spring MVC 原生API

    原生API: Servlet环境中一些有用的对象: HttpServletRequest HttpServletResponse HttpSession Reader Writer InputStre ...

  3. C# DbHelperSQL 类,从东软生成器提取而来

    DBHelerSQL,可以结合东软生成器写简单三层结构,也可以自己去调用执行相关SQL语句 直接上代码: using System; using System.Collections; using S ...

  4. tomcat启动原理

    2018年04月12日 19:55:22 太极小帅帅 阅读数:282   前言 一直在用Tomcat,但是对其启动原理一直没去研究,这里准备去面试,可能会问道.于是总结了下启动原理.完全凭感觉去揣测, ...

  5. linux下创建django-app

    Django 1.创建一个项目linux :django-admin startproject helloword 创建项目helloword2.开始一个工程 manage.py 文件 它是djang ...

  6. uva-10160-枚举

    若当前搜索到的城市n前面1-n-1编号的城市中有没有通电的,则永远也无法输送电力给那个城市,因为在剪枝时附加了和此结点连接的最大结点小于当前的结点 这段 for(int i = 1; i < c ...

  7. PHP设计模式:类自动载入、PSR-0规范、链式操作、11种面向对象设计模式实现和使用、OOP的基本原则和自动加载配置

    一.类自动载入 SPL函数 (standard php librarys) 类自动载入,尽管 __autoload() 函数也能自动加载类和接口,但更建议使用 spl_autoload_registe ...

  8. sts安装出现could not find jar:file解决办法

    转自:https://blog.csdn.net/weixin_43702329/article/details/84823912 标题sts插件下载好但是安装出错 我的eclipse是4.5.2,在 ...

  9. 突破MSDE 的2GB数据限制

    Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\ ...

  10. Spring声明式事务不回滚问题

    疑问,确实像往常一样在service上添加了注解 @Transactional,为什么查询数据库时还是发现有数据不一致的情况,想想肯定是事务没起作用,出现异常的时候数据没有回滚.于是就对相关代码进行了 ...