Learn about Centmin Mod LEMP Stack today
Register Now

Redis Redis for PageSpeed?

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

  1. BobbyWibowo

    BobbyWibowo Active Member

    197
    42
    28
    Jul 30, 2015
    Indonesia
    Ratings:
    +71
    Local Time:
    1:30 PM
    1.17.x
    10.3.x
    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

    54,946
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    4:30 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Unfortunately ngx_pagespeed doesn’t support redis cache yet only memcached cache
     
  3. buik

    buik “The best traveler is one without a camera.”

    2,027
    524
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,675
    Local Time:
    7:30 AM
  4. eva2000

    eva2000 Administrator Staff Member

    54,946
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    4:30 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yeah it's on the books
     
  5. JarylW

    JarylW Active Member

    216
    41
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +103
    Local Time:
    2:30 PM
  6. eva2000

    eva2000 Administrator Staff Member

    54,946
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    4:30 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  7. buik

    buik “The best traveler is one without a camera.”

    2,027
    524
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,675
    Local Time:
    7:30 AM
  8. eva2000

    eva2000 Administrator Staff Member

    54,946
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    4:30 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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. buik

    buik “The best traveler is one without a camera.”

    2,027
    524
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,675
    Local Time:
    7:30 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
  10. pamamolf

    pamamolf Premium Member Premium Member

    4,087
    428
    83
    May 31, 2014
    Ratings:
    +834
    Local Time:
    8:30 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    People need automation that's why :)

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

    eva2000 Administrator Staff Member

    54,946
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    4:30 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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. buik

    buik “The best traveler is one without a camera.”

    2,027
    524
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,675
    Local Time:
    7:30 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

    197
    42
    28
    Jul 30, 2015
    Indonesia
    Ratings:
    +71
    Local Time:
    1:30 PM
    1.17.x
    10.3.x
    To be fair, I use lots of the filters. Including combining CSS and renaming all rewritten resource to use CDN domain. Automation is bliss.
     
  14. eva2000

    eva2000 Administrator Staff Member

    54,946
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    4:30 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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
    41
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +103
    Local Time:
    2:30 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. :(
     
  16. rdan

    rdan Well-Known Member

    5,447
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    2:30 PM
    Mainline
    10.2
    Any idea how can I use unix socket with XenForo?
    'server' => 'unix:///tmp/redis.sock',
    Doesn't work for me.

    Thanks!
     
  17. eva2000

    eva2000 Administrator Staff Member

    54,946
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    4:30 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Probably best to ask Xenforo folks to be sure :)