Increase file descriptors in CentOS
To increase the amount of files descriptors in CentOS follow this tutorial. We hope this is useful, for some reason it is difficult to find a complete guide for this on the web. This guide will work in most versions of CentOS and Fedora
In this guide we will be raising the open file descriptor limit from 1024 to 65535.
Edit the following file:
1 |
/etc/sysctl.conf |
You will need to add the following line to the bottom of this file:
1 |
fs.file-max = 512000 |
Save and exit the file.
At the prompt type the following:
1 |
sysctl -p |
This will implement the settings.
Now we will edit the following file:
1 |
/etc/security/limits.conf |
Add the following line to the bottom of the file:
1 |
* - nofile 65535 |
Save and exit.
Type the following command.
Do this as root. This is to be sure that there are no errors:
1 |
ulimit -n 65535 |
Double check by typing ‘ulimit -n’. If the response is ‘65535’ everything is good and you are all set.
List all IP addresses available on a linux server
This article deals with Linux based systems.
While working with a server with many IP addresses you may need to list all of the IP addresses on the server. Most commands may give you more information than you may need. To get a list of only the IP addresses use the following command:
1 |
ifconfig | awk -F "[: ]+" '/inet addr:/ { if ($4 != "127.0.0.1") print $4 }' |
The IP address available on the server will be displayed in a list like this:
192.168.1.2
192.168.1.3
192.168.1.4
192.168.1.5
192.168.1.6
192.168.1.7
192.168.1.8
192.168.1.9
192.168.1.10
etc…
I have found that this makes it easier to cut and paste into a text file and then later add the IPs to a database.