---
title: "系统参数修改"
author: "Fred_Han"
date: "2013-03-12T11:02:09Z"
tags: []
categories: ["操作系统"]
slug: "untitled"
draft: false
lastmod: "2013-03-12T11:02:09Z"
id: 1828014
url: "https://fred-han.iteye.com/blog/1828014"
---

1.打开文件数修改  
\# vi /etc/security/limits.conf(添加如下两行)  
\* soft nofile 102400  
\* hard nofile 102400

查看修改是否生效  
\# ulimit -a

2.tcp连接优化  
\# vi /etc/sysctl.conf(添加或修改如下6行)

    net.ipv4.ip\_local\_port\_range = 1024 65000  
    net.ipv4.ip\_forward = 1  
     
    net.ipv4.tcp\_syncookies = 1  
    net.ipv4.tcp\_tw\_reuse = 1  
    net.ipv4.tcp\_tw\_recycle = 1  
    net.ipv4.tcp\_fin\_timeout = 30

  让内核参数生效  
\# sysctl -p