Re: Enabling Apache HTTP/2 => Too many open files error

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

 



Do a lsof -p <pid-of-an-httpd-processw> and it will list out the files.

It may be a file handle leak.

I have seen leaks from failure to close a file when a process is done.
There can be leaks if a process uses an anonymous memory allocation
trick that relies on file handles, and there are probably others.

The lsof output will give you an idea if it is a leak (usually it will
be the same files being opened again and again without closing).

If it is a leak and the rate is high enough you may not be able to set
the open files high enough for it to work for long.

On Mon, Feb 27, 2023 at 6:45 AM Richard W.M. Jones <rjones@xxxxxxxxxx> wrote:
>
> I fixed this now, but I could find virtually no documentation about it
> online, so I'm writing this email to document what surely must be a
> common problem ...
>
> I wanted to enable HTTP/2 support in Apache on Fedora 38.
>
> I followed the documentation here which worked [although it's way more
> complicated than it needs to be, why isn't HTTP/2 the default out of
> the box?]
>
>   https://httpd.apache.org/docs/2.4/howto/http2.html
>
> Anyway the problem I had was that the server worked fine provided
> there were not too many clients (and by "too many" I mean a simple
> load test with 4-16 clients failed).  Apache randomly threw 403
> Forbidden errors, but with less load it gave a normal (2xx) response.
>
> The first problem is the error is misleading:
>
>   [Wed Feb 22 13:24:52.013780 2023] [core:error] [pid 3047850:tid 3047899] (24)Too many open files: [remote 192.168.0.139:53738] AH00132: file permissions deny server access: /var/www/html/[filename]
>
> If you concentrate on the second part "file permissions deny server
> access" -- as I did -- then you'll be looking at file permissions,
> SELinux, restorecon, ausearch etc.  That's a red herring, there is no
> permissions problem.
>
> The real error is the first part "Too many open files".
>
> It turns out that the default open file limit (1024!) is too low.  To
> change this and fix the problem:
>
>   # systemctl edit httpd
>
> This creates an "override" file to which you should add (or you could
> just create this file directly):
>
>   # cat /etc/systemd/system/httpd.service.d/override.conf
>   [Service]
>   LimitNOFILE=65536
>
> and then restart Apache for the change to take effect.
>
> Why on earth Apache needs > 1024 open files to serve a dozen clients
> is not clear at all.
>
> Rich.
>
> --
> Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
> Read my programming and virtualization blog: http://rwmj.wordpress.com
> virt-top is 'top' for virtual machines.  Tiny program with many
> powerful monitoring features, net stats, disk stats, logging, etc.
> http://people.redhat.com/~rjones/virt-top
> _______________________________________________
> users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
> Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
> Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux