High memory consumption

40 views
Skip to first unread message

Metahuman

unread,
Jun 19, 2017, 10:02:21 PM6/19/17
to mod-pagespeed-discuss
These are the entries in my .htaccess.

<IfModule pagespeed_module>
    ModPagespeedRewriteLevel CoreFilters

    ModPagespeedDomain *.twimg.com
    ModPagespeedDomain *.gravatar.com
    ModPagespeedRespectVary on
    ModPagespeedDisableRewriteOnNoTransform off

    ModPagespeedEnableFilters insert_dns_prefetch
    ModPagespeedEnableFilters pedantic
    ModPagespeedEnableFilters extend_cache
    ModPagespeedEnableFilters combine_heads
    ModPagespeedEnableFilters convert_meta_tags
    ModPagespeedEnableFilters elide_attributes
    #ModPagespeedEnableFilters hint_preload_subresources #enable when 1.12.34.1 is released.
    ModPagespeedEnableFilters remove_comments
    ModPagespeedEnableFilters rewrite_style_attributes_with_url
    ModPagespeedEnableFilters collapse_whitespace

    ModPagespeedEnableFilters sprite_images
    ModPagespeedEnableFilters dedup_inlined_images
    ModPagespeedEnableFilters recompress_images
    ModPagespeedEnableFilters rewrite_images
    ModPagespeedEnableFilters insert_image_dimensions
    ModPagespeedEnableFilters lazyload_images

    ModPagespeedEnableFilters move_css_above_scripts
    ModPagespeedEnableFilters move_css_to_head
    #ModPagespeedEnableFilters inline_import_to_link
    ModPagespeedEnableFilters flatten_css_imports
    ModPagespeedEnableFilters combine_css
    ModPagespeedEnableFilters rewrite_css
    ModPagespeedEnableFilters prioritize_critical_css
    ModPagespeedEnableFilters inline_google_font_css

    ModPagespeedEnableFilters canonicalize_javascript_libraries
    ModPagespeedEnableFilters combine_javascript
    ModPagespeedEnableFilters rewrite_javascript
    ModPagespeedEnableFilters defer_javascript
    ModPagespeedEnableFilters inline_javascript

#Enabled Optimize Google in source code.
    ModPagespeedEnableFilters insert_ga
    ModPagespeedAnalyticsID UA-XXXXXX-X

    ModPagespeedXHeaderValue "domain.com"
</IfModule>

I am hosting my WordPress blog on a 1GB Linode with 1 GB RAM & 1 CPU Core. I use minimal plugins (7) and Genesis WordPress theme and have followed all optimization steps. I run no other service than the needed ones like Apache, MySQL, SSH. I also signed up for a free CloudFlare plan and yet my server reboots frequently with OOM. 

Can any one please let me know if I am overdoing with PageSpeed filters or where am I going wrong?

Joshua Marantz

unread,
Jun 19, 2017, 10:14:05 PM6/19/17
to mod-pagespeed-discuss
Probably unrelated to your memory consumption: are you sure you want to authorize twimg.com?  I think that's the Twitter image server and I was not aware that Twitter was running PageSpeed.  So if you authorize rewriting resources on that domain, and you reference one from your HTML, mod_pagespeed will happily fetch it, rewrite it, and change its URL to ".pagespeed." format, which will probably make twimg.com respond with a 404.

RE memory consumption, there are two approaches I would take
  1. Decrease the amount of in-memory cache allocated by PageSpeed.  See https://modpagespeed.com/doc/system for details.  For such a small machine, I'd set "ModPagespeedLRUCacheKbPerProcess 0".  You get 50MB in the shared-memory cache by default now, so that should be enough.
  2. Start paring down the set of filters that you enable until the memory.  If you identify a specific filter you think might cause a problem, just disable it (and report a bug about that).  From your list I'd start by disabling sprite_images.  I was not aware that was a performance bottleneck, but that is a filter that by definition requires holding a bunch of images in-memory and operating on them.
Hope this helps!
-Josh



--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/83f4a01a-b9a5-4ec0-8826-32ce4e2f5583%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Metahuman

unread,
Jun 19, 2017, 11:56:35 PM6/19/17
to mod-pagespeed-discuss
Thanks a lot Josh! Good point. I am testing with all my image related filters as of now. Also seems like the LRUCache might just work for me. Will keep you updated. :-)

- M.
Reply all
Reply to author
Forward
0 new messages