Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a storage server running Nexenta (OpenSolaris kernel, Ubuntu userspace) with MySQL on top of a ZFS storage array, using innodb_file_per_table and ulimit -n set to 8K. confirms the file limit and claims there are 169 files.

The following command:

pfiles `fuser -c / 2>/dev/null

indicates one mysqld process having 485 file/device descriptors (and they're almost all for files) so I don't know how reliable the tuning script is, but it is still way less than 8K and this list also finds no other process which is close to it's limit. The global total number of descriptors in use is around 1K.

So what can cause mysqld to be constantly streaming the following errors?

[date] [host] mysqld[pid]: warning: cannot open /etc/hosts.allow: Too many open files
[date] [host] mysqld[pid]: warning: cannot open /etc/hosts.deny: Too many open files

Everything appears to actually be operating fine, but the issue is constantly flooding the admin console and starts right away on a fresh boot (not only reproducible, but always from mysqld and always the hosts files, whose permissions are the default -rw-r--r-- 1 root root). I could, of course, suppress it from the admin console but I'd rather get to the bottom of it and still allow mysqld warnings/errors to reach the admin console.

EDIT: not only is the actual file descriptor well within sane limits, the issue also persists (with immediate appearance) even with the file limit raised to 65535 and always only on hosts.allow/deny.

share|improve this question
Interesting... I ran into a similar problem with MySQL, but with FreeBSD 8.2 on ZFS (which utilizes the OpenSolaris/Illumos code):… – Stefan Lasiewski Mar 4 '13 at 22:19
Do you perform ZFS snapshots on the system and does this correspond with when the "Too many open files" errors begin? – Stefan Lasiewski Mar 4 '13 at 23:14
up vote 1 down vote accepted

Given that Nexenta was OpenSolaris-based at that time, you may be running into this issue. It does seem like file descriptor limits aren't being applied in a consistent manner throughout the system.

Are you actually using hosts.allow/deny in your setup?

What does lsof output look like?

share|improve this answer
Curious. Luckily, none of my systems actually rely on use of hosts.allow/deny. Less luckily, I do not have lsof in Nexenta. – HonoredMule Dec 11 '12 at 22:43
I installed mine via apt. SunOS deore 5.11 NexentaOS_134f i86pc i386 i86pc Solaris and Open Storage Appliance (v3.1.3.5) - dpkg -p nexenta-lsof – ewwhite Dec 11 '12 at 22:50
Is that OpenIndiana-based? I'm still on v3.0.5 and have no available upgrades (expected given the lack of upgrade path from the original Ubuntu/ON-based project). – HonoredMule Dec 11 '12 at 22:57
I changed my apt sources list... It's still OpenSolaris-based. – ewwhite Dec 11 '12 at 23:00
I believe that hosts.allow/deny are used by the libwrap library, which is used by most daemons on the system. So the errors with hosts.allow/deny is not the source of your troubles, but it is yet another symptom. – Stefan Lasiewski Mar 4 '13 at 23:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.