http://www.cnblogs.com/ibook360/archive/2012/05/11/2495405.html

[root@localhost ~]# ab -n  -c  http://192.168.1.26/index.html
This is ApacheBench, Version 2.0.-dev <$Revision: 1.146 $> apache-2.0
Copyright Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright The Apache Software Foundation, http://www.apache.org/ Benchmarking 192.168.1.26 (be patient)
socket: Too many open files ()
解决:
ulimit -n 65535
1.只针对当前会话修改,另外一个相同用户会话还是会1024
2.重起失效 说明:不是解决问题根本源因
永久修改有效:

修改/etc/security/limits.conf

*  soft   nofile   32768
* hard nofile 65536
所有用户都有效 “*" 还可以基于用户修改:
oracle  soft        nproc   2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

示例:

[root@localhost ~]# cat /etc/security/limits.conf
# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#<domain> <type> <item> <value>
#
#Where:
#<domain> can be:
# - an user name
# - a group name, with @group syntax
# - the wildcard *, for default entry
# - the wildcard %, can be also used with %group syntax,
# for maxlogin limit
#
#<type> can have the two values:
# - "soft" for enforcing the soft limits
# - "hard" for enforcing hard limits
#
#<item> can be one of the following:
# - core - limits the core file size (KB)
# - data - max data size (KB)
# - fsize - maximum filesize (KB)
# - memlock - max locked-in-memory address space (KB)
# - nofile - max number of open files
# - rss - max resident set size (KB)
# - stack - max stack size (KB)
# - cpu - max CPU time (MIN)
# - nproc - max number of processes
# - as - address space limit
# - maxlogins - max number of logins for this user
# - maxsyslogins - max number of logins on the system
# - priority - the priority to run user process with
# - locks - max number of file locks the user can hold
# - sigpending - max number of pending signals
# - msgqueue - max memory used by POSIX message queues (bytes)
# - nice - max nice priority allowed to raise to
# - rtprio - max realtime priority
#
#<domain> <type> <item> <value>
# #* soft core
#* hard rss
#@student hard nproc
#@faculty soft nproc
#@faculty hard nproc
#ftp hard nproc
#@student - maxlogins
oracle soft nproc
oracle hard nproc
oracle soft nofile
oracle hard nofile # End of file

“too many open files" ----增大打开的文件数的更多相关文章

  1. (转)linux下进程的进程最大数、最大线程数、进程打开的文件数和ulimit命令修改硬件资源限制

    ulimit命令查看和更改系统限制 ulimit命令详解 ulimit用于shell启动进程所占用的资源,可以用来设置系统的限制 语法格式 ulimit [-acdfHlmnpsStvw] [size ...

  2. Linux下查看某个进程打开的文件数-losf工具常用参数介绍

    Linux下查看某个进程打开的文件数-losf工具常用参数介绍 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 在linux操作系统中,一切皆文件.通过文件不仅仅可以访问常规数据,还 ...

  3. inux下进程的最大线程数、进程最大数、进程打开的文件数

    inux下进程的最大线程数.进程最大数.进程打开的文件数 2008-12-07 23:48 =========================    如下转载自这里. linux 系统中单个进程的最大 ...

  4. linux下进程的最大线程数、进程最大数、进程打开的文件数

    linux下进程的最大线程数.进程最大数.进程打开的文件数   ===========最大线程数============== linux 系统中单个进程的最大线程数有其最大的限制 PTHREAD_TH ...

  5. linux中,查看某个进程打开的文件数?

    需求描述: 今天在处理一个问题的时候,涉及到查看某个进程打开的文件数,在此记录下. 操作过程: 1.通过lsof命令查看某个特定的进程打开的文件数 [root@hadoop3 ~]# lsof -p ...

  6. ARTS-S linux查看进程打开的文件数

    当怀疑进程打开文件没有关闭时,可以反复执行以下命令,查看进程打开的文件数是否会不断增加. ls -l /proc/18707/fd | wc -l 其中18707是进程id

  7. python开发: linux进程打开的文件数

    1 #!/usr/bin/env python 2 #-*- coding:utf-8 -*- 3 4 ''' 统计linux打开的文件数 ''' 5 6 import os 7 import sys ...

  8. 设置nginx进程可打开最大的文件数

    涉及到的nginx配置参数: worker_processes: 表示操作系统启动多少个工作进程在运行,一般这个参数设置成CPU核数的倍数 worker_connections:表示nginx的工作进 ...

  9. linux 下修改最大文件数

    环境为centosV7系列 1.查看进程的打开最大文件数,默认为1024 [root@localhost ~]# ulimit -a core file size (blocks, -c) 0 dat ...

随机推荐

  1. Sql Server 时间格式

    问题引出: Sql Server 里 dateTime 数据类型,会精确到毫秒.如果我们 在插入一条数据的时候,使用 GetDate() 记录 这个记录插入的时间,则会插入当前时间,精确到毫秒.在查询 ...

  2. <input>标签

    一. 上传图片: type="file":上传文件​ accept:选择上传的种类,图片或者是视频(/png只能上传png格式的图片) ​multiple="multip ...

  3. 熄灯问题 --POJ 2811-ACM

    问题描述 盏灯的状态. 列的灯的状态就不改变. 请你写一个程序,确定需要按下哪些按钮,恰好使得所有的灯都熄灭.根据上面的规则,我们知道: 次按下时所产生的结果.因此,每个按钮最多只需要按下一次: (2 ...

  4. Magento 2.0 安装

    环境: 直接升到最新版PHP5.6.x 刚才开MAC OS PHP 5.5  CENTOS PHP 5.5  composer install  依懒包错误.反复安装组件.还是不行.后来决定重新编释最 ...

  5. dictionary(字典)

    dictionary(字典):   字典对象   字典是一种key - value 的数据类型,使用就像我们上学用的字典,通过笔划.字母来查对应页的详细内容. 1.      dic={"n ...

  6. ARM的BIN文件反汇编方法

    最近在调试uboot的代码时,用的新版本的uboot,lowlevel_init函数里是空的,而且在链接文件中也没有发现对lowlevel_init.o的链接.在bl lowlevel_init 之前 ...

  7. iOS · 安装RVM cocoaPods 及问题解决

    一.安装RVM 1.RVM:ruby版本管理器,命令行工具 管理Ruby 开始安装吧~ 对!!就是这样换成taobao ⬇️ $ gem sources -l $ gem sources --remo ...

  8. Mac下搭建php开发环境

    Mac OS X 内置了Apache 和 PHP,这样使用起来非常方便.本文以Mac OS X 10.6.3为例.主要内容包括: 启动Apache 运行PHP 安装MySQL 使用phpMyAdmin ...

  9. 『安全科普』WEB安全之渗透测试流程

    熟悉渗透流程,攻击会像摆积木一样简单! 0x 01:信息收集 收集网站信息对渗透测试非常重要,收集到的信息往往会让你在渗透中获得意外惊喜. 1. 网站结构 可以使用扫描工具扫描目录,主要扫出网站管理员 ...

  10. codeforces C. Devu and Partitioning of the Array

    题意:给你n个数,然后分成k部分,每一个部分的和为偶数的有p个,奇数的有k-p个,如果可以划分,输出其中的一种,不可以输出NO; 思路:先输出k-p-1个奇数,再输出p-1个偶数,剩余的在进行构造.  ...