memcached installation

memcached installation

by Noveck Gowandan -
Number of replies: 1
Before I proceed with my question, I should define my environment.

Webserver1-----Webserver2
|
|
|
DB/Datafiles

All servers run CentOS 5, and Moodle 1.7.7 (soon to be upgraded to 1.9)

I already have eaccelerator installed on both webservers, as well as most of the applicable tweaks on the webservers and the database server as mentioned here: http://docs.moodle.org/en/Performance

I see memcache was recommended for install alongside eaccelerator.
My Question is, where exactly do i install memcache to?
The webservers or the database server?

My Reason for asking is that I did a successful memcached install on a test environment, however, the database and the apache is on the same machine. I also had to install the php-pecl-memcache on this test machine before i got it to work.

Are there any memcache tweaks or tips I should be aware of? Did some research, buit I couldnt find anything specific to Moodle.


This is how I installed memcached on centos 5, and the settings used.


1. go to temp directory:
cd /tmp


2. download dag repo which has memcached
wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-*****.rpm

(check here for releases: http://dag.wieers.com/rpm/packages/rpmforge-release/)
***** - rpmforge-release-0.3.6-1.rh9.rf.i386.rpm used for this test

3. install rpm
rpm --install rpmforge-release-*****.rpm (see above note)

4. install memcached
yum install --enablerepo=rpmforge memcached

5. install php-memcache extension
yum install php-pecl-memcache (dag not needed for this extension)

6. create configuration file

nano /etc/sysconfig/memcached
I used the following settings

PORT="11211"
USER="memcached"
# max connection 2048
MAXCONN="2048"
# set ram size in MB
CACHESIZE="512"
# listen to loopback ip 127.0.0.1, for network connection use real ip e.g., 10.0.0.4
OPTIONS="-l 127.0.0.1"

7. Start memcached and set to start at boot.
chkconfig memcached on
service memcached start


Tips and advice welcomed.

Thanks all,
-n

Average of ratings: -
In reply to Noveck Gowandan

Re: memcached installation

by Noveck Gowandan -
Follow up:
I saw that memcached has a lot of API's - including php and mysql.

In my case with two webservers and the single db server;
should I install the memcache alongside eaccelerator on the webservers AND on the DB server?

or should I leave eaccelerator alone on the front-end and install memcache on the backend alone

Thanks for the assistance.

Regards,
-n