Technical professionals. Trusted advisors. Certified expertise.

HCS Blog

Problem-solving by Apple Certified Professionals

Maximum Number of Open Files Error on OS X

I viewed the system log files and saw the following error message every two minutes:

Nov 11 11:27:34 hcstest smbd[416]: in openpam_read_chain(): /etc/pam.d/other: Too many open files
Nov 11 11:27:34 hcstest smbd[416]: in openpam_read_chain(): /etc/pam.conf: Too many open files


I ran the “ulimit -a” command to see what the default open file size and Max user processes size were.  They were 256 and 709 which is very low.

ulimit -a 

core file size          (blocks, -c) 0  
data seg size           (kbytes, -d) unlimited  
file size               (blocks, -f) unlimited  
max locked memory       (kbytes, -l) unlimited  
max memory size         (kbytes, -m) unlimited  
open files                      (-n) 256  
pipe size            (512 bytes, -p) 1  
stack size              (kbytes, -s) 8192  
cpu time               (seconds, -t) unlimited  
max user processes              (-u) 709  
virtual memory          (kbytes, -v) unlimited  

I created two plist files that will change the default open file size and max user processes size limits to 524288 and 2048 and and put them in the following location:

/Library/LaunchDaemons/limit.maxfiles.plist

/Library/LaunchDaemons/limit.maxproc.plist

After a reboot, a re ran the ulimit -a command and the changes were now in effect.  I monitored the system log and these errors are now gone.

Nov 11 11:27:34 hcstest smbd[416]: in openpam_read_chain(): /etc/pam.d/other: Too many open files
Nov 11 11:27:34 hcstest smbd[416]: in openpam_read_chain(): /etc/pam.conf: Too many open files




ulimit -a  

core file size          (blocks, -c) 0  
data seg size           (kbytes, -d) unlimited  
file size               (blocks, -f) unlimited  
max locked memory       (kbytes, -l) unlimited  
max memory size         (kbytes, -m) unlimited  
open files                      (-n) 524288  
pipe size            (512 bytes, -p) 1  
stack size              (kbytes, -s) 8192  
cpu time               (seconds, -t) unlimited  
max user processes              (-u) 2048  
virtual memory          (kbytes, -v) unlimited
×
Stay Informed

When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.

Apple Pay and the new 2016 MacBook Pro
Disable Auto Boot for MacBook Pro (Late 2016)

Locations


New York

Connecticut
Florida
Louisiana
Chicago

Corporate Headquarters
New York

80 Orville Drive Suite 100
Bohemia, NY 11716
Tel: (866) 518-9672
This email address is being protected from spambots. You need JavaScript enabled to view it.

Connecticut

65 High Ridge Road #510
Stamford, CT 06905
Tel: (866) 518-9672
This email address is being protected from spambots. You need JavaScript enabled to view it.

Florida

3321 SW 194th Terrace
Miramar, FL 33029
Tel: (866) 518-9672
This email address is being protected from spambots. You need JavaScript enabled to view it.

Louisiana

218 Barksdale Drive
Broussard LA 70518
This email address is being protected from spambots. You need JavaScript enabled to view it.

Chicago

4 Knollwood Place
Joliet, IL 60433
This email address is being protected from spambots. You need JavaScript enabled to view it.

London

10 Grosvenor Court
Rayners Road
London SW15 2AX UK

Stay Connected

© Copyright 2023, HCS Technology Group. All Rights Reserved.