LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux:: SSH not working after increasing Open Files / File Descriptors (FD) (https://www.linuxquestions.org/questions/linux-newbie-8/linux-ssh-not-working-after-increasing-open-files-file-descriptors-fd-4175562356/)

it.is.ismail@gmail.com 12-25-2015 04:09 PM

Linux:: SSH not working after increasing Open Files / File Descriptors (FD)
 
Hi

I am not able to ssh my ec2 instance [linux based] after I have executed following command.[Before that I am able to ssh to server]

# vim /etc/sysctl.conf
I have update file-max number to 4000000
fs.file-max = 4000000

Then I exit my ec2 insatnce & try to ssh again but of no luck.

I have tried ssh with -v option & what I get is only [debug1: Exit status 254].
Note: This is the only change I have made.

jpollard 12-25-2015 05:11 PM

How much memory does the system have?

It takes memory allocate space for 4,000,000 possible files.

My 8GB system only allocates 815,155 possible files. You very possibly overloaded the system and it can't allocate memory for the process to to be able to open the necessary files.

You really shouldn't need to change the value.

reference: http://stackoverflow.com/questions/6...g-to-my-own-se
Quote:

By the way, the modern kernel already uses a rule of thumb to set file-max based on the amount of memory in the system; from fs/file_table.c in the 2.6 kernel:

/*
* One file with associated inode and dcache is very roughly 1K.
* Per default don't use more than 10 of our memory for files.
*/

n = (mempages * (PAGE_SIZE / 1024)) / 10;
files_stat.max_files = max_t(unsigned long, n, NR_FILE);

and files_stat.max_files is the setting of fs.file-max; this ends up being about 100 for every 1MB of ram.
From that estimate, 4,000,000 files would need about 40GB just for the file table (4,000,000/100 =40,000 MB). I would expect the system is hung.

If you can boot into single user mode you should be able to remove/comment out those lines you put in /etc/sysctl.conf to recover.


All times are GMT -5. The time now is 06:45 AM.