Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-16012

file.php as a resource hog

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Won't Fix
    • 3.2.3
    • None
    • None
    • None
    • php-fpm 7.2, apache mpm event

    Description

      In case if forum is having a lot of images attached to the post and is condigured in such a way thay these images are displayed inline (or their thumbs), the following happens:
      Every time someone opens the thread with images attached, their browser issues a bunch of simultaneous requests and the webserver has to use php to process them.  Regardless of how the webserver is configured (php as a daemon or php as an embedded apache module), that situation is bad because static content is sourced through dynamic data channel so that webserver cannot provide chunked output and it cannot fully benefit from event mpm either; see https://httpd.apache.org/docs/2.4/mod/event.html

      To illustrate this point we can think about the following two situations: serving a static asset (like a CSS file) versus serving content retrieved from FCGI/CGI or a proxied server. The former is predictable, namely the event MPM has full visibility on the end of the content and it can use events: the worker thread serving the response content can flush the first bytes until EWOULDBLOCK or EAGAIN is returned, delegating the rest to the listener. This one in turn waits for an event on the socket, and delegates the work to flush the rest of the content to the first idle worker thread. Meanwhile in the latter example (FCGI/CGI/proxied content) the MPM can't predict the end of the response and a worker thread has to finish its work before returning the control to the listener. The only alternative is to buffer the response in memory, but it wouldn't be the safest option for the sake of the server's stability and memory footprint.

       

      The solution is to make webserver source the static content as it should: 
      https://www.phpbb.com/community/viewtopic.php?f=64&t=2444336#p15232836
       

      Attachments

        Activity

          People

            CHItA CHItA
            reardenlife reardenlife [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: