Re: Apache/php: Max number of open files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
Northwestern University
1800 Sherman Ave.
Suite 6-600 – Box #39
Evanston, IL  60201-3715
darryl.baker@xxxxxxxxxxxxxxxx
(847) 467-6674
 

On 8/21/18, 1:37 PM, "Jørn" <apache2.user@xxxxxxxxxxxxxxxx> wrote:

    Hello,
    
    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 
    on).
    
    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:
     Array
    (
        [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
     
    
    -- 
    Jørn Dahl-Stamnes
    homepage: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.dahl-2Dstamnes.net_dahls_&d=DwIFaQ&c=yHlS04HhBraes5BQ9ueu5zKhE7rtNXt_d012z2PA6ws&r=tdje61_VHSXp608oLofeaJnnzo2Sr9_Cdcp70bBEtQ8&m=dQjXLII5jTRHXABt8am0T0Sw9EzKDuuzIyWHoWbBA88&s=n3YSaMxt_nkqvBi0MHQ1q2IWJgpKwQ8qsF3-imfC3cA&e=
    
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
    For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
    
    


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux