User tests: Successful: Unsuccessful:
Greetings!
I have implemented a cache handler for Redis storage. It uses PHP Redis extension or Predis PEAR package if any of these are available. It also adds 2 global configuration options for Redis Host IP/Socket and Redis Port.
Only had a chance to test on Windows.
References:
Predis: https://github.com/nrk/predis
PHP Redis Extension: https://github.com/nicolasff/phpredis
JoomlaCode Tracker: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=32099&start=0
(updated by brian with the corrected tracker link)
Do you also want to send this to the Framework?
Definitely yes, I'll do a pool request for joomla-framework with unit-tests over the new couple of days.
Yes, I am aware of that, but is it capable of autoloading classes from PEAR?
I had checked how the other cache handler - Cache_Lite do it. Please take a look here
https://github.com/joomla/joomla-cms/blob/master/libraries/joomla/cache/storage/cachelite.php#L329
It can handle PEAR classes as well. The Cache_Lite handler was implemented before the PSR-0 compatible auto loader was available in core.
Oh, and I also noticed this is relying on a PEAR installation of Predis. Is that the only way to get it or is it also available via composer? I almost think we should just do a check to see if the classes exist, and not worry about setting up an auto loader. I'm not sure, maybe someone with more experience with cache (@eddieajau?) can offer their opinion.
Yeah, let's throw an exception if the dependency is not available.
Just on a side note Don, has FIG sorted out the PSR for Cache yet?
Ok then. I must've been doing something wrong so it didn't work automatically. Let me spent some more on it.
And yes it is available from composer.
@eddieajau FIG has not sorted it out yet fully, but it is moving along still. There's talk it might be finalized for a vote by the end of the year.
How about... to make things easier just check for the extension and ignore Predis completely, like in the pr I've submitted to the framework. Extension is about 20%-30% faster on my laptop, the only reason I added Predis is that I've been using it for a while and it was pretty stable until I switched to the ext.
I think people who search for Performance with Redis won't have any issues with installing (Windows: downloading) the extension.
If you decide to implement both predis and phpredis, please make sure you auto-select the fastest one or let us pick :).
In my experience, it's common to have both the PEAR and PECL packages installed at the same time as different apps will connect to Redis using one or the other.
Labels |
Added:
?
|
Status | New | ⇒ | Pending |
Labels |
Removed:
?
|
Status | Pending | ⇒ | Closed |
Set to "closed" on behalf of @zero-24 by The JTracker Application at issues.joomla.org/joomla-cms/2078
We have allready a Implementation of Redis caching
#3615 @WooDzu can you have a look into it and change / update with a PR against staging if needed?
Thanks
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-12-27 15:42:00 |
The port is configurable, it uses 6379 by default if noting is configured in Joomla's Global Configuration.
So this is actually the same like for setting up Memcache(d) handler