1 min

Grebe blog tool using Redis versus Memcached

Oct 21, 2014

In small testing with my Grebe blogging app, I don't see much difference in page load times at http://webpagetest.org with my two different implementation of caching.

For gets:

Redis
Using Perl. I put the smarts within grebe.pl. The script checks URI and cookie info, and then decides to check cache by accessing the post from Redis.

Memcached
Using the Nginx Memcached module. The decision-making smarts about checking the URI and checking for cookie info and whether to check cache or not are used within the Nginx server block config file.

Sets will occur the same, regardless of which caching method is used.

The Nginx Memcached module appears to be slightly faster. The Memcached module was already contained with Nginx whereas I'll have to rebuild Nginx to embed the Nginx Redis module.

It would make sense for the Nginx Memcahed or the Nginx Redis modules to be faster since this get from the cache server occurs before my Perl script is started.

For my current Redis setup, I do not load my entire Grebe app until after it has been determined that cache is not to be used. In the grebe.pl script, I load the Redis module and my Config module, which loads the YAML module. Even with this small amount of Perl loaded, it should be a bit slower than have Nginx pull the cached page from the caching server.

But the difference is not a big as I thought it would be. So it may come down to where one wants to place the decision smarts for getting the cache page: in the Nginx config file or in the app's programming code.


memcached
http://www.webpagetest.org/result/141021_K0_13YM/
http://www.webpagetest.org/result/141021_9F_140Q/
http://www.webpagetest.org/result/141021_BG_14AN/
http://www.webpagetest.org/result/141021_6H_14DN/
http://www.webpagetest.org/result/141021_TG_14RX/

redis
http://www.webpagetest.org/result/141021_ZD_13Z8/
http://www.webpagetest.org/result/141021_23_1491/
http://www.webpagetest.org/result/141021_45_14CD/
http://www.webpagetest.org/result/141021_HR_14R0/
http://www.webpagetest.org/result/141021_2H_14SN/

Redis within Grebe

Through Oct 20, 2014

These modules and scripts used the Redis module.

  • lib / API / WriteTemplateMarkup.pm - set
  • lib / Client / ShowPost.pm - sets flag for Page.pm
  • lib / JRS / Page.pm - set
  • root / grebe.pl - get

From JR's : articles
332 words - 2306 chars - 1 min read
created on
updated on - #
source - versions



A     A     A     A     A

© 2013-2017 JotHut - Online notebook

current date: May 20, 2024 - 12:17 p.m. EDT