Non-Joomla script fails with 504 Gateway Timeout

Discussion regarding Joomla! 3.x Performance issues.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
User avatar
ktwatson
Joomla! Intern
Joomla! Intern
Posts: 78
Joined: Wed Jun 30, 2010 5:08 am

Non-Joomla script fails with 504 Gateway Timeout

Post by ktwatson » Wed Oct 06, 2021 4:43 pm

I have been working with my hosting company to try to resolve a 504 Gateway timeout when running a non-Joomla php script. The script loads users (10,000+) into the users sql table and sets user permissions in the usergroup_map sql table. The script will run when a character is "printed" for each insertion into the sql tables (NO timeout occurs).

The script began to fail when the hosting company upgraded our dedicated server. MySQL and PHP are set for 1800 seconds. These settings have not eliminated the timeout in the subdomain where the script runs. The FPA for the subdomain is included below.

Question: is there a Joomla! configuration setting that limits the time there is no interaction with the browser? If there is, can this setting be changed?

Forum Post Assistant (v1.6.3) : 6-Oct-2021 wrote:
Last PHP Error(s) Reported :: wrote:[06-Oct-2021 16:19:47 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/cssdar/public_html/members/libraries/cegcore2/gcloader.php on line 63
Basic Environment :: wrote:Joomla! Instance :: Joomla! 3.9.28-Stable (Amani) 6-July-2021
Joomla! Platform :: Joomla Platform 13.1.0-Stable (Curiosity) 24-Apr-2013
Joomla! Configured :: Yes | Writable (644) |
Configuration Options :: Offline: false | SEF: true | SEF Suffix: false | SEF ReWrite: false | .htaccess/web.config: Yes | GZip: false | Cache: false | CacheTime: 15 | CacheHandler: file | CachePlatformPrefix: false | FTP Layer: false | Proxy: false | LiveSite: | Session lifetime: 15 | Session handler: database | Shared sessions: false | SSL: 2 | Error Reporting: default | Site Debug: false | Language Debug: false | Default Access: 1 | Unicode Slugs: false | dbConnection Type: mysqli | PHP Supports J! 3.9.28: Yes | Database Supports J! 3.9.28: Yes | Database Credentials Present: Yes |

Host Configuration :: OS: Linux | OS Version: 3.10.0-1160.31.1.el7.x86_64 | Technology: x86_64 | Web Server: Apache | Encoding: gzip, deflate, br | System TMP Writable: Yes | Free Disk Space : 1542.15 GiB |

PHP Configuration :: Version: 7.4.24 | PHP API: cgi-fcgi | Session Path Writable: Yes | Display Errors: | Error Reporting: 32759 | Log Errors To: error_log | Last Known Error: 06th October 2021 16:19:47. | Register Globals: | Magic Quotes: | Safe Mode: | Allow url fopen: | Open Base: | Uploads: 1 | Max. Upload Size: 1G | Max. POST Size: 1G | Max. Input Time: 1800 | Max. Execution Time: 1800 | Memory Limit: 8G

Database Configuration :: Version: 5.7.35 (Client:mysqlnd 7.4.24) | Database Size: 15.52 MiB | #of Tables with config prefix:  108 | #of other Tables:  0 | User Privileges : GRANT ALL
Detailed Environment :: wrote:PHP Extensions :: Core (7.4.24) | date (7.4.24) | libxml (7.4.24) | openssl (7.4.24) | pcre (7.4.24) | zlib (7.4.24) | filter (7.4.24) | hash (7.4.24) | pcntl (7.4.24) | readline (7.4.24) | Reflection (7.4.24) | SPL (7.4.24) | session (7.4.24) | standard (7.4.24) | cgi-fcgi (7.4.24) | bcmath (7.4.24) | calendar (7.4.24) | ctype (7.4.24) | curl (7.4.24) | dom (20031129) | ftp (7.4.24) | gd (7.4.24) | iconv (7.4.24) | imap (7.4.24) | json (7.4.24) | mbstring (7.4.24) | mysqlnd (mysqlnd 7.4.24) | PDO (7.4.24) | Phar (7.4.24) | posix (7.4.24) | SimpleXML (7.4.24) | sockets (7.4.24) | sqlite3 (7.4.24) | tokenizer (7.4.24) | xml (7.4.24) | xmlwriter (7.4.24) | xsl (7.4.24) | zip (1.15.6) | mysqli (7.4.24) | pdo_mysql (7.4.24) | pdo_sqlite (7.4.24) | xmlreader (7.4.24) | Zend Engine (3.4.0) |
Potential Missing Extensions ::

Switch User Environment :: PHP CGI: Yes | Server SU: Yes | PHP SU: Yes | Potential Ownership Issues: No
Folder Permissions :: wrote:Core Folders :: images/ (755) | components/ (755) | modules/ (755) | plugins/ (755) | language/ (755) | templates/ (755) | cache/ (755) | logs/ (755) | tmp/ (755) | administrator/components/ (755) | administrator/modules/ (755) | administrator/language/ (755) | administrator/templates/ (755) | administrator/logs/ (---) |

Elevated Permissions (First 10) ::
Database Information :: wrote:Database statistics :: Uptime: 443578 | Threads: 1 | Questions: 8737722 | Slow queries: 0 | Opens: 1316607 | Flush tables: 1 | Open tables: 2000 | Queries per second avg: 19.698 |
Extensions Discovered :: wrote:Components :: Site ::
Core :: com_mailto (3.0.0) 1 | com_wrapper (3.0.0) 1 |
3rd Party::

Components :: Admin ::
Core :: com_languages (3.0.0) 1 | com_redirect (3.0.0) 1 | com_cache (3.0.0) 1 | com_messages (3.0.0) 1 | com_actionlogs (3.9.0) 1 | com_menus (3.0.0) 1 | com_categories (3.0.0) 1 | com_login (3.0.0) 1 | com_installer (3.0.0) 1 | com_templates (3.0.0) 1 | com_newsfeeds (3.0.0) 1 | com_contenthistory (3.2.0) 1 | com_plugins (3.0.0) 1 | com_privacy (3.9.0) 1 | com_content (3.0.0) 1 | com_joomlaupdate (3.6.2) 1 | com_fields (3.7.0) 1 | com_modules (3.0.0) 1 | com_admin (3.0.0) 1 | com_ajax (3.2.0) 1 | com_checkin (3.0.0) 1 | com_banners (3.0.0) 1 | com_tags (3.1.0) 1 | com_users (3.0.0) 1 | com_finder (3.0.0) 1 | com_search (3.0.0) 1 | com_config (3.0.0) 1 | com_cpanel (3.0.0) 1 | com_weblinks (3.7.0) 1 | com_postinstall (3.2.0) 1 | com_associations (3.7.0) 1 | com_media (3.0.0) 1 |
3rd Party:: ChronoForms6 (6.1.4) 1 | com_chronoforms5 (5.0.0) 1 | Akeeba (8.0.6) 1 | Admintools (3.8.6) 1 |

Modules :: Site ::
Core :: mod_login (3.0.0) 1 | mod_breadcrumbs (3.0.0) 1 | mod_articles_latest (3.0.0) 1 | mod_menu (3.0.0) 1 | mod_tags_popular (3.1.0) 1 | mod_search (3.0.0) 1 | mod_feed (3.0.0) 1 | mod_articles_category (3.0.0) 1 | mod_stats (3.0.0) 1 | mod_related_items (3.0.0) 1 | mod_footer (3.0.0) 1 | mod_articles_news (3.0.0) 1 | mod_banners (3.0.0) 1 | mod_finder (3.0.0) 1 | mod_random_image (3.0.0) 1 | mod_weblinks (3.7.0) 1 | mod_whosonline (3.0.0) 1 | mod_custom (3.0.0) 1 | mod_articles_popular (3.0.0) 1 | mod_users_latest (3.0.0) 1 | mod_tags_similar (3.1.0) 1 | mod_wrapper (3.0.0) 1 | mod_syndicate (3.0.0) 1 | mod_articles_archive (3.0.0) 1 | mod_articles_categories (3.0.0) 1 | mod_languages (3.5.0) 1 |
3rd Party:: BT Login (2.6.1) 1 |

Modules :: Admin ::
Core :: mod_quickicon (3.0.0) 1 | mod_status (3.0.0) 1 | mod_login (3.0.0) 1 | mod_menu (3.0.0) 1 | mod_feed (3.0.0) 1 | mod_toolbar (3.0.0) 1 | mod_version (3.0.0) 1 | mod_stats_admin (3.0.0) 1 | mod_latest (3.0.0) 1 | mod_sampledata (3.8.0) 1 | mod_title (3.0.0) 1 | mod_multilangstatus (3.0.0) 1 | mod_submenu (3.0.0) 1 | mod_custom (3.0.0) 1 | mod_popular (3.0.0) 1 | mod_privacy_dashboard (3.9.0) 1 | mod_latestactions (3.9.0) 1 | mod_logged (3.0.0) 1 |
3rd Party::

Libraries ::
Core ::
3rd Party:: file_fof30 (3.6.2) ? | file_fof40 (4.0.5) ? | CEGCore2 (2.0.12) 1 |

Plugins ::
Core :: plg_system_fields (3.7.0) 1 | plg_system_sessiongc (3.8.6) 1 | plg_system_updatenotification (3.5.0) 1 | plg_system_logrotation (3.9.0) 1 | plg_system_languagefilter (3.0.0) 0 | plg_system_remember (3.0.0) 1 | plg_system_p3p (3.0.0) 1 | plg_system_debug (3.0.0) 1 | plg_system_redirect (3.0.0) 1 | plg_system_logout (3.0.0) 1 | plg_system_weblinks (3.7.0) 0 | PLG_SYSTEM_ACTIONLOGS (3.9.0) 0 | plg_system_languagecode (3.0.0) 0 | plg_system_log (3.0.0) 1 | plg_system_cache (3.0.0) 0 | plg_system_sef (3.0.0) 1 | plg_system_privacyconsent (3.9.0) 0 | plg_system_stats (3.5.0) 0 | plg_system_highlight (3.0.0) 1 | plg_fields_media (3.7.0) 1 | plg_fields_usergrouplist (3.7.0) 1 | plg_fields_calendar (3.7.0) 1 | plg_fields_sql (3.7.0) 1 | plg_fields_color (3.7.0) 1 | plg_fields_list (3.7.0) 1 | plg_fields_radio (3.7.0) 1 | plg_fields_repeatable (3.9.0) 1 | plg_fields_editor (3.7.0) 1 | plg_fields_textarea (3.7.0) 1 | plg_fields_imagelist (3.7.0) 1 | plg_fields_integer (3.7.0) 1 | plg_fields_checkboxes (3.7.0) 1 | plg_fields_url (3.7.0) 1 | plg_fields_user (3.7.0) 1 | plg_fields_text (3.7.0) 1 | plg_captcha_recaptcha_invisible (3.8) 0 | plg_captcha_recaptcha (3.4.0) 1 | plg_search_newsfeeds (3.0.0) 1 | plg_search_contacts (3.0.0) 1 | plg_search_weblinks (3.7.0) 1 | plg_search_categories (3.0.0) 1 | plg_search_content (3.0.0) 1 | plg_search_tags (3.0.0) 0 | plg_twofactorauth_totp (3.2.0) 0 | plg_twofactorauth_yubikey (3.2.0) 0 | plg_privacy_message (3.9.0) 1 | plg_privacy_actionlogs (3.9.0) 1 | plg_privacy_content (3.9.0) 1 | plg_privacy_consents (3.9.0) 1 | plg_privacy_user (3.9.0) 1 | plg_finder_newsfeeds (3.0.0) 1 | plg_finder_contacts (3.0.0) 1 | plg_finder_weblinks (3.7.0) 1 | plg_finder_categories (3.0.0) 1 | plg_finder_content (3.0.0) 1 | plg_finder_tags (3.0.0) 1 | plg_installer_webinstaller (2.1.2) 1 | PLG_INSTALLER_FOLDERINSTALLER (3.6.0) 1 | PLG_INSTALLER_URLINSTALLER (3.6.0) 1 | plg_installer_packageinstaller (3.6.0) 1 | plg_authentication_ldap (3.0.0) 0 | plg_authentication_gmail (3.0.0) 0 | plg_authentication_cookie (3.0.0) 1 | plg_authentication_joomla (3.0.0) 1 | plg_extension_joomla (3.0.0) 1 | plg_content_fields (3.7.0) 1 | plg_content_geshi (2.5.0) 0 | plg_content_confirmconsent (3.9.0) 0 | plg_content_loadmodule (3.0.0) 1 | plg_content_pagebreak (3.0.0) 1 | plg_content_emailcloak (3.0.0) 0 | plg_content_finder (3.0.0) 0 | plg_content_vote (3.0.0) 1 | plg_content_pagenavigation (3.0.0) 1 | plg_content_joomla (3.0.0) 1 | plg_editors-xtd_module (3.5.0) 1 | plg_editors-xtd_fields (3.7.0) 1 | plg_editors-xtd_image (3.0.0) 1 | plg_editors-xtd_pagebreak (3.0.0) 1 | plg_editors-xtd_readmore (3.0.0) 1 | plg_editors-xtd_weblink (3.7.0) 0 | plg_editors-xtd_menu (3.7.0) 1 | plg_editors-xtd_article (3.0.0) 1 | plg_quickicon_phpversioncheck (3.7.0) 1 | plg_quickicon_privacycheck (3.9.0) 1 | plg_quickicon_extensionupdate (3.0.0) 1 | plg_quickicon_joomlaupdate (3.0.0) 1 | PLG_ACTIONLOG_JOOMLA (3.9.0) 1 | plg_user_terms (3.9.0) 0 | plg_user_contactcreator (3.0.0) 0 | plg_user_profile (3.0.0) 0 | plg_user_joomla (3.0.0) 1 |
3rd Party:: ImageSizer (1.6.7) 0 | ChronoengineGcore2 (1.0) 1 | PLG_SYSTEM_FANCYBOX (1.3.8) 0 | System - Google Analytics Tracker (1.0) 0 | System - Ki - Mootools Control (0.1) 1 | System - Admin Tools (3.8.6) 1 | PLG_JMONITORING_AKEEBABACKUP_TITLE (1.0) 1 | plg_editors_tinymce (4.5.12) 1 | plg_editors_codemirror (5.60.0) 1 |
Templates Discovered :: wrote:Templates :: Site :: atomic (2.5.0) 1 | beez_20 (2.5.0) 1 | jacksondark (1.6.0) 1 | beez3 (3.1.0) 1 | protostar (1.0) 1 | CSSDARMembersTemplate (1.6.0) 1 | jackson (1.6.0) 1 | CSSDARMembersTemplate (1.6.0) 1 | CSSDARMembersTemplate (1.6.0) 1 | CSSDARPublicTemplate (1.6.0) 1 | beez5 (2.5.0) 1 | jackson (1.6.0) 1 | jackson (1.6.0) 1 | jackson (1.6.0) 1 |
Templates :: Admin :: hathor (3.0.0) 1 | bluestork (2.5.0) 1 | isis (1.0) 1 |

User avatar
sozzled
Joomla! Master
Joomla! Master
Posts: 11196
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Non-Joomla script fails with 504 Gateway Timeout

Post by sozzled » Wed Oct 06, 2021 5:02 pm

Lots of problems with this website.
    [*] allow_url_fopen() is disabled
    [*]get_magic_quotes_gpc() is disabled (but this function is deprecated in PHP 7.4 anyway)
    [*]remnants of outdated J! 2.5 software exist
    [*]"cegcore2" applies to Chronoforms: you will need to talk to the developers of that extension for advice on known problems with that extension.

    I suspect that the allowances you have made for upload sizes, memory limit and execution times are "extravagant"/overkill.
    “If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

    User avatar
    brian
    Joomla! Master
    Joomla! Master
    Posts: 12312
    Joined: Fri Aug 12, 2005 7:19 am
    Location: Leeds, UK
    Contact:

    Re: Non-Joomla script fails with 504 Gateway Timeout

    Post by brian » Wed Oct 06, 2021 5:10 pm

    If the script is being run outside of joomla and its only connection to joomla is the use of the same database tables then joomla can't be involved with your issue.
    "Exploited yesterday... Hacked tomorrow"
    Blog http://brian.teeman.net/
    Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

    User avatar
    sozzled
    Joomla! Master
    Joomla! Master
    Posts: 11196
    Joined: Sun Jul 05, 2009 3:30 am
    Location: Canberra, Australia

    Re: Non-Joomla script fails with 504 Gateway Timeout

    Post by sozzled » Wed Oct 06, 2021 5:12 pm

    I agree with @brian. My earlier observations are somewhat off-topic to the 504 error.
    “If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)


    Post Reply

    Return to “Performance - Joomla! 3.x”