Learn about Centmin Mod LEMP Stack today
Become a Member

Featured Nginx PageSpeed Nginx Pagespeed Troubleshooting steps

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by eva2000, May 25, 2014.

Thread Status:
Not open for further replies.
  1. eva2000

    eva2000 Administrator Staff Member

    28,984
    6,579
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,766
    Local Time:
    6:42 AM
    Nginx 1.13.x
    MariaDB 5.5
    How Centmin Mod Nginx enables and configures Nginx ngx_pagespeed module ngx_pagespeed install on Centmin Mod - Menu based Nginx installer for CentOS servers

    To troubleshooting Nginx Pagespeed when certain filters do not do what you expect them to do you should first enable the pagespeed messages and console features outlined at ngx_pagespeed install on Centmin Mod - Menu based Nginx installer for CentOS servers. Then you can exclude specific urls from pagespeed via pagespeed disallow directives as outlined here.

    This will give you access to new Nginx Pagespeed stats and admin pages from outlined location urls listed in /usr/local/nginx/conf/pagespeedhandler.conf. You will need to add your own ISP IP address to each allow yourip; for each location line, so you can access them.

    Full instructions at ngx_pagespeed install on Centmin Mod - Menu based Nginx installer for CentOS servers.

    Code:
    location /ngx_pagespeed_statistics { allow 127.0.0.1; deny all; }
    location /ngx_pagespeed_global_statistics { allow 127.0.0.1; deny all; }
    location /ngx_pagespeed_message { allow 127.0.0.1; deny all; }
    location /pagespeed_console { allow 127.0.0.1; deny all; }
    location ~ ^/pagespeed_admin { allow 127.0.0.1; deny all; }
    location ~ ^/pagespeed_global_admin { allow 127.0.0.1; deny all; }
    Then you should be able to access the message log from yourhostname.com/ngx_pagespeed_message as well as access the pagespeed admin pages which were recently added to ngx_pagespeed 1.8.31-2 beta PageSpeed Admin Pages - PageSpeed Module — Google Developers

    For example

    PageSpeed Message
    Normal to have no permission entries if you have defined Disallow directives in pagespeed.conf or have 3rd party urls like Google fonts

    pagespeed_message.png

    PageSpeed console page

    pagespeed_console.png

    PageSpeed Statistics output

    Code:
    timestamp_:                                            1401363934578
    cache_time_us:                                                276039
    cache_hits:                                                      575
    cache_misses:                                                    231
    cache_backend_hits:                                              634
    cache_backend_misses:                                            172
    cache_fallbacks:                                                   0
    cache_expirations:                                                 0
    cache_inserts:                                                   395
    cache_deletes:                                                     0
    instrumentation_filter_script_added_count:                         0
    cache_extensions:                                               9285
    not_cacheable:                                                     0
    critical_css_beacon_filter_script_added_count:                   446
    critical_css_no_beacon_due_to_missing_data:                        0
    critical_css_skipped_due_to_charset:                               0
    critical_images_beacon_filter_script_added_count:                574
    css_combine_opportunities:                                      2964
    css_file_count_reduction:                                       1337
    css_filter_blocks_rewritten:                                     185
    css_filter_parse_failures:                                         1
    css_filter_fallback_rewrites:                                      1
    css_filter_fallback_failures:                                      0
    css_filter_rewrites_dropped:                                       0
    css_filter_total_bytes_saved:                                 -59678
    css_filter_total_original_bytes:                            10366208
    css_filter_uses:                                                4359
    flatten_imports_charset_mismatch:                                  0
    flatten_imports_invalid_url:                                       0
    flatten_imports_limit_exceeded:                                   84
    flatten_imports_minify_failed:                                     0
    flatten_imports_recursion:                                         0
    flatten_imports_complex_queries:                                   0
    num_css_inlined:                                                1469
    css_imports_to_links:                                              0
    css_elements_moved:                                                1
    num_css_used_for_critical_css_computation:                      3421
    num_css_not_used_for_critical_css_computation:                  4808
    num_dedup_inlined_images_candidates_found:                         0
    num_dedup_inlined_images_candidates_replaced:                      0
    domain_rewrites:                                                   0
    google_analytics_page_load_count:                                  0
    google_analytics_rewritten_count:                                  0
    font_service_input_resource_hit:                                   0
    font_service_input_resource_recent_fetch_failure:                  0
    font_service_input_resource_recent_uncacheable_treated_as_miss:    0
    font_service_input_resource_recent_uncacheable_treated_as_failure: 0
    font_service_input_resource_miss:                                 12
    image_file_count_reduction:                                        0
    image_rewrites:                                                  149
    image_resized_using_rendered_dimensions:                           0
    image_norewrites_high_resolution:                                  0
    image_rewrites_dropped_intentionally:                             26
    image_rewrites_dropped_decode_failure:                             0
    image_rewrites_dropped_mime_type_unknown:                          0
    image_rewrites_dropped_server_write_fail:                          0
    image_rewrites_dropped_nosaving_resize:                            0
    image_rewrites_dropped_nosaving_noresize:                         26
    image_rewrites_dropped_due_to_load:                                0
    image_rewrites_squashing_for_mobile_screen:                        0
    image_rewrite_total_bytes_saved:                              217228
    image_rewrite_total_original_bytes:                          1018942
    image_rewrite_uses:                                            17225
    image_inline:                                                   7940
    image_webp_rewrites:                                             100
    image_rewrite_latency_total_ms:                                 4102
    image_ongoing_rewrites:                                            0
    image_webp_conversion_gif_timeouts:                                0
    image_webp_conversion_png_timeouts:                                0
    image_webp_conversion_jpeg_timeouts:                               0
    image_webp_alpha_timeouts:                                         0
    image_webp_opaque_timeouts:                                        0
    in_place_oversized_opt_stream:                                     0
    in_place_uncacheable_rewrites:                                     0
    inserted_ga_snippets:                                              0
    javascript_blocks_minified:                                     7851
    javascript_libraries_identified:                                   0
    javascript_minification_failures:                                  0
    javascript_total_bytes_saved:                                 986721
    javascript_total_original_bytes:                            11728376
    javascript_minify_uses:                                         7884
    javascript_reducing_minifications:                              7831
    javascript_minification_disabled:                                  0
    javascript_did_not_shrink:                                         0
    javascript_failed_to_write:                                        0
    js_file_count_reduction:                                        3589
    num_js_inlined:                                                   14
    num_local_storage_cache_candidates_found:                          0
    num_local_storage_cache_stored_total:                              0
    num_local_storage_cache_stored_images:                             0
    num_local_storage_cache_stored_css:                                0
    num_local_storage_cache_candidates_added:                          0
    num_local_storage_cache_candidates_removed:                        0
    converted_meta_tags:                                            1484
    split_html_beacon_filter_script_added_count:                       0
    num_rewrites_abandoned_for_lock_contention:                        0
    num_distributed_rewrite_successes:                                 0
    num_distributed_rewrite_failures:                                  0
    num_distributed_metadata_failures:                                 0
    num_deadline_alarm_invocations:                                   17
    url_input_resource_hit:                                            0
    url_input_resource_recent_fetch_failure:                          20
    url_input_resource_recent_uncacheable_treated_as_miss:             0
    url_input_resource_recent_uncacheable_treated_as_failure:         39
    url_input_resource_miss:                                          59
    url_trims:                                                         0
    url_trim_saved_bytes:                                              0
    resource_url_domain_acceptances:                               92928
    resource_url_domain_rejections:                                21756
    rewrite_cached_output_missed_deadline:                          1516
    rewrite_cached_output_hits:                                    77207
    rewrite_cached_output_misses:                                   2325
    resource_404_count:                                             6104
    slurp_404_count:                                                   0
    total_page_load_ms:                                                0
    page_load_count:                                                   0
    resource_fetches_cached:                                         575
    resource_fetch_construct_successes:                              101
    resource_fetch_construct_failures:                                 0
    num_cache_control_rewritable_resources:                         1324
    num_cache_control_not_rewritable_resources:                      118
    num_flushes:                                                    1686
    num_fallback_responses_served:                                     0
    num_proactively_freshen_user_facing_request:                       0
    num_fallback_responses_served_while_revalidate:                    0
    num_conditional_refreshes:                                         0
    ipro_served:                                                       0
    ipro_not_in_cache:                                                 0
    ipro_not_rewritable:                                               0
    downstream_cache_purge_attempts:                                   0
    successful_downstream_cache_purges:                                0
    total_fetch_count:                                               666
    total_rewrite_count:                                            1623
    num_rewrites_executed:                                          1070
    num_rewrites_dropped:                                              0
    num_resource_fetch_successes:                                     12
    num_resource_fetch_failures:                                      59
    html-worker-queue-depth:                                           0
    rewrite-worker-queue-depth:                                        0
    low-priority-worked-queue-depth:                                   0
    cache_batcher_dropped_gets:                                        0
    critical_images_valid_count:                                    1335
    critical_images_expired_count:                                    38
    critical_images_not_found_count:                                 250
    critical_css_valid_count:                                          0
    critical_css_expired_count:                                        0
    critical_css_not_found_count:                                      0
    critical_selectors_valid_count:                                 1226
    critical_selectors_expired_count:                                 16
    critical_selectors_not_found_count:                              254
    serf_fetch_request_count:                                         71
    serf_fetch_bytes_count:                                        30070
    serf_fetch_time_duration_ms:                                     859
    serf_fetch_cancel_count:                                           0
    serf_fetch_active_count:                                           0
    serf_fetch_timeout_count:                                          0
    serf_fetch_failure_count:                                          0
    serf_fetch_cert_errors:                                            0
    memcache_timeouts:                                                 0
    memcache_last_error_checkpoint_ms:                     1401359532004
    memcache_error_burst_size:                                         0
    file_cache_bytes_freed_in_cleanup:                                 0
    file_cache_cleanups:                                               0
    file_cache_disk_checks:                                            4
    file_cache_evictions:                                              0
    file_cache_write_errors:                                           0
    file_cache_deletes:                                                0
    file_cache_hits:                                                 236
    file_cache_inserts:                                              384
    file_cache_misses:                                               366
    lru_cache_deletes:                                                 0
    lru_cache_hits:                                                    0
    lru_cache_inserts:                                                 0
    lru_cache_misses:                                                  0
    shm_cache_deletes:                                                 0
    shm_cache_hits:                                               344521
    shm_cache_inserts:                                              1835
    shm_cache_misses:                                               1737
    memcached_async_deletes:                                           0
    memcached_async_hits:                                            624
    memcached_async_inserts:                                        1834
    memcached_async_misses:                                         1513
    memcached_blocking_deletes:                                        0
    memcached_blocking_hits:                                        2125
    memcached_blocking_inserts:                                     2281
    memcached_blocking_misses:                                      2300
    compressed_cache_corrupt_payloads:                                 0
    compressed_cache_original_size:                                    0
    compressed_cache_compressed_size:                                  0
    pcache-cohorts-beacon_cohort_deletes:                              0
    pcache-cohorts-beacon_cohort_hits:                              2000
    pcache-cohorts-beacon_cohort_inserts:                           2017
    pcache-cohorts-beacon_cohort_misses:                             654
    pcache-cohorts-dom_deletes:                                        0
    pcache-cohorts-dom_hits:                                         264
    pcache-cohorts-dom_inserts:                                      446
    pcache-cohorts-dom_misses:                                      1810
    ipro_recorder_resources:                                           0
    ipro_recorder_inserted_into_cache:                                 0
    ipro_recorder_not_cacheable:                                       0
    ipro_recorder_failed:                                              0
    ipro_recorder_dropped_due_to_load:                                 0
    ipro_recorder_dropped_due_to_size:                                 0
    current-fetch-queue-size:                                          0
    queued-fetch-count:                                                0
    dropped-fetch-count:                                               0
    child_shutdown_count:                                              0
    cache_flush_count:                                                 0
    cache_flush_timestamp_ms:                                          0
    statistics_404_count:                                              0
    http_fetches:                                                      0
    http_bytes_fetched:                                                0
    http_approx_header_bytes_fetched:                                  0

     
    Last edited: Oct 19, 2014
  2. eva2000

    eva2000 Administrator Staff Member

    28,984
    6,579
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,766
    Local Time:
    6:42 AM
    Nginx 1.13.x
    MariaDB 5.5
    Also for CSS and JS combining read the documentation as there are a number of max bytes and length limitations which may prevent CSS and JS files from combining.
    Note:

    If you're using https/SSL need additional settings which are not found in my forum's posted pagespeed.conf https://developers.google.com/speed/pagespeed/module/https_support

    For example if I had https/SSL enabled on the forums I need to add to pagespeed.conf this line. Changing your paths appropriately for your domain of course.

    Code:
    pagespeed LoadFromFile "https://community.centminmod.com" "/home/nginx/domains/community.centminmod.com/public";
     
    Last edited: May 29, 2014
  3. eva2000

    eva2000 Administrator Staff Member

    28,984
    6,579
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,766
    Local Time:
    6:42 AM
    Nginx 1.13.x
    MariaDB 5.5
  4. eva2000

    eva2000 Administrator Staff Member

    28,984
    6,579
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,766
    Local Time:
    6:42 AM
    Nginx 1.13.x
    MariaDB 5.5
  5. eva2000

    eva2000 Administrator Staff Member

    28,984
    6,579
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,766
    Local Time:
    6:42 AM
    Nginx 1.13.x
    MariaDB 5.5
  6. eva2000

    eva2000 Administrator Staff Member

    28,984
    6,579
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,766
    Local Time:
    6:42 AM
    Nginx 1.13.x
    MariaDB 5.5
Thread Status:
Not open for further replies.