? Success

User tests: Successful: Unsuccessful:

avatar hans2103
hans2103
19 May 2014

http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33753&start=0

In PR #3397 user @andrewnester created the posibility for Redis Caching in Joomla. But it wasn't complete and there where some obsolete files included in the PR.
There for I've created a new pull request.

  • apply patch
  • go to Global Configuration >> System
  • notice cache handler "Redis" in the dropdown
  • select cache handler "Redis" and new config fields will appear
  • if needed apply config. (host, port and auth can vary at some hosting providers)
  • save configuration
  • refresh your website while keep an eye on the Redis monitor
  • if everything works well, you'll see that Redis caching will serve the website.

Credits to @andrewnester for the initial pull request. (forked from memcached)

avatar hans2103 hans2103 - open - 19 May 2014
avatar andrewnester
andrewnester - comment - 19 May 2014

@hans2103 @wilsonge what about throwing RuntimeException in this case?

avatar wilsonge
wilsonge - comment - 19 May 2014

Probably. Because when you initialise the class you then have to call isSupported before you do anything because you have no way of knowing what's going on. I'd do the isSupported check in the constructor before getting the connection - throw a RuntimeException if the class doesn't exist - meaning we can do a try/catch there. Then when you get the connection you can assume the class exists and don't need the duplicated check

avatar hans2103
hans2103 - comment - 19 May 2014

please provide your code suggestion and I will aply the improvement.

avatar hans2103 hans2103 - change - 31 May 2014
Title
implementation of Redis caching
[#33753] implementation of Redis caching
avatar hans2103 hans2103 - change - 31 May 2014
Title
implementation of Redis caching
[#33753] implementation of Redis caching
avatar jissereitsma
jissereitsma - comment - 31 May 2014

Checked the code on my own hosting environment (CentOS, PHP 5.4, PECL extension for Redis, and ofcourse Redis service running) and it turns out fine. When Redis is installed by default on a clean Linux environment, authentication is disabled. Enabling authentication anyway in the Joomla! configuration (using this patch) gives a warning in the backend. Using a wrong IP or port-number also generates a warning.

Tested succesfully.

avatar javigomez
javigomez - comment - 31 May 2014

@mbabker could you review this one? just because I'm having some trouble to review right now https://twitter.com/hans2103/status/472858924497240065

avatar mbabker
mbabker - comment - 31 May 2014

If folks with Redis can try testing this, that's good enough for me. It'd be great if the code style issues could be cleaned up before merge, but we can fix it if need be too.

avatar Bakual
Bakual - comment - 31 May 2014

Goes into 3.4-dev I guess?

avatar zanardigit
zanardigit - comment - 31 May 2014

@test
Test successful: I can see pages being served by REDIS cache server.
Notes:

  • on Ubuntu I had to 1) install redis server (apt-get install redis-server) and 2) install redis PHP library via PECL (pecl install redis)
avatar yireo
yireo - comment - 31 May 2014

Yes, 3.4-dev branch would be best because this is a complete new feature.

#codecompliance hmm, bummer. We are having too much beer here at jab14 and both @hans2103 as my own laptop here is lacking proper coding styles at this point. Let us know if it is an issue or not.

avatar mbabker
mbabker - comment - 31 May 2014

I can clean it up and merge it later tonight if it's tested well.

avatar hans2103
hans2103 - comment - 31 May 2014

I succesfully tested it on byte.nl where Redis PECL is installed
Francesco (@zanardigit) succesully tested on his local Joomla where Redis PECL is installed
Jisse (@yireo) succesfully tested it on hist local Joomla where Redis PECL is installed
Hope this is well enough

avatar mbabker mbabker - reference | 5a845d2 - 1 Jun 14
avatar mbabker
mbabker - comment - 1 Jun 2014

Merged for 3.4 at 5a845d2

avatar mbabker mbabker - change - 1 Jun 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-06-01 14:36:34
avatar mbabker mbabker - close - 1 Jun 2014
avatar mbabker mbabker - close - 1 Jun 2014
avatar huba80
huba80 - comment - 7 Nov 2015

Hi,

It seems to me that this is the most relevant "forum" to seek some help. I have Redis 3.0.3 installed on my VPS and I use Joomla 3.4.5. I tried to test Redis cache with http://tools.pingdom.com/fpt/ (website performance testing). I ran test multiple times. The result was very disappointing. If I selected Redis cache in Joomla config my website loaded in 4-6 seconds. When I turned off Redis cache in Joomla config the website loaded in about 3.5 sec. The site loaded faster without Redis or when I turned Redis off. I opened a thread in Joomla.org but no-one seems to be able to give advice or investigate this issue further. Lets say for them it is easier to recommend another caching system than solve, investigate this issue. I have a managed VPS at knownhost. Im very satisfied with them but as Im not a developer, programer I don't know how to check Redis config or log files. Could anyone help me here please? I cant believe that Redis gives such a poor performance. Something must be wrong.

