Solved

What's the recommended max # of open files in my situation?

Posted on 2004-04-20
5
328 Views
Last Modified: 2013-12-16
I run a very busy web server with 4000+ domains of which about 10% of them are very active. The tech specs:

1. RH 7.1 + Apache 1.3
2. Dual 1 GHz PIII
3. 4 GB ECC RAM
4. Dual 74 GB SCSI

May I know what's the recommended max # of open files (file-max) in MY SITUATION? In addition, should I increase the max # of open inodes (inode-max)? Please point me to the reference you used to formulate your conclusion. Please don't preach about Apache tuning or anything off topic. Thank you.



0
Comment
Question by:topwiz
5 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 10872324
The "recommended max # of open files" is whatever is necessary for your server to operate without encountering application failures as a result of too many open files. If you aren't having problem in that respect now the current number is adequate.

Fiddling with the file-max or inode-max isn't something you do to improve performance. However, gratuitiously increasing those values far above what the server really needs can negatively affect performance by increasing the amount of memory allocated for the data structures to kernel needs.
0
 
LVL 9

Expert Comment

by:Alf666
ID: 10872793
For the inodes part, I suggest using another filesystem like reiserfs in which you don't have to bother about inode limits.
Though you should be carefull. No directory with too many files.
0
 
LVL 15

Accepted Solution

by:
DonConsolio earned 500 total points
ID: 10944804
for our servers i wrote a perl script to periodically check open files and stuff and send reports in case of error.

basically i do this:

...
open PSTAT, '/proc/sys/fs/file-nr' or warn $!;
my ($filealloc,$filenr,$filemax) = split(/\s+/,<PSTAT>);
close PSTAT;
                                                                                               
my $PCTFULL = int($filenr * 100 / $filemax);

...
if PCTFULL reaches 95% i send mail to the admin mailbox and have it increased in the init scripts as soon as possible.

0
 
LVL 22

Expert Comment

by:pjedmond
ID: 11766082
Just a thought, but I suspect that the spec that you have given us will not be the bottleneck. The bottleneck on this setup will mostlinkely be the ethernet connection. This will apply if the majority of files being accessed are over about 5-10K.

The next area that I would expect the bottleneck to be if you upgrade your ethernet card to a 1000/100/10 card would be the SCSI.

Issues here depend on spindle, and hence access/latency timings for the hard drive. Also the RAID array (if used) could vastly increase access speed, especially if you have a fairly high performance setup with a caching RAID array.

Therefore, the first thing that I'd be monitoring would be the ethernet bandwidth usage. If it gets above about 30% of the rated bandwith...i.e. 30Mb for a 100Mb link, then I would start to get concerned. Above that, the number of collisions start to cause problems with service. However, I expect, that the banwith that connects this server to the internet might be more limiting than that?

HTH:)
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 11766116
Now you know where to look for the first singn of any problems:).....use ratios to multiply bandwidth up to 30% of that available, and I'd guess that would match up proportionally to a number of the other factors that you've mentioned monitoring tools for. Use that as the threshold for you to start thinking about taking action:)
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question