Troubleshooting Reduce Server Response TIme (first byte) and configuration

252 views
Skip to first unread message

Alaa Alhamdan

unread,
Apr 23, 2016, 10:30:12 AM4/23/16
to mod-pagespeed-discuss

Hello There,

I'm not a developer, so I'll try to clarify as much details as possible,

We used to be running an older version of Page Speed Module, and everything were working fine, Until we received a warning message from WMT that we need to update the version for security reasons, our developer upgraded to the latest stable version 1.9.32.14.

We use Apache 2.2 and PHP 5.4.

Starting that point, the PSM (Page Speed Module) seems to be working but not working!, I see some tags in the source code of our website (https://goo.gl/Nwk2ct), but it seems that the page speed isn't caching, developer tried to provide a version of our cms with no static resources and its always needs 250 ms to load the first byte (Google Page Speed Insights Tool Reporting Server Response Time Issue) while it used to be less than 100 on the previous version when the module was working probably, which means the caching isnt working since it needs to process the php code every time some one request the page. we tried to play with the filters, trying all options like PassThrough, CoreFilters, and OptimizeForBandwidth (but it seems not related to the filter).

I'm not sure where the problem is, I'll post some screenshots from the admin-statistics maybe someone can guide us where to digg or what to do:

1- When I go to cache and try on home page I'll see:

Metadata cache key:rname/aj_asnh-MYUILoweFP_NVnU/https://www.baboneg.com/@@_
cache_ok:false
can_revalidate:false
partitions:

I'm not sure if this means its not caching.

2- The "config.png" screenshot attached show the configuration setup for filters.

3- The Stats.png screenshot attached show the statistics.


I do highly appreciate helping us troubleshooting the issue, if any further information is needed, I'll be more than happy to provide.

Thanks in advance.
Config.png
Stats.png

Otto van der Schaaf

unread,
Apr 23, 2016, 4:48:06 PM4/23/16
to mod-pagespeed-discuss
HTML caching is not something that mod_pagespeed does. It is designed to process the html on each request.

But I did notice there is a recent similar report at https://github.com/pagespeed/mod_pagespeed/issues/1293

If earlier releases did not introduce a noticable delay, and 1.9.32.14 does, then perhaps there's a performance regression?

Otto

Alaa Alhamdan

unread,
Apr 23, 2016, 5:00:55 PM4/23/16
to mod-pagespeed-discuss
Hello Otto and thanks for your response,

As I said im not the developer, and I do not understand what type of caching the module do, but what I'm worried about is according to the information I provided earlier, do you see that the caching is working?

And what do this suppose to mean:

Metadata cache key:rname/aj_asnh-MYUILoweFP_NVnU/https://www.baboneg.com/@@_
cache_ok:false
can_revalidate:false
partitions:

===
Another question, how can we install an older version than the latest? when we try to install the module it will automatically get the latest version from the repository, how can we try an older version?

Thanks

Otto van der Schaaf

unread,
Apr 23, 2016, 5:35:19 PM4/23/16
to mod-pagespeed-discuss
On Sat, Apr 23, 2016 at 11:00 PM, Alaa Alhamdan <ala.s...@gmail.com> wrote:
As I said im not the developer, and I do not understand what type of caching the module do, but what I'm worried about is according to the information I provided earlier, do you see that the caching is working?

And what do this suppose to mean:
Metadata cache key:rname/aj_asnh-MYUILoweFP_NVnU/https://www.baboneg.com/@@_
cache_ok:false
can_revalidate:false
partitions:


I think that is a cache entry related to in-place-resource optimization which stores the fact that the html response for the related url cannot be processed in-place.

 
===
Another question, how can we install an older version than the latest? when we try to install the module it will automatically get the latest version from the repository, how can we try an older version?
 
Assuming you are using packages, you can find older releases here: http://www.modpagespeed.com/release_archive/

Otto

Alaa Alhamdan

unread,
Apr 23, 2016, 6:39:32 PM4/23/16
to mod-pagespeed-discuss
Thanks again for your response.

And sorry for my ignorance, let me re-format my question,

How do I make sure if the module is working probably, and doing what it is supposed to do? for example we now enabled the core filters, can you check our source code or see my attached statistics screenshot to confirm if its working or not? or if you see an indication of an issue?

Thanks in advance.

Joshua Marantz

unread,
Apr 23, 2016, 8:17:56 PM4/23/16
to mod-pagespeed-discuss
It looks to me like the module is working reasonably well.  I also see only a small impact in TTFB when comparing with webpagetest:

I'm not sure where your site is posted or where the visitors are, but I used webpagetest instances in Japan for this measurement.  You can repeat the experiment using a webpagetest instance closer to where your users are.

I also noticed that mod_pagespeed reduced the number of requests, total byte-count, and (most importantly) speed-index by a reasonable amount.  However, you can probably do a little better with latency if you enable prioritize_critical_css.  Also note that mod_pagespeed cannot optimize the ads on your site, which is part of the webpagetest score.

One thing I want to bring to your attention: in your config, you have authorized mod_pagespeed to rewrite assets on pagead2.googleadsyndication.com, and that's a bad idea because the server behind that is not running mod_pagespeed.  If mod_pagespeed rewrites the URLs for assets on that domain (which it can with your config), then pagead2.googleadsyndication.com will return a 404 when you request those resources.

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-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/ad999631-432f-4477-bdcf-0e9946c52092%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Alaa Alhamdan

unread,
Apr 24, 2016, 4:09:02 AM4/24/16
to mod-pagespeed-discuss
Thanks so much for the informative response and the time you spent, much appreciated.

We will do your recommendations.

Best

Alaa Alhamdan

unread,
Apr 28, 2016, 5:24:37 AM4/28/16
to mod-pagespeed-discuss

Hello Again,

First I would like to thank all who replied here, Now we understand the behavior of the mod better, its working and we managed to get page speed insights 100% (when removing ads), however we still face some issues and have some questions (we searched much but no hope), we do appreciate any help here (Current Configuration and Cache sizes screenshot attached) :

1- We are using memcache, the developer configured it to work with mo-pagespeed, after enabling it, we noticed that mod-page speed isnt saving anything to its cache folder, is this the default behavior? I mean it will move the cache to the memcache cache folder? (and do purge cache do nothing in this case? since we need to purge the memcache folder)?

2- Memcache use RAM for caching as far as I know, so with memcache and mod-page speed both enabled, will moving file-based cache of mod-page speed into ram enhance performance (we have a lot of ram) or it wont be effective here?

3- Is there an SPDY mod for easy apachi? i tried to search but couldnt find one.

4- Is there a suggested model to estimate the values should be used for tuning cache sizes and tuning filters values?

5- We do see in chrome console some errors like this:
https://www.babonej.com//mod_pagespeed_beacon/?url=https%253A%252F%252Fwww.babonej.com%252Ffood-benefits%252F 404 (Not Found)

In Apachi logs we see them like this:
[Wed Apr 27 20:02:45 2016] [error] [client 105.107.86.226] File does not exist: /home/account/public_html/mod_pagespeed_beacon, referer: https://www.babonej.com/games/power-rangers/

And seems like Google is getting those 404 errors, since we got a warning of 404 error increase!

We tried to add those roles to htaccess but did not solve the issue:
RewriteCond %{REQUEST_URI} [A-Z]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/mod_pagespeed_beacon
RewriteCond %{REQUEST_URI} !(mod_pagespeed_statistics|mod_pagespeed_beacon) [NC]

6- We have a phpBB forum Here, where we tried to run the mod-page speed on, it will always break the css of the forum, I tried the method in the FAQ suggesting using the:
http://www.modpagespeed.com/?ModPagespeed=on&ModPagespeedFilters=foo

I tried all the filters one by one, and the forum works fine, I even tried them all together seperated by a comma it works fine, but when the corefilters is used like this:
http://www.modpagespeed.com/?ModPagespeed=on&ModPagespeedFilters=CoreFilters  it will break the css.

Help suggest we fill a bug request, but I preferred to ask here first, currently we excluded the forum from mod-pagespeed

I know im asking many things, any help here is highly appreciated.
Config.png

Joshua Marantz

unread,
Apr 28, 2016, 9:48:01 AM4/28/16
to mod-pagespeed-discuss
On Thu, Apr 28, 2016 at 5:24 AM, Alaa Alhamdan <ala.s...@gmail.com> wrote:

Hello Again,

First I would like to thank all who replied here, Now we understand the behavior of the mod better, its working and we managed to get page speed insights 100% (when removing ads), however we still face some issues and have some questions (we searched much but no hope), we do appreciate any help here (Current Configuration and Cache sizes screenshot attached) :

1- We are using memcache, the developer configured it to work with mo-pagespeed, after enabling it, we noticed that mod-page speed isnt saving anything to its cache folder, is this the default behavior? I mean it will move the cache to the memcache cache folder? (and do purge cache do nothing in this case? since we need to purge the memcache folder)?

Actually the FileCache folder is still important.  It is used both for the purging-file and for storing cache entries that are too large for memcached: currently hardcoded at 1MB or larger.  Purging still works exactly as it did before.  There is no memcache folder; it's all in RAM. 

2- Memcache use RAM for caching as far as I know, so with memcache and mod-page speed both enabled, will moving file-based cache of mod-page speed into ram enhance performance (we have a lot of ram) or it wont be effective here?

You are correct: memcached is all in RAM, so that can improve performance compared to disk access.  Moreover, if you have multiple servers, you can put memcached on each one, but have every server talk to every memcached instance which each contains a cache shard.  The benefit of this is that (a) you get to use all your RAM across multiple machines and (b) an image optimized on server A does not need to be re-optimized on server B.

To improve performance, you can also adjust the size of L1 caches held in server memory.  It's probably worth reading over https://developers.google.com/speed/pagespeed/module/system to learn more.

3- Is there an SPDY mod for easy apachi? i tried to search but couldnt find one.

I'm not sure about Easy Apache, but there is an old project called mod_spdy.  But SPDY is obsolete and there is now both mod_http2, which adds HTTP2 support to Apache, and there is H2O, which is an http2 proxy that sits between apache and your users.  Check those out.  We are working on integrating with both of these to exploit features in HTTP2.
 
4- Is there a suggested model to estimate the values should be used for tuning cache sizes and tuning filters values?

Start with measuring the overall size of your site (e.g. du -s -h --apparent-size /directory_with_your_site) and making the cache 4 times as big, in order to hold several variants of each image.  Look at the cache hit rate and other related cache stats on /pagespeed_admin/statistics and see if you are getting a reasonable cache hit rate.
 
5- We do see in chrome console some errors like this:
https://www.babonej.com//mod_pagespeed_beacon/?url=https%253A%252F%252Fwww.babonej.com%252Ffood-benefits%252F 404 (Not Found)

In Apachi logs we see them like this:
[Wed Apr 27 20:02:45 2016] [error] [client 105.107.86.226] File does not exist: /home/account/public_html/mod_pagespeed_beacon, referer: https://www.babonej.com/games/power-rangers/

And seems like Google is getting those 404 errors, since we got a warning of 404 error increase!

We tried to add those roles to htaccess but did not solve the issue:
RewriteCond %{REQUEST_URI} [A-Z]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/mod_pagespeed_beacon
RewriteCond %{REQUEST_URI} !(mod_pagespeed_statistics|mod_pagespeed_beacon) [NC]

I suspect the problem is that you haven't set up a beacon handler yet.  Please see this doc: https://developers.google.com/speed/pagespeed/module/install#handlers
 
6- We have a phpBB forum Here, where we tried to run the mod-page speed on, it will always break the css of the forum, I tried the method in the FAQ suggesting using the:
http://www.modpagespeed.com/?ModPagespeed=on&ModPagespeedFilters=foo

I tried all the filters one by one, and the forum works fine, I even tried them all together seperated by a comma it works fine, but when the corefilters is used like this:
http://www.modpagespeed.com/?ModPagespeed=on&ModPagespeedFilters=CoreFilters  it will break the css.

Can you look in the Chrome Dev Tools when MPS is enabled on this page to see if anything shows up as a 404 in the network panel, or as an error message in the console log?  It might be that there is JavaScript in your system that is not expecting us to rename some files.

Help suggest we fill a bug request, but I preferred to ask here first, currently we excluded the forum from mod-pagespeed

Excluding the forum from MPS is a good workaround, but we definitely want to be able to fix the problem. 
I know im asking many things, any help here is highly appreciated.

No problem, these are great questions!

-Josh

Reply all
Reply to author
Forward
0 new messages