Many thanks

avatar yireo
yireo - comment - 7 Nov 2015

Hi,

When you have such a delay, and you know that Redis is fast, the most logical conclusion is that your Joomla actually has no way to reach Redis with the current settings and hosting. Which settings are you using?

avatar huba80
huba80 - comment - 7 Nov 2015

Thanks for your answer.

What you mean by which setting Im using? What settings of mine do you want to know?
I tried to ask Joomla community but it looks like Redis is far not popular. This is why Im here. Im happy to do anything to check if everything is set properly.
In global config I just chose Redis cache and that's it. Redis is installed on my VPS and I think it gives a great performance to my other site using Magento. This is why I think there must be some problem with Joomla but no-one can (or want) to help.

avatar yireo
yireo - comment - 8 Nov 2015

As soon as you enable Redis, there are numerous settings appearing in your Joomla Global Configuration that need to be configured: Redis Server Host, Redis Server Port, Redis Database. What did you enter there? These details need to match the details of your Redis service.

You mentioned you "installed" Redis. Do you also mean that you actually configured Redis on your server to run as a service? Is Redis running? If so, you must know the port and database.

avatar huba80
huba80 - comment - 8 Nov 2015

Well...where to start.... As I mentioned earlier I have a managed VPS. The reason to be "managed" that Im just a simple website owner who has a busy website so I had to find a VPS. It is managed because "I don't know things". I don't know how to setup a VPS or install a program on VPS etc...
I asked my hosting provider to install Redis on my VPS. They did it but it wasn't easy. First off they asked me for Redis installation guide as they don't support 3rd party extensions. So They installed it on my VPS. As soon as it has been installed Redis option showed up in Joomla global config. Redis server host was automatically filled as "localhost" just as the port which is 6379. No other config has been added. Authentication (empty), Database (number zero). This is all my Joomla config. As far as I read online this config should be ok.
What Im not so sure about that is how Redis is configured on my VPS.
My hosting provider is not willing to dig into the problem because it is still a 3rd party extension which they don't support.
On Joomla forum no-one can help and they send me back to Redis. I wrote in Redis forum here:
https://www.reddit.com/r/redis/comments/3rk6ak/redis_303_with_joomla_345/
They send me back to ask Joomla. Everyone points at each other and no-one can really help.
I understand there is a documentation on Redis website but there are commands that I don't have a single clue of. So far that I could find out:

I run 2 commands in WHM.
The first is: redis-cli ping
Answer was: PONG
The second was:
redis-cli --latency -h host -p port
The answer was:
[root /]# redis-cli --latency -h host -p port Could not connect to Redis at -p:6379: Name or service not known [root /]#
I have also tried:
$ redis-cli
redis 127.0.0.1:6379> ping
Answer was:
[root /]# $ redis-cli redis 127.0.0.1:6379> ping [root /]#
Im not sure if I was doing everything right. Is this what I should have seen there?
Im on:
CENTOS 6.7 i686 virtuozzo – host WHM 11.52.0

I've also find a guide here:

http://www.varunpant.com/posts/how-to-set-up-redis-in-ubuntu-linux

There they say the redis.conf file should look similar to this:

daemonize yes
pidfile /var/run/redis.pid
logfile /var/log/redis.log
port 6379
bind 127.0.0.1
timeout 300
loglevel notice
##Default configuration options
databases 16
save 900 1
save 300 10
save 60 10000
rdbcompression yes
dbfilename dump.rdb
dir /tmp/redis/
appendonly no
glueoutputbuf yes

I checked my redis.conf file and there is not even port setting. Full of text but not much configuration.

I have concerns about Redis configuration file but Im unable to attach here.

avatar yireo
yireo - comment - 8 Nov 2015

The questions you are asking about Redis are actually not related to Joomla at all. The "redis-cli" output shows that your server is not running Redis as a service. You might have a PHP support for Redis clients, but if there is no Redis server available, it is like having PHP MySQL support without having a MySQL database server. Your hosting provider should provide you with Redis as a running service, or otherwise the work they have done now is pointless. If they are missing out on that point entirely, I recommend you switch hoster or hire somebody to setup the hosting for you, because Redis requires a system administrator to be setup. I don't think we can discuss this any further in this GitHub thread, because the issues you are having are not related to Joomla and/or the Redis support in Joomla that is offered here in this Pull Request. It is related to your server actually still not supporting Redis as a service.

Add a Comment

Login with GitHub to post a comment