1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Nginx pagespeed on SSL

Discussion in 'Server Configuration and Hosting' started by Floren, May 18, 2013.

  1. Floren

    Floren Well-Known Member

    I recently compiled Nginx with pagespeed support. While everything works OK with http, there is a different story with https. I'm already using SPDY and I'm more prone to optimize myself the server, instead of adding the bulk of Pagespeed. After compilation, the binary passes from 400KB (without pagespeed) to 4.3MB (with pagespeed)!

    Looking forward to your input.
     
  2. AlexT

    AlexT Well-Known Member

    I'd be interested in the expected CPU overhead with mod_pagespeed. In particular for medium-to-large forums.
     
  3. p4guru

    p4guru Well-Known Member

    woah how the hell did it go from 400kb to 4.3MB ? can you run side by side compare through gtmetrix.com for http vs https ? where is the bulk of the increases ? rewritten images ? rewritten css or jss ?

    tried one by one disabling pagespeed filters to see if any or all are the culprits ?
     
  4. AlexT

    AlexT Well-Known Member

    You're referring to the actual nginx binary file? Did you check if debug symbols were stripped after compilation?
     
  5. Floren

    Floren Well-Known Member

    Obviously, ya. :)
    I build 2 different rpm's, one with debug and the other without but the differences in size are minimal.
    Someone else on GitHub compiled Nginx with Pagespeed for CentOS 5, his packages are 5MB while mines were 4.3MB.
    My packages size compiled with naxsi, pam and wevdav+ modules (no pagespeed):
    Code:
    # ls -lah | grep nginx
    -rw-r--r--. 1 root root 415K May 17 03:48 nginx-1.4.1-1.el6.x86_64.rpm
    -rw-r--r--. 1 root root 147K May 17 03:48 nginx-common-1.4.1-1.el6.x86_64.rpm
    -rw-r--r--. 1 root root 446K May 17 03:48 nginx-debug-1.4.1-1.el6.x86_64.rpm
    -rw-r--r--. 1 root root 436K May 17 03:48 nginx-naxsi-1.4.1-1.el6.x86_64.rpm
    For example, nginx-1.4.1-1.el6.x86_64.rpm contains just the Nginx binary. Same thing with nginx-debug and nginx-naxsi. I decided that Pagespeed is not for me. As previously said, I can do everything into actual php software without the huge bulk added by pagespeed into Nginx.

    IMO, Pagespeed is useful for hosts or companies who have a large number of vhosts managed by inexperienced users who have no idea how to optimize their web software. By setting the Pagespeed settings globally, the host does not have to worry if the user installs some weird coded app that doubles the bandwidth usage (for example). Which is not the case with XF.
     
  6. p4guru

    p4guru Well-Known Member

    Ah size of binary!

    So have you done tests against your default vs ngx_pagespeed enabled site to compare the actual page loading and visual rendering time of your sites (2 may differ page load times versus visual render time) ?

    Or you just concerned with binary size ?

    I do agree if you already optimize your sites manually, you won't notice that much difference. But depends on the site I guess.
     
  7. Floren

    Floren Well-Known Member

    Nginx rule of thumb: bigger is the binary, slower things run.
    I only enabled the dns prefetch as it was the only thing I was interested. No difference is speed or performance. Then I realized you can do everything Pagespeed does yourself, for example:
    <link rel="dns-prefetch">

    All they do is a sort of regex on each page, by adding fancy things for you. I will do that myself. :)
    I mean, static pages are already cached by Nginx and for the dynamic stuff we have APC and Memcached, why would I use their Memcached implementation for example?
     
  8. Yoskaldyr

    Yoskaldyr Well-Known Member

    Yes, pagespeed is a huge nginx module :(

    P.S. http://repobuild.com service for creating own nginx/open-resty/tengine repo with custom build options with auto-update.
     
  9. DRE

    DRE Well-Known Member

    Whats that dns prefretch tag for?
     
  10. Marcus

    Marcus Well-Known Member

    @Floren how do you achieve a 400k nginx file? These settings build a 4 MB nginx file on Centos 6.5 64bit:

    ls -lah /usr/local/sbin/nginx
    -rwxr-xr-x 1 root root 3.9M Jan 14 03:41 /usr/local/sbin/nginx

    ./configure --with-http_ssl_module --with-http_spdy_module
    --without-http_browser_module
    --without-http_charset_module
    --without-http_empty_gif_module
    --without-http_geo_module
    --without-mail_pop3_module
    --without-mail_imap_module
    --without-mail_smtp_module
    --without-http_auth_basic_module
    --without-http_autoindex_module
    --without-http_limit_req_module
    --without-http_limit_conn_module
    --without-http_browser_module
    --without-http_geo_module
    --without-http_map_module
    --without-http_memcached_module
    --without-http_referer_module
    --without-http_proxy_module
    --without-http_scgi_module
    --without-http_split_clients_module
    --without-http_ssi_module
    --without-http_upstream_ip_hash_module
    --without-http_userid_module
    --without-http_uwsgi_module
     
    Last edited: Jan 20, 2014
  11. p4guru

    p4guru Well-Known Member

    i think Floren is referring to the compressed rpm package size ?? as he mentioned binary being 4.3MB
     
    Marcus likes this.
  12. Floren

    Floren Well-Known Member

    The previous version I had it at 740KB, the 1.4.4 is at 1003KB with all standard modules enabled, plus external DAV and PAM:
    Before you compile, do ./compile --help to see all modules available. For example the memcached module is enabled by default, there is no need to type it. To be sure is true, I added the $memcached_key and memcached_pass variables into a location and got no config errors when i restarted Nginx.
    Binary was over 4Mb with pagespeed enabled, without it and optional add-ons it is 700KB.
     
    Last edited: Jan 21, 2014
  13. RoldanLT

    RoldanLT Well-Known Member

    Ngx_pagespeed doesn't work will with https/ssl site.
     
  14. bortrenamo

    bortrenamo Member

    RoldanLT likes this.
  15. RoldanLT

    RoldanLT Well-Known Member

  16. RoldanLT

    RoldanLT Well-Known Member

    Andy.N and p4guru like this.
  17. p4guru

    p4guru Well-Known Member

  18. Andy.N

    Andy.N Well-Known Member

    what is it?
     
  19. RoldanLT

    RoldanLT Well-Known Member

    After I posted post #16
    My forum is not displaying correctly, most specially the admin view and guest view.
    So I decided to remove ngx_pagespeed totally.
    The one you linked from gtmetrix was tested without ngx_pagespeed.
    I will not use ngx_pagespeed for now until they support https/spdy correctly.
    https://developers.google.com/speed/pagespeed/module/https_support
     
  20. HittingSmoke

    HittingSmoke Active Member

    I have a slightly smaller than medium size forum and there's no noticeable CPU hit after the initial caching of files. It scrapes and caches files when they're requested so as the bulk of your site gets cached there's no performance hit as it's just serving the cached, optimized files. No more CPU overhead than running the gzip-static-module.

    The binary size does grow quite a bit. My binary compiled with -Os without Pagespeed is 644KB. With -Os and Pagespeed it's ~4MB.

    The average page load time on my Pagespeed-enabled XenForo forum is 0.36 seconds.
     

Share This Page