504 timeout at 300 seconds

Discussion in 'Server Operation' started by HitoDev, Jun 22, 2022.

  1. HitoDev

    HitoDev New Member

    Hello

    I wrote a PHP script to inport a CSV file and run SQL updates for each lines.
    With a few lines the script works fine but for a 10000 lines CSV I get systematically a
    Gateway Timeout The gateway did not receive a timely response from the upstream server or application.

    Each time out occurs precisely at 300 seconds (in the browser network console)

    Currently I have the following PHP settings :
    date.timezone = Europe/Paris
    max_execution_time = 7200
    max_input_time = 3000

    memory_limit = 1024M
    post_max_size = 250M
    upload_max_filesize = 250M
    max_input_vars = 16000
    request_terminate_timeout = 0
    session.auto_start = Off
    magic_quotes_gpc = off
    short_open_tag = Off

    On MariaDB when I search for 300 seconds values I get :
    MariaDB [(none)]> show variables where VALUE like '300';
    +------------------------------+-------+
    | Variable_name | Value |
    +------------------------------+-------+
    | aria_pagecache_age_threshold | 300 |
    | delayed_insert_timeout | 300 |
    | innodb_purge_batch_size | 300 |
    | key_cache_age_threshold | 300 |
    +------------------------------+-------+
    4 rows in set (0.003 sec)

    My database is located on a remote server.

    I don't know exactly the value(s) I'd need to change...
    Any idea ?
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Try setting default_socket_timeout to 7200.
     
  3. HitoDev

    HitoDev New Member

    thank you for your reply
    I added default_socket_timeout = 7200 in ISPC website options, no changes., 504 timeout at 5 minutes
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Strange that ten thousand lines of csv takes more than 5 minutes to import. What does the script do?
     
  5. exynenem

    exynenem Member

    Which webserver and php(-fpm) mode do you use?
     

Share This Page