Jump to content

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

memcached Rate Topic   * - - - - 1 votes

 
  • RSW
  • Senior Member
  • Members
  • Join Date: 11-Nov 09
  • 175 posts

Posted 10 December 2009 - 02:07 AM #1

Has anyone tried to use memcached with CS-Cart?
http://www.memcached.org/

Can anyone give me an idea as to what would be required to integrate its usage?

This could really speedup/optimize the system I think.

 

Posted 10 December 2009 - 04:01 PM #2

Checkout: http://forum.cs-cart...=smartoptimizer
Custom Web Design, Development and Professional Web Hosting

Jonah Coyote Design

 
  • RSW
  • Senior Member
  • Members
  • Join Date: 11-Nov 09
  • 175 posts

Posted 11 December 2009 - 03:39 PM #3

I have setup the smartoptimizer as suggesting in the link... it has done a great done of speeding pages via caching, however I am interested in memcache since my understanding is that it takes caching a little further by caching data requests.
I know many major sites are using this as their solution.
Would it be difficult to implement into CS-Cart?

 
  • Offline
  • Member
  • Members
  • Join Date: 13-Oct 09
  • 85 posts

Posted 09 April 2012 - 12:38 AM #4

The holiday weekend made our sites really busy and the slow site became unusable for our customers. I found a PHP/Mysql expert who fixed the problem for me. I wanted to share his final fix. This is the best preformance enhancer for cs-cart I have ever found!

We have 49,000+ products and good traffic to the site. It seems the session data has a tendency to lock up the database because it was over 500,000 rows. We moved the session data to memchache and my load average went from 5.0 to 10.0 down to .50 .

1. install memcache
yum install memcached

2. when it done. checking version and working.
memcached -h

3. Starting it.
/etc/init.d/memcached restart

4. edit memcache settings.
vi /etc/sysconfig/memcached

5. Allow to use 1Gb of ram for caching.
CACHESIZE="1024"

6. add memcached to server startup
/sbin/chkconfig memcached on

7. installing pecl php extenision for memcached.
wget http://pecl.php.net/...cache-3.0.6.tgz
tar -xzf memcache-3.0.6.tgz
cd memcache-3.0.6
phpize
./configure
make
make install
vi /etc/php.d/memcache.ini
write there (extension=/usr/lib64/php/modules/memcache.so)
check it working with command (php -i | grep mem) you will see output about installed extension.
And restart apache with "/etc/init.d/httpd restart"

8. Go to php code of site.

find file core/class.session.php
there find function set_params()

and there rows like:
ini_set('session.cookie_path', ((!empty($current_path))? $current_path : '/'));
ini_set('session.gc_divisor', 10); // probability is 10% that garbage collector starts

add after it:
ini_set('session.save_handler','memcache');
ini_set('session.save_path','127.0.0.1:11211');

after it sfind function init()

there comment Session::set_handlers(); must look like

Session::set_params();
//Session::set_handlers();
Session::start();

Chris Edwards

 
  • solesurvivor
  • Senior Member
  • Members
  • Join Date: 05-Aug 11
  • 745 posts

Posted 09 April 2012 - 01:53 AM #5

Where does, 127.0.0.1:11211 come
From? I'm by sure what is at port 11211.

Also how much of a load difference did it make for you?

What version of cscart are you using?

 
  • Gizmo
  • Junior Member
  • Members
  • Join Date: 05-Jan 09
  • 141 posts

Posted 24 July 2012 - 08:29 PM #6

At this point I get errors on the homepage.

and there rows like:
ini_set('session.cookie_path', ((!empty($current_path))? $current_path : '/'));
ini_set('session.gc_divisor', 10); // probability is 10% that garbage collector starts

add after it:
ini_set('session.save_handler','memcache');
ini_set('session.save_path','127.0.0.1:11211');

after it sfind function init()

there comment Session::set_handlers(); must look like

Session::set_params();
//Session::set_handlers();
Session::start();
[center]www.vapeking.co.za[/center]

 
  • sertaconay
  • Member
  • Members
  • Join Date: 29-Dec 11
  • 18 posts

Posted 02 May 2013 - 08:46 AM #7

I guess you can't act on behalf of user with this configuration.

 
  • websmart
  • Junior Member
  • Members
  • Join Date: 11-Feb 10
  • 75 posts

Posted 16 April 2014 - 03:27 PM #8

The holiday weekend made our sites really busy and the slow site became unusable for our customers. I found a PHP/Mysql expert who fixed the problem for me. I wanted to share his final fix. This is the best preformance enhancer for cs-cart I have ever found!

We have 49,000+ products and good traffic to the site. It seems the session data has a tendency to lock up the database because it was over 500,000 rows. We moved the session data to memchache and my load average went from 5.0 to 10.0 down to .50 .

1. install memcache
yum install memcached

2. when it done. checking version and working.
memcached -h

3. Starting it.
/etc/init.d/memcached restart

4. edit memcache settings.
vi /etc/sysconfig/memcached

5. Allow to use 1Gb of ram for caching.
CACHESIZE="1024"

6. add memcached to server startup
/sbin/chkconfig memcached on

7. installing pecl php extenision for memcached.
wget http://pecl.php.net/...cache-3.0.6.tgz
tar -xzf memcache-3.0.6.tgz
cd memcache-3.0.6
phpize
./configure
make
make install
vi /etc/php.d/memcache.ini
write there (extension=/usr/lib64/php/modules/memcache.so)
check it working with command (php -i | grep mem) you will see output about installed extension.
And restart apache with "/etc/init.d/httpd restart"

8. Go to php code of site.

find file core/class.session.php
there find function set_params()

and there rows like:

ini_set('session.cookie_path', ((!empty($current_path))? $current_path : '/'));
ini_set('session.gc_divisor', 10); // probability is 10% that garbage collector starts

add after it:
ini_set('session.save_handler','memcache');
ini_set('session.save_path','127.0.0.1:11211');

after it sfind function init()

there comment Session::set_handlers(); must look like

Session::set_params();
//Session::set_handlers();
Session::start();


Hello Chris,
Could you provide the PHP/Mysql expert who fixed the problem for you contact info?
I'm very interested in getting this fix

Thanks