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. Java学习----对象间的继承

    继承:子类可以使用父类非私有的成员变量和方法 public class Father { public String name; public String bloodType; private in ...

  2. 使用windows live writer 编辑博客日志

    使用Windows Live Writer 编辑日志 一 意义 写博客日志是个需要坚持的好习惯.使用Windows Live Writer,能不受网页自带编辑器限制. Markdown支持.安装mar ...

  3. 测试gcc的优化选项

    一.测试准备及原理 测试代码: static void wait(volatile unsigned long dly) { ; dly--); } int main(void) { unsigned ...

  4. Maya+3dsMax三维建模

    Maya比较擅长动画,在人物和动物的行为活动方面比较擅长 而3ds Max在建筑物地理地图方面比较擅长,多应用于地理 将两者结合起来将会非常有用

  5. 定义任务打印gradle下载的jar包位置

    //定义任务打印gradle下载的jar包位置task showMyCache { configurations.compile.each { println it }}

  6. Unity3d 基础知识学习 工具篇

    Unity3d  层(layer)的学习 @广州小龙 unity中的层是个很有用的东西, 点击层的下拉框,点击Add Layer,可以打开层管理器,我新建了一个层为test 他的id值是8,这个后面会 ...

  7. Git初体验

    http://www.cnblogs.com/yejiurui/archive/2013/07/29/3223153.html

  8. 设计模式之观察者模式(Observer Pattern)

    一.什么是观察者模式? 把现实世界中的报纸与订阅者的关系抽象出来就是观察者模式,一种报纸对应多个订阅者,订阅者可以随时解除订阅,未订阅的读者也可以随时开始订阅.一旦有新报纸发布,所有的订阅者都会收到新 ...

  9. Netty4.0学习笔记系列之三:构建简单的http服务(转)

    http://blog.csdn.net/u013252773/article/details/21254257 本文主要介绍如何通过Netty构建一个简单的http服务. 想要实现的目的是: 1.C ...

  10. LINUX怎么修改IP地址

    1,先搜索了一下,得到以下解释 IP IP地址 Netmark 子网掩码 Gateway 默认网关 HostName 主机名称 DomainName 域名 DNS DNS的IP 2,需要修改的文件常有 ...