PHP FastCGI vs PHP-FPM & NextCloud

Discussion in 'Installation/Configuration' started by FSNTiger, Oct 13, 2021 at 1:04 AM.

  1. FSNTiger

    FSNTiger Member

    When I choose PHP-FPM running NextCloud on my ISPConfig install, I keep running into 504 Gateway errors. I have found in other posts that I need to increase the timeout, so I increased the timeout in php.ini options but no change. Running PHP FastCGI I don't have the timeout issue.

    I made the change to PHP-FPM since I was under the impression that it took less memory and ran a little faster. If that's not the case, I am fine with keeping FastCGI. But if it reduces the load or allows my sites to run better, then I would like to keep PHP-FPM.

    Is there a place I can adjust to fix this gateway timeout since the php.ini settings I tried did not resolve the problem? Or did I miss adding some other setting in the php.ini?

    PHP settings:
    max_execution_time=3600
    max_input_time=3600
    memory_limit=512M
     
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    That sounds like the web server timing out reading from php-fpm, not the php daemon timing out waiting for script output. For apache the are tunable settings (for mod_fcgid iirc), and probably similar settings for nginx I'd guess.
     
  3. FSNTiger

    FSNTiger Member

    Ok, so new options in the apache section? Server is running apache. Can you give me an idea of what settings I should be looking for?
     
  4. Steini86

    Steini86 Active Member

    Can also be a configuration error for php-fpm (like installation missing?).
    Do you get any entries in your error.log file?
     
  5. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    From a quick look at the documentation, it is most likely FcgidIOTimeout, though you can look over other options as well. @Steini86 has a good point, you should verify that a simple phpinfo() page works under php-fpm.
     
  6. FSNTiger

    FSNTiger Member

    It only 504's during long-running operations. Normal pages load ok. And if I wait and then refresh the page, the long-running job is complete. So it still ran in the background.
     
  7. FSNTiger

    FSNTiger Member

    My server already has that value configured:

    #Expand Upload Memory
    FcgidMaxRequestLen 268435456

    #Adjust Server
    FcgidIdleTimeout 60
    FcgidProcessLifeTime 120
    FcgidMaxRequestsPerProcess 500
    FcgidMaxProcesses 150
    FcgidMaxProcessesPerClass 144
    FcgidMinProcessesPerClass 0
    FcgidConnectTimeout 30
    FcgidIOTimeout 600
    FcgidIdleScanInterval 10
    FcgidMaxRequestLen 269484032
    FcgidBusyTimeout 3600
    FcgidProcessLifeTime 3600
    FcgidOutputBufferSize 0
     
  8. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Yes, so if you're hitting that limit, increase the value.
     
  9. FSNTiger

    FSNTiger Member

    But 600 seconds or even 30 seconds are not going by. It dies in 10-15 seconds after the long process (like a backup) starts.

    And would these settings not affect the FastCGI side as well? Since that side works without a hitch, that does not sound right.
     

Share This Page