高负载linux调优
调整Linux内核参数:
# vi /etc/sysctl.conf
# tells the Kernel it's ok if services bind to non-existant IP ADDR
# net.ipv4.ip_nonlocal_bind = 1
# defines the size of the kernel queue for accepting new connections, Defaults to 128
net.core.somaxconn = 40000
# Maximum number of remembered connection requests, Defaults to 1024
net.ipv4.tcp_max_syn_backlog = 40000
# Tuning TCP Ports, increase the range to allow for more connections.
# The number of avaliable ports limits the number of simultanious open connections.
net.ipv4.ip_local_port_range = 1024 65535
# Tell kernel to reuse faster the connection in TIME_WAIT
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
# Resetting the File Descriptors, the maximum number of open files allowed per process
fs.file-max = 1000000
使设置生效:
# sysctl -p
调整最大打开文件描述符限制
调整文件描述符限制:
# ulimit -n 1000000
# vi /etc/security/limits.conf
# Setting Shell Limits for File Descriptors
* soft nofile 1000000
* hard nofile 1000000
使用PAM模块限制资源:
# vi /etc/pam.d/login
session required pam_limits.so
高负载linux调优的更多相关文章
- 高负载PHP调优
高负载PHP调优 针对PHP的Linux调优 调整文件描述符限制 # ulimit -n 1000000 # vi /etc/security/limits.conf # Setting Shell ...
- apache高负载性能调优
先阅读apache配置优化建议如下,再对相关参数进行调整,观察服务器状况.Apache配置优化建议:进入/usr/local/apache2/conf/extra 目录下Apache优化,经过上述操作 ...
- 于erlang依赖的linux调优
[皇室]杭州-sunface(61087682) 上午 9:42:02 http://docs.basho.com/riak/latest/ops/tuning/linux/ 这篇文章对于erlang ...
- Linux调优(内存,CPU)
一.相关概念简介 system call:系统调用 time slice:cpu时间片 O(1):Linux系统进程调度器 page frame:分页 RSS:常驻内存集,无法被页面化的数据 MMU: ...
- LINUX调优
一.Linux系统调优及安全设置 系统安装安全最小化原则说明 ◆安装linux系统最小化,即选包最小化,yum安装软件最小化. ◆开机自启动程序服务最小化,即无用的服务不开启. ◆操作命令最小化原则, ...
- MySQL面试必考知识点:揭秘亿级高并发数据库调优与最佳实践法则
做业务,要懂基本的SQL语句: 做性能优化,要懂索引,懂引擎: 做分库分表,要懂主从,懂读写分离... 数据库的使用,是开发人员的基本功,对它掌握越清晰越深入,你能做的事情就越多. 今天我们用10分钟 ...
- [转]10分钟梳理MySQL知识点:揭秘亿级高并发数据库调优与最佳实践法则
转:https://mp.weixin.qq.com/s/RYIiHAHHStIMftQT6lQSgA 做业务,要懂基本的SQL语句: 做性能优化,要懂索引,懂引擎: 做分库分表,要懂主从,懂读写分离 ...
- 线上Redis高并发性能调优实践
项目背景 最近,做一个按优先级和时间先后排队的需求.用 Redis 的 sorted set 做排队队列. 主要使用的 Redis 命令有, zadd, zcount, zscore, zrange ...
- 【转】转 Linux调优方案,sysctl.conf的设置
http://blog.sina.com.cn/s/blog_541086000100skq0.html proc/sys/net/ipv4/下各项的意义 http://blog.chinauni ...
随机推荐
- POJ 2349 Arctic Network(贪心 最小生成树)
题意: 给定n个点, 要求修p-1条路使其连通, 但是现在有s个卫星, 每两个卫星可以免费构成连通(意思是不需要修路了), 问修的路最长距离是多少. 分析: s个卫星可以代替s-1条路, 所以只要求最 ...
- 【C#】【数据结构】006-栈:链栈
C#数据结构:链栈 1.自定义链栈结构: 链栈节点类 using System.Collections; using System.Collections.Generic; using UnityEn ...
- 用cpp写对拍程序
#include <bits/stdc++.h> using namespace std; int main() { while(true) { puts(""); p ...
- [第一波模拟\day1\T2]{分班}(divide.cpp)
[题目描述] 小N,小A,小T又大了一岁了. 现在,他们已经是高二年级的学生了.众所周知,高二的小朋友是要进行文理科分班考试的,这样子的话,三个好朋友说不定就会不分在一个班. 于是三个人决定,都考平均 ...
- SpringMVC的删除功能
Dao层 package net.roseindia.dao; import java.util.Date; import java.util.List; import net.roseindia.m ...
- luogu2234 [HNOI2002]营业额统计
treap水过 #include <iostream> #include <cstdlib> #include <cstdio> using namespace s ...
- bzoj 1432 [ZJOI2009]Function 思想
[bzoj1432][ZJOI2009]Function Description Input 一行两个整数n; k. Output 一行一个整数,表示n 个函数第k 层最少能由多少段组成. Sampl ...
- django学习之- session
session和cookie关系:session依赖于cookie基于cookie做用户验证时,敏感信息不适合放在cookie中原理:cookie定义:保存在用户游览器端的键值对session定义:保 ...
- hdu - 5007 Post Robot (水题)
http://acm.hdu.edu.cn/showproblem.php?pid=5007 #include<iostream> #include<stdio.h> #inc ...
- codeforces 892E(离散化+可撤销并查集)
题意 给出一个n个点m条边的无向联通图(n,m<=5e5),有q(q<=5e5)个询问 每个询问询问一个边集{Ei},回答这些边能否在同一个最小生成树中 分析 要知道一个性质,就是权值不同 ...