Want more timely Centmin Mod News Updates?
Become a Member

Redis Redis for PageSpeed?

Discussion in 'Other Centmin Mod Installed software' started by BobbyWibowo, Jul 23, 2016.

  1. BobbyWibowo

    BobbyWibowo Active Member

    166
    36
    28
    Jul 30, 2015
    Medan, Indonesia
    Ratings:
    +57
    Local Time:
    4:21 PM
    I was wondering.. It says that using "maxmemory-policy allkeys-lru" will make redis behaves like memcached. So does that mean you can pretty much use redis for anything else that can use memcached, such as pagespeed?
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,921
    6,909
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,405
    Local Time:
    7:21 PM
    Nginx 1.13.x
    MariaDB 5.5
    Unfortunately ngx_pagespeed doesn’t support redis cache yet only memcached cache
     
    • Informative Informative x 1
  3. bassie

    bassie Active Member

    557
    121
    43
    Apr 29, 2016
    Ratings:
    +369
    Local Time:
    10:21 AM
    • Informative Informative x 2
  4. eva2000

    eva2000 Administrator Staff Member

    30,921
    6,909
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,405
    Local Time:
    7:21 PM
    Nginx 1.13.x
    MariaDB 5.5
    Yeah it's on the books
     
    • Like Like x 1
  5. JarylW

    JarylW Active Member

    216
    40
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +102
    Local Time:
    5:21 PM
    • Informative Informative x 1
  6. eva2000

    eva2000 Administrator Staff Member

    30,921
    6,909
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,405
    Local Time:
    7:21 PM
    Nginx 1.13.x
    MariaDB 5.5
  7. bassie

    bassie Active Member

    557
    121
    43
    Apr 29, 2016
    Ratings:
    +369
    Local Time:
    10:21 AM
  8. eva2000

    eva2000 Administrator Staff Member

    30,921
    6,909
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,405
    Local Time:
    7:21 PM
    Nginx 1.13.x
    MariaDB 5.5
    redis should be faster than memcached benchmarks i did just a moment ago of 4 tests via memtier benchmark for
    • memcached 1.4.31 TCP
    • memcached 1.4.31 unix socket
    • redis 3.2.2 TCP
    • redis 3.2.2 unix socket
    Though it looks like it's true for unix sockets at least.

    memcached TCP
    Code (Text):
    memtier_benchmark -P memcache_text -s 127.0.0.1 -p 11211 --random-data --data-size-range=4-204 --data-size-pattern=S --key-minimum=200 --key-maximum=400 --key-pattern=G:G --key-stddev=10 --key-median=300
    

    Code (Text):
    4         Threads
    50        Connections per thread
    10000     Requests per thread
    Type        Ops/sec     Hits/sec   Misses/sec      Latency       KB/sec
    ------------------------------------------------------------------------
    Sets       18303.88          ---          ---      0.98800      2471.92
    Gets      182837.70    171303.33     11534.36      0.98800     25684.87
    Totals    201141.58    171303.33     11534.36      0.98800     28156.79
    

    memcached unix socket
    Code (Text):
    memtier_benchmark -P memcache_text -S /var/run/memcached/memcached1.sock --random-data --data-size-range=4-204 --data-size-pattern=S --key-minimum=200 --key-maximum=400 --key-pattern=G:G --key-stddev=10 --key-median=300
    

    Code (Text):
    4         Threads
    50        Connections per thread
    10000     Requests per thread
    Type        Ops/sec     Hits/sec   Misses/sec      Latency       KB/sec
    ------------------------------------------------------------------------
    Sets       35988.68          ---          ---      0.53700      4860.23
    Gets      359491.30    336459.54     23031.77      0.53700     50460.64
    Totals    395479.98    336459.54     23031.77      0.53700     55320.88
    

    redis TCP
    Code (Text):
    memtier_benchmark -P redis -s 127.0.0.1 -p 6379 --random-data --data-size-range=4-204 --data-size-pattern=S --key-minimum=200 --key-maximum=400 --key-pattern=G:G --key-stddev=10 --key-median=300
    

    Code (Text):
    4         Threads
    50        Connections per thread
    10000     Requests per thread
    Type        Ops/sec     Hits/sec   Misses/sec      Latency       KB/sec
    ------------------------------------------------------------------------
    Sets       16289.92          ---          ---      1.11700      2343.11
    Gets      162720.21    161109.12      1611.09      1.11500     22405.97
    Totals    179010.13    161109.12      1611.09      1.11600     24749.08
    

    redis unix socket
    Code (Text):
    memtier_benchmark -P redis -S /tmp/redis.sock --random-data --data-size-range=4-204 --data-size-pattern=S --key-minimum=200 --key-maximum=400 --key-pattern=G:G --key-stddev=10 --key-median=300
    

    Code (Text):
    4         Threads
    50        Connections per thread
    10000     Requests per thread
    Type        Ops/sec     Hits/sec   Misses/sec      Latency       KB/sec
    ------------------------------------------------------------------------
    Sets       36754.71          ---          ---      0.47400      5286.72
    Gets      367143.23    363508.14      3635.08      0.473
    
     
  9. bassie

    bassie Active Member

    557
    121
    43
    Apr 29, 2016
    Ratings:
    +369
    Local Time:
    10:21 AM
    Redis clould be faster than Memcached.
    Problem is Pagespeed.

    Pagespeed is huge (100 MB+ in compare to 900 KB Nginx)
    and Pagespeed is kind of unstable if you ask me.

    But after all. Why is there any need to use Pagespeed anyway?
    Almost all sites are using just 1 or 2 of the 68 Pagespeed filters.

    You could do it better yourself, on an permanent basis and not with temporary filters.
    For example;

    Minimizing (minify) css, javascript with YUI Compressor, compress images with Kraken,
    tweak small stuff and cache it completely in Redis with Redis and Nginx.
     
    Last edited: Aug 28, 2016
    • Informative Informative x 1
  10. pamamolf

    pamamolf Well-Known Member

    2,819
    251
    83
    May 31, 2014
    Ratings:
    +445
    Local Time:
    11:21 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    People need automation that's why :)

    But i agree with you 100% :)
     
  11. eva2000

    eva2000 Administrator Staff Member

    30,921
    6,909
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,405
    Local Time:
    7:21 PM
    Nginx 1.13.x
    MariaDB 5.5
    ngx_pagespeed as dynamic module reduces the nginx footprint somewhat
    Code (Text):
    ls -lah $(which nginx)
    -rwxr-xr-x 1 root root 3.3M Aug 26 05:41 /usr/local/sbin/nginx
    

    Code (Text):
      PID User     Command                         Swap      USS      PSS      RSS 
    
    smem -tk | grep nginx: | grep -v grep
    3004 root     nginx: master process /usr/        0     1.3M     6.8M    29.4M
    3005 nginx    nginx: worker process              0    10.2M    17.0M    43.8M
    3007 nginx    nginx: worker process              0    10.3M    17.0M    43.7M
    3006 nginx    nginx: worker process              0    10.2M    17.2M    44.2M
    3008 nginx    nginx: worker process              0    10.5M    17.5M    44.5M

    Centmin Mod 123.09beta01 with Nginx 1.11.3 with ngx_pagespeed 1.11.33.3 compiled as a dynamic nginx module
    well it's a choice and like any choice, you make it based on your usage requirements so not everyone will use Pagespeed and they'd decide for themselves. This forum and centminmod.com use ngx_pagespeed.

    Some of the benefits outlined at Nginx PageSpeed - Benefits of ngx_pagespeed | Centmin Mod Community
     
  12. bassie

    bassie Active Member

    557
    121
    43
    Apr 29, 2016
    Ratings:
    +369
    Local Time:
    10:21 AM
    For me its not about the footprint but about adding 100 MB extra software with its own bugs, problems, errors and more to debug.
    And all that for just 1 or 2 small filters.

    Sure its up to everyone.
    Pagespeed is not suitable for a large corporate site. but that's my opinion.
     
    Last edited: Aug 28, 2016
  13. BobbyWibowo

    BobbyWibowo Active Member

    166
    36
    28
    Jul 30, 2015
    Medan, Indonesia
    Ratings:
    +57
    Local Time:
    4:21 PM
    To be fair, I use lots of the filters. Including combining CSS and renaming all rewritten resource to use CDN domain. Automation is bliss.
     
    • Agree Agree x 1
  14. eva2000

    eva2000 Administrator Staff Member

    30,921
    6,909
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,405
    Local Time:
    7:21 PM
    Nginx 1.13.x
    MariaDB 5.5
    Yeah use nearly all the filters too on this forum and centminmod.com site - theme design quirks/incompatibility permitting :D
     
  15. JarylW

    JarylW Active Member

    216
    40
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +102
    Local Time:
    5:21 PM
    Yeah pagespeed is good for when you cannot optimize the html/css/images at the application level. If it can be done pre production I think it would be the 'best case' scenario but not all apps allow that. :(
     
    • Agree Agree x 2