cat /proc/sys/fs/file-max 系统可打开的最大文件个数

ulimit -n 当前系统限制的个数

ulimit -n 10240 调整当前系统的限制

修改/etc/sysctl.conf, 加入

net.ipv4.ip_local_port_range = 1024 65000
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max=16777216
net.core.wmem_max=16777216
net.ipv4.tcp_rmem=4096 87380 16777216
net.ipv4.tcp_wmem=4096 65536 16777216
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_sack = 1
net.core.netdev_max_backlog = 262144
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_keepalive_time= 30
net.ipv4.tcp_max_tw_buckets= 6000
net.core.somaxconn = 65535
fs.file-max = 1024000

 
vim /etc/security/limits.conf 进行设置
修改/etc/security/limits.conf  ,在最下方添加
* soft nofile 65536
* hard nofile 65536
重启
 
sysctl -p 无需重启 立刻使生效
 
apache 支持监听8180个端口 默认的。 不知道增加还得肿么搞。
 
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'

netstat -antup | wc -l
netstat -antup | grep 'TIME_WAIT' | wc -l
netstat -antup | grep 'SYN_RECV' | wc -l

UBUNTU 下 APACHE2 Too many open files: Error retrieving pid file /var/run/apache2.pid的更多相关文章

  1. nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory)

    nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory) ...

  2. nginx启动或者重启失败,报错nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory)

    第一种方案: 1. 执行命令 :open /usr/local/etc/nginx 打开nginx安装目录 nginx安装目录默认位置有:(找到适合你的) /etc/nginx/nginx.conf, ...

  3. nginx报错 [error] open() “/usr/local/var/run/openresty.pid” failed (2: No such file or directory)

    解决: 服务没有启动 使用start启动服务,因为没有start而直接使用stop或者reload报错这个问题: 如果方法一没有解决,使用方法二:-C 指定配置文件nginx.conf或者weblua ...

  4. centos6.6下编译安装mysql5.6之后启动失败:Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).

    今天在编译安装mysql5.6时候出现Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysq ...

  5. linux下mysql启动 Starting MySQL. ERROR! The server quit without updating PID file(xxx/x.pid)

    service mysql start 报错: Starting MySQL. ERROR! The server quit without updating PID file(xxx/x.pid) ...

  6. mysqld_safe error: log-error set to '/data/log/mysqld.log', however file don't exists. Create writable for user 'mysql'.The server quit without updating PID file (/data/mysql/mysqld.pid)

    [oot@cent65 bin]# service mysqld startStarting MySQL.2019-10-28T15:56:47.786960Z mysqld_safe error: ...

  7. mysql修改后启动my.cnf报错Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).

    mysql中文乱码解决 mysql修改my.cnf后启动报错Starting MySQL... ERROR! The server quit without updating PID file (/v ...

  8. nginx重启报错:nginx: [error] invalid PID number "" in "/run/nginx.pid"

    问题描述:执行 nginx -t 是OK的,然而在执行 nginx -s reload 的时候报错 nginx: [error] invalid PID number “” in “/run/ngin ...

  9. nginx: [error] invalid PID number "" in "/run/nginx.pid"

    在重启云主机(系统)之后,执行 nginx -t 是OK的,然而在执行 nginx -s reload 的时候报错 nginx: [error] invalid PID number “” in “/ ...

随机推荐

  1. ( KMP 求循环节的个数)Power Strings -- poj -- 2406

    链接: http://poj.org/problem?id=2406 Power Strings Time Limit:3000MS     Memory Limit:65536KB     64bi ...

  2. poj3321-Apple Tree(DFS序+树状数组)

    Apple Tree Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 36442   Accepted: 10894 Desc ...

  3. 日志记录的作用和方法 java

    程序中记录日志一般有两个目的:Troubleshooting和显示程序运行状态.好的日志记录方式可以提供我们足够多定位问题的依据.日志记录大家都会认为简单,但如何通过日志可以高效定位问题并不是简单的事 ...

  4. (原创)Hibernate persistentSet的remove()方法不起作用

    情景再现:hibernate 多对多  User对象(员工).Educate对象(培训课程),我想干的事情是想把第三方表格user_educate中的员工_培训课程中的一行信息删掉(删掉员工所选的一门 ...

  5. web api 多版本控制重要的两个类

    1.版本路径替换 public class ReplaceVersionWithExactValueInPath : IDocumentFilter     {         public void ...

  6. [ucgui] 仪表盘函数

    /* 仪表盘 */ void DrawArcScale(void) { ; ; int i; ]; GUI_SetBkColor(GUI_WHITE); GUI_Clear(); GUI_SetPen ...

  7. 微软DevOps软件开发高级培训课程(深圳站) 2016.04.06

    深圳特区云集了国内众多大型IT企业,作为北上广深的一线城市,当之无愧! 我们在深圳同方信息港的微软办公室是举行培训,60人的培训教室,生生被挤满了80人,过道都被全部占用了.可惜由于换了电脑,把照片搞 ...

  8. Kafka send问题

    kafka 在send之后不会立即把消息发送到broker.会把消息发到producer所在电脑内存里,后端的IOThread会扫描内存,并从中取出消息进行消费. 在调用close()或者flush( ...

  9. 微信退款证书使用c#

    微信退款需要证书 data为已封装好的xml数据 具体怎么封装>打开 public string get(string data) { string cert = @"D:\certi ...

  10. iis 中https修改主机名方法

    来源地址:  https://www.pianyissl.com/support/page/29