Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Redis Configuration Issues - Rate Topic   - - - - -

 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 1003 posts

Posted 24 November 2017 - 11:10 PM #1

Enabling Redis setting in the config.local.php file

// Cache backend
// Available backends: file, sqlite, database, redis, xcache, apc, apcu
// To use sqlite cache the "sqlite3" PHP module should be installed
// To use xcache cache the "xcache" PHP module should be installed
// To use apc cache the "apc" PHP module should be installed
// To use apcu cache the PHP version should be >= 7.x and the "apcu" PHP module should be installed
$config['cache_backend'] = 'file';
$config['cache_redis_server'] = 'localhost';
$config['cache_redis_global_ttl'] = 0; // set this if your cache size reaches Redis server memory size

// Storage backend for sessions. Available backends: database, redis
$config['session_backend'] = 'database';
$config['session_redis_server'] = 'localhost';
$config['cache_apc_global_ttl'] = 0;
$config['cache_xcache_global_ttl'] = 0;

If I change 'file' at line 118 to 'redis' my store closes.

Not sure why but on my server when I lookup if Redis is enabled I see this
 

# for phpver in $(ls -1 /opt/cpanel/ |grep php | sed 's/ea-php//g') ; do echo "PHP $phpver" ; /opt/cpanel/ea-php$phpver/root/usr/bin/php -i |grep "Redis Support" done
 
PHP 55
Redis Support => enabled
PHP 56
Redis Support => enabled
PHP 70
Redis Support => enabled
PHP 71
Redis Support => enabled

 

So why does CS Cart V4.6.3 not work with redis as backend cache ?

 

 


running CS Cart V4.10.3.SP1 


 
  • poppedweb
  • Authorized Reseller
  • Members
  • Join Date: 02-Aug 16
  • 553 posts

Posted 25 November 2017 - 06:54 AM #2

Enabling Redis setting in the config.local.php file

// Cache backend
// Available backends: file, sqlite, database, redis, xcache, apc, apcu
// To use sqlite cache the "sqlite3" PHP module should be installed
// To use xcache cache the "xcache" PHP module should be installed
// To use apc cache the "apc" PHP module should be installed
// To use apcu cache the PHP version should be >= 7.x and the "apcu" PHP module should be installed
$config['cache_backend'] = 'file';
$config['cache_redis_server'] = 'localhost';
$config['cache_redis_global_ttl'] = 0; // set this if your cache size reaches Redis server memory size

// Storage backend for sessions. Available backends: database, redis
$config['session_backend'] = 'database';
$config['session_redis_server'] = 'localhost';
$config['cache_apc_global_ttl'] = 0;
$config['cache_xcache_global_ttl'] = 0;

If I change 'file' at line 118 to 'redis' my store closes.

Not sure why but on my server when I lookup if Redis is enabled I see this
 

# for phpver in $(ls -1 /opt/cpanel/ |grep php | sed 's/ea-php//g') ; do echo "PHP $phpver" ; /opt/cpanel/ea-php$phpver/root/usr/bin/php -i |grep "Redis Support" done
 
PHP 55
Redis Support => enabled
PHP 56
Redis Support => enabled
PHP 70
Redis Support => enabled
PHP 71
Redis Support => enabled

 

So why does CS Cart V4.6.3 not work with redis as backend cache ?

 

It works for me just fine, maybe try using the store_prefix feature. This is located in the config.local.php.

 

This makes sure when you have multiple CS-Cart installations and just one redis engine that the sessions do not merge with eachother / override eachother.

 

Also, you could try flushing the redis cache, as it could be possible that it reached its storage limit.


PoppedWeb | sales@poppedweb.com | https://poppedweb.com
TurnKey Website Design | Add-Ons | Performance Audits | Dedicated Server Management
24/7 Support | Response within an hour (during working hours).

 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 1003 posts

Posted 25 November 2017 - 09:44 AM #3

It works for me just fine, maybe try using the store_prefix feature. This is located in the config.local.php.

 

This makes sure when you have multiple CS-Cart installations and just one redis engine that the sessions do not merge with eachother / override eachother.

 

Also, you could try flushing the redis cache, as it could be possible that it reached its storage limit.

 

What should this store_prefix be ?? what goes in between the quotation marks ?


running CS Cart V4.10.3.SP1 


 
  • poppedweb
  • Authorized Reseller
  • Members
  • Join Date: 02-Aug 16
  • 553 posts

Posted 25 November 2017 - 09:47 AM #4

What should this store_prefix be ?? what goes in between the quotation marks ?

 

You can decide for your own, in your case pasio would be a fitting prefix.


PoppedWeb | sales@poppedweb.com | https://poppedweb.com
TurnKey Website Design | Add-Ons | Performance Audits | Dedicated Server Management
24/7 Support | Response within an hour (during working hours).

 
  • Flow
  • Super Duper and Amazingly Sexy Senior
  • Members
  • Join Date: 13-Oct 10
  • 2394 posts

