DenRaf's Blog

  • Contact

Contact
View Raf Nijskens's profile on LinkedIn
OpenSource
Linux
Powered by Drupal, an open source content management system
Get Firefox
Fosdem
Visit Inuits Technical home

Locations of visitors to this page

Tags in TagCloud

6 acer ADP1 Android apache automaticmenu caching cats Centos closed source cron Debian dell Dell R200 deploy Dream driver drupal drupalcron eclair edit faceted_search fedora flat jscalendar Fosdem funambol G1 imagefield_gallery litejazz menu_tree module multiple domains mysql node_page O2Micro old openfire OSD otrs password trigger password_trigger plutado Ports presentation recover response header rpm svn sync syncml tagadelic ubuntu user filter user_import wordpress wordpress 2.3 wp2drupal xmlsitemap zabbix zimbra
more tags
Home » Blogs » DenRaf's blog

Too many open files

Submitted by DenRaf on Thu, 02/26/2009 - 19:02
  • [View]

Has anyone a clue on this one ?

sudo cat /proc/sys/fs/file-max
1048576

sudo cat /etc/security/limits.conf
* soft nofile 1048576
* hard nofile 1048576

sudo cat /etc/sysctl.conf
fs.file-max=1048576

ulimit -n
1048576

But yet when my service starts at boot:

sudo cat /proc/pid/limits | grep files
Max open files 1024 1024 files

Whenever I restart my service everything is ok:
sudo cat /proc/pid/limits | grep files
Max open files 1048576 1048576 files

This is running on a Debian Etch with kernel 2.6.28

  • DenRaf's blog
  • Add new comment
Tags:
  • SysAdmin
  • Debian

4 reponses to "Too many open files"

1. is it not part of your profile?

Submitted by ghosty (not verified) on Tue, 03/03/2009 - 00:40.

in rhel 5 i noticed they also have an entry like that in /etc/profile or ~/.profile or the likes (should have a look at work in my documentation which exactly overrides it ...) to fix this i just commented that line and problem solved!
Not sure if it's also the case in debian, but anyway tweaking the amount of open files to such a high amount suggests you are doing strange stuff (it is not recommended!)

  • reply

2. No profile files. I know it's

Submitted by DenRaf on Tue, 03/03/2009 - 08:46.

No profile files.

I know it's a high value, but we are doing strange stuff and it was requested by the customer.

I have temporarily fixed it by calling ulimit in the init script and that works fine.

  • reply

3. Second attempt

Submitted by M. Gy. (not verified) on Thu, 03/26/2009 - 16:47.

O.K., I've read the thread again and seen that half of my previous reply is unnecessary. However, that /etc/initscript may be the key.

  • reply

4. Two types of max. number of file descriptors

Submitted by M. Gy. (not verified) on Thu, 03/26/2009 - 16:28.

Hi,

To be able to have 100 000 files open systemwide is not so strange...

There are two types of limit of the max. number of file descriptors: system-wide and login shell-wide. The system-wide can be checked this way:
cat /proc/sys/fs/file-max
The default value is 205290 on many distros.

The other limit is per user and per login shell and is set in /etc/security/limits.conf in CentOS and openSUSE. The default value for that is 1024. This means when you log in and run 'ulimit -n' from your shell it shows 1024. There is a way to set it higher:

/etc/iniscript:
ulimit -n 4096
eval exec "$4"

/etc/security/limits.conf
* soft nofile 1024
* hard nofile 1024
root soft nofile 4096
root hard nofile 8192
user1 soft nofile 4096
user1 hard nofile 8192

Here is a reference:
http://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic...

and another one:
http://confluence.atlassian.com/display/CONF26/Fix+%27Too+many+open+file...

HTH

  • reply

Guided search

Click a term to initiate a search.

Categories

  • drupal (26)
  • Linux (6)
  • SysAdmin (6)
  • Uncategorized (5)
  • Linux-tools (3)

Date authored

  • 2010 (5)
  • 2009 (10)
  • 2008 (27)
  • 2007 (11)

TagCloud

  • drupal (26)
  • Ports (7)
  • cron (6)
  • drupalcron (6)
  • 6 (3)
  • OSD (3)
  • zimbra (3)
  • cats (2)
  • Fosdem (2)
  • funambol (2)
  • more...

Recent blog posts

  • OSD2010: Day 2
  • OSD2010: Day 1
  • OSD2010: Pre notes
  • Howto: Android 2.1 on G1/ADP1/Dream
  • Updated look
  • Zimbra monitoring with zabbix
  • New module: Node Page Template
  • AutomaticMenu module for drupal 6
  • Drupal synchronisation
  • Imagefield_gallery module for drupal 6
more

Recent comments

  • Thanks for the nice blog. It
    50 weeks 6 hours ago
  • I prefer this updated
    50 weeks 4 days ago
  • Agreed.
    1 year 14 weeks ago
  • Working on this
    1 year 16 weeks ago
  • Thanx for tutorial. IT'S
    1 year 17 weeks ago
  • Amon Ra recovery tool
    1 year 20 weeks ago
  • Please help me
    1 year 25 weeks ago
  • This is so dumb
    1 year 26 weeks ago
  • I've installed it on my
    1 year 29 weeks ago
  • I am also having the same
    1 year 30 weeks ago

Syndicate

Syndicate content
I love Smashing Magazine!
Fervens Drupal theme by Leow Kah Thong. Designed by Design Disease and brought to you by Smashing Magazine.