• Resolved damngoodiam

    (@damngoodiam)


    This is what they said about my site.

    My site goes down after timeouts and gives 502 and 504 timeout error.

    My host says its related to Autoptimize.

    here is what they said.

    They said its SQL issue. Autoptimize plugin is creating big files in Database. How to fix autoptimize?

    Here is what they said.

    Still, I revised the logs in our system and found:
    2020-06-10 05:18:22.784456 [Wed Jun 10 05:18:22.784401 2020] [:warn] [pid 33859] [client 125.201.57.67:36072] Timeout waiting for output from CGI script /home/u514-feadx82y68hr/www/recenthighlights.com/public_html/index.php
    2020-06-10 05:19:37.376461 [Wed Jun 10 05:19:14.518873 2020] [:warn] [pid 38672] [client 89.28.84.184:34262] Timeout waiting for output from CGI script /home/u514-feadx82y68hr/www/recenthighlights.com/public_html/index.php, referer: https://recenthighlights.com/kimetsu-no-yaiba-202
    2020-06-10 05:19:37.376464 [Wed Jun 10 05:19:15.423878 2020] [:warn] [pid 38922] [client 60.108.130.160:35004] Timeout waiting for output from CGI script /home/u514-feadx82y68hr/www/recenthighlights.com/public_html/index.php, referer: https://recenthighlights.com/wp-content/uploads/2020/06/One-Piece-Manga-982.jpg
    2020-06-10 05:19:37.377334 [Wed Jun 10 05:19:22.843875 2020] [:warn] [pid 33859] [client 125.201.57.67:36072] Timeout waiting for output from CGI script /home/u514-feadx82y68hr/www/recenthighlights.com/public_html/index.php

    As I can see the last logs are from a few hours ago. There are no recent ones, but there had been way too many older timeout errors, so I decided to investigate further on and check the usage of the site.

    I found the reason for the issue you had experienced in the number of MySQL slow queries:
    === Databases Info ================================================================================
    Database Label Tables Views InnoDB MyISAM Slow Queries Slowest Query DB Size
    ————– ——————– —— —– —— —— ———— ————- ——-
    db9vr863sf464p recenthighlights.com 0 0 0 0 225 9.692 0 B
    —————————————————————————————————

    Please, keep in mind that normally a MySQL query is considered to be slow if it takes more than 1-2 seconds. As a result, it slows down the site and uses up more resources, thus also often causing the timeout error in question.

    In this case though some of the queries had taken over 100 seconds:
    1. Executed 9h 14m 19s ago for 111.368638 sec on Database –> db9vr863sf464p
    Date: 2020-06-10 05:19:37 Query_time: 111.368638 Rows_examined: 0: Rows_sent 0 Lock_time: 0.002995 Query_chars: 90
    SELECT option_value FROM wp_options WHERE option_name = ‘autoptimize_ccss_rules’ LIMIT 1;
    ——————————————————————————————————————-
    2. Executed 9h 14m 19s ago for 110.765304 sec on Database –> db9vr863sf464p
    Date: 2020-06-10 05:19:37 Query_time: 110.765304 Rows_examined: 1: Rows_sent 1 Lock_time: 0.000119 Query_chars: 106
    SELECT option_value FROM wp_options WHERE option_name = ‘_transient_timeout_jetpack_idc_allowed’ LIMIT 1;
    ——————————————————————————————————————-
    3. Executed 9h 14m 19s ago for 78.096887 sec on Database –> db9vr863sf464p
    Date: 2020-06-10 05:19:37 Query_time: 78.096887 Rows_examined: 0: Rows_sent 0 Lock_time: 0.000197 Query_chars: 88
    SELECT option_value FROM wp_options WHERE option_name = ‘autoptimize_ccss_key’ LIMIT 1;
    ——————————————————————————————————————-
    4. Executed 15h 38m 54s ago for 60.505472 sec on Database –> db9vr863sf464p
    Date: 2020-06-09 22:55:02 Query_time: 60.505472 Rows_examined: 0: Rows_sent 0 Lock_time: 0.000543 Query_chars: 100
    SELECT option_value FROM wp_options WHERE option_name = ‘autoptimize_imgopt_provider_stat’ LIMIT 1;
    ——————————————————————————————————————-
    5. Executed 15h 38m 54s ago for 59.163935 sec on Database –> db9vr863sf464p
    Date: 2020-06-09 22:55:02 Query_time: 59.163935 Rows_examined: 1: Rows_sent 0 Lock_time: 0.000063 Query_chars: 72
    DELETE FROM wp_options WHERE option_name = ‘_transient_doing_cron’;
    ——————————————————————————————————————-
    6. Executed 15h 38m 53s ago for 58.694363 sec on Database –> db9vr863sf464p
    Date: 2020-06-09 22:55:03 Query_time: 58.694363 Rows_examined: 11: Rows_sent 1 Lock_time: 0.000234 Query_chars: 297
    SELECT t.term_id, tt.parent, tt.count, tt.taxonomy FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN (‘category’) AND tr.object_id IN (321) ORDER BY t.name ASC;
    ——————————————————————————————————————-
    7. Executed 14h 23m 3s ago for 53.595309 sec on Database –> db9vr863sf464p
    Date: 2020-06-10 00:10:53 Query_time: 53.595309 Rows_examined: 184: Rows_sent 0 Lock_time: 0.012327 Query_chars: 277
    SELECT * FROM wp_posts LEFT JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE (post_type = ‘page’ AND post_status = ‘publish’) AND wp_postmeta.meta_key = ‘_wp_page_template’ AND wp_postmeta.meta_value = ‘template-index.php’ ORDER BY wp_posts.post_title ASC;
    ——————————————————————————————————————-
    8. Executed 14h 23m 6s ago for 50.559022 sec on Database –> db9vr863sf464p
    Date: 2020-06-10 00:10:50 Query_time: 50.559022 Rows_examined: 0: Rows_sent 0 Lock_time: 0.000178 Query_chars: 85
    SELECT option_value FROM wp_options WHERE option_name = ‘wpb_js_use_custom’ LIMIT 1;
    ——————————————————————————————————————-
    9. Executed 14h 23m 6s ago for 50.044731 sec on Database –> db9vr863sf464p
    Date: 2020-06-10 00:10:50 Query_time: 50.044731 Rows_examined: 1: Rows_sent 1 Lock_time: 0.000172 Query_chars: 88
    SELECT option_value FROM wp_options WHERE option_name = ‘can_compress_scripts’ LIMIT 1;
    ——————————————————————————————————————-
    10. Executed 15h 36m 34s ago for 48.5501 sec on Database –> db9vr863sf464p
    Date: 2020-06-09 22:57:22 Query_time: 48.550100 Rows_examined: 0: Rows_sent 0 Lock_time: 0.000158 Query_chars: 89
    SELECT option_value FROM wp_options WHERE option_name = ‘preload_cache_counter’ LIMIT 1;

    I can see that there are no new logs on the matter, but to prevent this issue from occurring again, I would highly recommend you to revise the site’s database.

    I noticed that some of the queries were related to the plugin autoptimize, but it would be best to revise all the content and all plugins and themes. It would be best to not only disable, but rather delete the ones you no longer need for the further functionality and development of the sites. The rest you can update to the latest available and most secure version.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    Interesting … The only autoptimize options that can have significantly sizes database entries are autoptimize_ccss_rules and autoptimize_ccss_queue and only if you have critical CSS active (so you have an API key entered there). Are you indeed using critical CSS and if so what is the number of rules and the number of jobs in the queue?

    Thread Starter damngoodiam

    (@damngoodiam)

    I dont have Critical css active.

    Thread Starter damngoodiam

    (@damngoodiam)

    And Autoptimize is supped to make site caching and speed faster but Pagespeed insights show many Autoptimize files as problem.

    Like this

    Remove unused JavaScript

    …js/autoptimize_d4d3e0f….js(recenthighlights.com)
    170.3 KB
    116.5 KB

    Remove unused CSS
    URL
    Transfer Size
    Potential Savings
    …css/autoptimize_341a609….css(recenthighlights.com)
    205.8 KB
    198.1 KB
    how to fix them?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    but that’s totally different from the database queries you mentioned ??

    anyway; The unused CSS/JS is being reported as being Autoptimize’s, but AO merely aggregates all the CSS/ JS provided by your theme & plugins, so if you (really) want to tackle “remove unused CSS/JS” then you should look into your theme & plugins (you might be able to get some improvement using e.g. “plugin organizer” to only allow plugins to work on specific pages). Moreover the unused CSS/ JS will likely be different for different pages (or parts of your site), so that would lead to different autoptimized CSS/JS-files being loaded on different pages.

    So I don’t believe the “remove unused” is actionable in WordPress in the current state no ??

    hope this clarifies,
    frank

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Autoptimize files are so big that Site or scripts are timing out’ is closed to new replies.