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. arm Linux 系统调用过程

    系统调用是操作系统提供给用户(应用程序)的一组接口,每个系统调用都有一个对应的系统调用函数来完成相应的工作.用户通过这个接口向操作系统申请服务,如访问硬件,管理进程等等.但是因为用户程序运行在用户空间 ...

  2. shell 脚本中 命令

    终端工具tput和stty是两款终端处理工具tput cols,lines,longname,cpu 100 100 输入密码时,不能让输入的内容显示出来.用stty #!/bin/bash #Fil ...

  3. nginx 环境搭建使用之入门

    1.http://nginx.org/下载最新的nginx 现在最新的版本是nginx-1.9.1   下载.tar.gz包 ,解压. timeless@timeless-HP-Pavilion-g4 ...

  4. 《python学习手册》之一——程序运行

    Python解释器执行Python代码时候,大概经历如下几个阶段:(1) 加载代码文件 (2)翻译成AST (3)生成bytecode(.pyc文件,与编译的python版本有关).可以使用pytho ...

  5. Python Tutorial 学习(八)--Errors and Exceptions

    Python Tutorial 学习(八)--Errors and Exceptions恢复 Errors and Exceptions 错误与异常 此前,我们还没有开始着眼于错误信息.不过如果你是一 ...

  6. python学习笔记(一)元组,序列,字典

    python学习笔记(一)元组,序列,字典

  7. 学习opencv 第六章 习题十三

    用傅里叶变换加速卷积,直接上代码,Mat版是Copy他人的. CvMat版 #include "stdafx.h" #include "cv.h" #inclu ...

  8. 得到某个进程所有线程ID和入口地址

    #include <windows.h> #include <tlhelp32.h> #include "iostream" using namespace ...

  9. iPad和iPhone开发的比较

    一.iPad简介 1.什么是iPad 一款苹果公司于2010年发布的平板电脑 定位介于苹果的智能手机iPhone和笔记本电脑产品之间 跟iPhone一样,搭载的是iOS操作系统 2.iPad的市场情况 ...

  10. 在iOS7中修改状态栏字体的颜色-b

    状态栏的字体为黑色: UIStatusBarStyleDefault 状态栏的字体为白色: UIStatusBarStyleLightContent 一.在 info.plist  中,将 View ...