Posted 25 November 2017 - 12:03 PM #5

You can decide for your own, in your case pasio would be a fitting prefix.

 

I'd love to know if you think redis is faster? My host suggested it as well but I read cs-cart currently recommends file.


When life hands you lemons, bring on the Tequila baby!


 
  • poppedweb
  • Authorized Reseller
  • Members
  • Join Date: 02-Aug 16
  • 553 posts

Posted 25 November 2017 - 12:09 PM #6

I'd love to know if you think redis is faster? My host suggested it as well but I read cs-cart currently recommends file.

 

Yes Redis is way faster, this is because of the fact that it stores everything in the RAM. Also using Redis for the sessions instead of the database should give a significant boost as it allows for quicker access and is less intensive on the server itself.


PoppedWeb | sales@poppedweb.com | https://poppedweb.com
TurnKey Website Design | Add-Ons | Performance Audits | Dedicated Server Management
24/7 Support | Response within an hour (during working hours).

 
  • mazter
  • Senior Member
  • Members
  • Join Date: 04-Apr 12
  • 275 posts

Posted 25 November 2017 - 03:08 PM #7

No disrespect but I never saw any difference between sqlite, database, redis, xcache, apc etc. I used all of them and monitored via paid Pingdom account for changes. The delay with CS-Cart is caused by CS-Cart's own logic of querying Database for many times for the same information. They never retain the data and try to reuse it. Session storage is dismal so it makes no significant difference where you see a drop from 900ms TTFB to 300ms TTFB. It is more like 900ms down to 880ms if it is.



 
  • mazter
  • Senior Member
  • Members
  • Join Date: 04-Apr 12
  • 275 posts

Posted 25 November 2017 - 03:16 PM #8

Perfect example that I just pulled from my Admin panel debug screen. ?debug=1

 

CS-Cart runs two redundant queries that causes 1.06 seconds delay. What if these queries were combined into one query? Would save 0.5 seconds. You won't save this much by tweaking any settings in config.local.php.

 

Test it with yours, you will see the same results. Instead of optimizing their logic and code, they will tell me to dump data in my cscart_logs table. That is the only source of information for what's going on in my store why do I need to dump it? You change logic and write better software........

115 SELECT COUNT(DISTINCT(cscart_logs.log_id)) FROM cscart_logs LEFT JOIN cscart_users USING(user_id) WHERE 1 AND (cscart_logs.timestamp >= 1508940693 AND cscart_logs.timestamp <= 1511622693) 0.54437
116 SELECT cscart_logs.*, cscart_users.firstname, cscart_users.lastname FROM cscart_logs LEFT JOIN cscart_users USING(user_id) WHERE 1 AND (cscart_logs.timestamp >= 1508940693 AND cscart_logs.timestamp <= 1511622693) ORDER BY cscart_logs.timestamp desc, cscart_logs.log_id desc LIMIT 0, 10 0.52371


 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 1003 posts

Posted 25 November 2017 - 08:22 PM #9

Well for what is worth I tried pasio as my prefix but still the store when closed upon me. Not sure why actually, I did not stick around to enable the debug mode. Poppedweb (Harm) has pointed me in other ways to reduce our page loading times. It is now between 1.2 and 2.5 sec


running CS Cart V4.10.3.SP1 


 
  • mariush
  • Newbie
  • Trial users
  • Join Date: 21-Apr 20
  • 2 posts

Posted 23 April 2020 - 05:22 PM #10

Well for what is worth I tried pasio as my prefix but still the store when closed upon me. Not sure why actually, I did not stick around to enable the debug mode. Poppedweb (Harm) has pointed me in other ways to reduce our page loading times. It is now between 1.2 and 2.5 sec

Can you share those other ways?



 
  • Bart-PDX
  • Member
  • Members
  • Join Date: 12-Jun 17
  • 25 posts

Posted 25 November 2020 - 11:10 AM #11

Hi,

 

I am trying to test redis on my site but am running into problems. I get the error "Fatal error: Uncaught RedisException: Connection refused"

 

In local_config.php (this is on a test site) i have added:

 

// Storage backend for sessions. Available backends: database, redis
$config['session_backend'] = 'redis';
$config['session_redis_server'] = 'localhost';
$config['cache_apc_global_ttl'] = 0;
$config['cache_xcache_global_ttl'] = 0;

// Set to unique store prefix if you use the same Redis/Xcache/Apc storage
// for serveral cart installations
$config['store_prefix'] = 'pdx';

 

I have multiple store domains on the server pointing to one database. I'm not quite sure how the store_prefix config setting should be setup. I can see redis listed when i check my phpinfo file so i guess it is setup ok.

 

What could be causing the connection to be refused?