Re: [users@httpd] Apache/php: Max number of open files
Have you tried adding a ulimit command to raise the number of open files in the apache start script or systemd service file?
Darryl Baker (he/him/his)
Sr. System Administrator
Distributed Application Platform Services
1800 Sherman Ave.
Suite 6-600 – Box #39
Evanston, IL 60201-3715
On 8/21/18, 1:37 PM, "Jørn" <apache2.user@xxxxxxxxxxxxxxxx> wrote:
I'm struggeling with the maximum number of open files in a php script executed through the
apache web server.
I have done two tests - one from shell and one through the apache web server. Both tests
open as many files as possible in a given folder (named a-00001.dat, a-00002.dat and so
The initial test resulted in 1006 open files through the apache web server, and about 1020
from the shell.
By playing with the /etc/security/limits.conf and /etc/sysctl.conf I managed to increase
the number of files from the shell to about 2000 (then the limit was set to 8190 files
(soft limit was 8192 in /etc/security/limits.conf).
But through the apache web server, it is still only 1006.
The content of /etc/security/limits.conf:
* soft nofile 8192
* hard nofile 16348
apache soft nofile 8192
apache hard nofile 16348
The apache web server was restarted after I changed the /etc/security/limits.conf file.
I executed 'print_r(posix_getrlimit())' in a php script through the apache web server and
got this output:
[soft core] => unlimited
[hard core] => unlimited
[soft data] => unlimited
[hard data] => unlimited
[soft stack] => 8388608
[hard stack] => unlimited
[soft totalmem] => unlimited
[hard totalmem] => unlimited
[soft rss] => unlimited
[hard rss] => unlimited
[soft maxproc] => 62856
[hard maxproc] => 62856
[soft memlock] => 65536
[hard memlock] => 65536
[soft cpu] => unlimited
[hard cpu] => unlimited
[soft filesize] => unlimited
[hard filesize] => unlimited
[soft openfiles] => 1024
[hard openfiles] => 4096
For me it seems like php is setting a limit, or??
I'm using php 7.0.25 and apache 2.4.27
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx