bondimedical Posted October 27, 2016 Share Posted October 27, 2016 We already use a number of databases on Redis. How do I specify to use a particular one, say 9 and do we only need to specify 1 database? Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted October 27, 2016 Share Posted October 27, 2016 You have to create a second parameter in the global.inc.php file and @Al Brookbanks has updated the caching documentation (although that page talks about "redis_options" and I believe that this should be "redis_params") https://support.cubecart.com/Knowledgebase/Article/View/235/41/how-do-i-enable-apc-memcached-or-xcache So for example you can pass one or more parameters via redis_params and any not passed will use the default $glob['cache'] = 'redis'; $glob['redis_params']=array('parameters' => array('database' => 1)); Ian Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted October 27, 2016 Share Posted October 27, 2016 Ian your version is out of date. Please see: https://support.cubecart.com/Knowledgebase/Article/View/235/41/how-do-i-enable-apc-memcached-redis-or-xcache This relates to: https://github.com/cubecart/v6/blob/master/classes/cache/redis.class.php#L32-L38 $glob['redis_params'] is not valid. I noticed yesterday on my dev store that the payment options don't show with Redis so we may have a bug somewhere. Not seen any other issues though. Personally I don't like it at all and I don't think Redis is suitable for storing the types of data CubeCart needs it to. These are predominantly objects and arrays. The PHP serialize function to get around this is poor and unreliable. Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted October 27, 2016 Share Posted October 27, 2016 Hadnt gone back to testing since the original version and while I saw you were supporting Sentinal, hadnt noticed the change to the params / options parameter ! Good job only on a few test sites so far then ! The problem is that "files" method is significantly slower so an in memory based method should always be used. APC and Xcache are effectively dead and while many people are still using memcache, the memcache and memcached libraries havent been updated in four / five years. Redis is actively developed and has a huge number of features that none of the other options have ever had. Redis is widely considered to be much superior to Memcache and is the recommended option for all Magento sites (although Full Page and Session Cache options in addition are also available making it even more attractive) and Magento isnt that different ? Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted October 27, 2016 Share Posted October 27, 2016 I'm still new to Redis. CubeCart needs to mainly store objects and arrays which Redis isn't geared up to taking. I don't know how other systems use it but I expect we need to manipulate the data prior to store rather than using the PHP serialize funciton to save it as a string. This cache system is very new and still WIP. Storing arrays in Redis: http://stackoverflow.com/questions/22718903/storing-an-array-of-data-using-redis-from-laravelhttp://stackoverflow.com/questions/22001247/redis-how-to-store-associative-array-set-or-hash-or-listhttp://stackoverflow.com/questions/38747339/how-to-store-array-of-objects-in-redis I don't think any of those solutions are very good. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 27, 2016 Share Posted October 27, 2016 3 hours ago, bondimedical said: We already use a number of databases on Redis. How do I specify to use a particular one, say 9 and do we only need to specify 1 database? I posted a GitHub issue that is apparently Redis related. https://github.com/cubecart/v6/issues/1310 Quote Link to comment Share on other sites More sharing options...
bondimedical Posted October 27, 2016 Author Share Posted October 27, 2016 What is the meaning of the sentinels and options parameters and which one do we use to specify a database, options? Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted October 28, 2016 Share Posted October 28, 2016 CubeCart is using the predis library. All the config info is here: https://github.com/nrk/predis/blob/v1.1/README.md Quote Link to comment Share on other sites More sharing options...
bondimedical Posted October 28, 2016 Author Share Posted October 28, 2016 I have just started using it and configured it to use database 10 with: $glob['redis_options'] = array('parameters' => array('database' => 10)); But I don't see any keys in the database? Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted October 28, 2016 Share Posted October 28, 2016 Ian is probably more help here than me. Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted October 28, 2016 Share Posted October 28, 2016 I developed the integration with redis installed locally with default config which I didn't even look at. I did know that they could be changed in the class constructor so I added the ability to add these settings via the global file. Looks like you are on the right lines. Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted November 4, 2016 Share Posted November 4, 2016 On 10/28/2016 at 8:36 AM, bondimedical said: I have just started using it and configured it to use database 10 with: $glob['redis_options'] = array('parameters' => array('database' => 10)); But I don't see any keys in the database? I agree - there looks like a problem with the implementation of redis as all keys are being stored in DB0 regardless of what is specified in the redis_options parameter. I will work with Al to try and get this fixed Quote Link to comment Share on other sites More sharing options...
bondimedical Posted November 4, 2016 Author Share Posted November 4, 2016 Please let me know when this is fixed. Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted November 4, 2016 Share Posted November 4, 2016 https://github.com/cubecart/v6/issues/1340 Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted December 2, 2016 Share Posted December 2, 2016 I can confirm that this is now working using the latest redis cache class file and once it is configured correctly. Tested with three different CubeCart installations on one server each having their own database defined - now just to get session and full page cache methods implemented and this will be a far, far superior caching method than anything else Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.