Installed APC ...how do I know if it's working?

Ok then, can you check in your php.ini file if there are any settings for APC?

Should look something like this:
Code:
extension=apc.so
apc.enabled=1
apc.shm_size=128M
apc.shm_segments=1
apc.ttl=7200
apc.user_ttl=7200
apc.gc_ttl=3600
apc.enable_cli=1
apc.stat=1
 
; new settings added in v1.2.2-eva2000.16
apc.optimization=0
apc.num_files_hint=4096
apc.user_entries_hint=4096
apc.localcache=1
apc.localcache.size=2048
apc.slam_defense=0
apc.write_lock=1
apc.include_once_override=0
 
Ok then, can you check in your php.ini file if there are any settings for APC?

Should look something like this:
Code:
extension=apc.so
apc.enabled=1
apc.shm_size=128M
apc.shm_segments=1
apc.ttl=7200
apc.user_ttl=7200
apc.gc_ttl=3600
apc.enable_cli=1
apc.stat=1
 
; new settings added in v1.2.2-eva2000.16
apc.optimization=0
apc.num_files_hint=4096
apc.user_entries_hint=4096
apc.localcache=1
apc.localcache.size=2048
apc.slam_defense=0
apc.write_lock=1
apc.include_once_override=0
I've got only this line, and I added that one myself after install of APC.
extension=apc.so
 
Looks like you will be using all the default settings then. How much RAM do you have available? My dev site is running a single instance of XF, and it all fits inside 64MB of APC space, but I've given it 128M as you can see from my config above.
 
Looks like you will be using all the default settings then. How much RAM do you have available? My dev site is running a single instance of XF, and it all fits inside 64MB of APC space, but I've given it 128M as you can see from my config above.
The VPS is configured with 2 Gb RAM.
 
Sorry, David I'm not familiar with VPS set-ups - Matt, would David be able to use Libmemcachd on a VPS with 2GB (and would it be worth the effort to install it)?

Cheers,
Shaun :D
 
Should be OK setting it to use 256M of memory then.

So add this to php.ini under extension=apc.so

Code:
extension=apc.so
apc.enabled=1
apc.shm_size=256M
apc.shm_segments=1
apc.ttl=86400
apc.user_ttl=86400
apc.gc_ttl=3600
apc.enable_cli=1
apc.stat=1
apc.optimization=0
apc.num_files_hint=4096
apc.user_entries_hint=4096
apc.localcache=1
apc.localcache.size=2048
apc.slam_defense=0
apc.write_lock=1
apc.include_once_override=0

Then restart apache.
 
Sorry, David I'm not familiar with VPS set-ups - Matt, would David be able to use Libmemcachd on a VPS with 2GB (and would it be worth the effort to install it)?

Cheers,
Shaun :D
Yes, I had it running on my VPS before I removed it all and migrated everything to Xcache.
 
My notes when I installed it on CentOS5.8

Have to install these PECL extensions manually, so we can set the options when doing the configure on them.

Code:
wget https://launchpad.net/libmemcached/1.0/1.0.10/ download/libmemcached-1.0.10.tar.gz
 
tar -xzvf libmemcached-1.0.10.tar.gz
 
cd libmemcached-1.0.10

libmemcached wouldn't compile by default:

Code:
root@vps [~/memcache/libmemcached-1.0.10]# make
make  all-am
make[1]: Entering directory `/root/memcache/libmemcached-1.0.10'
  CXX    libhashkit/libhashkit_libhashkit_la-aes.lo
  CXX    libhashkit/libhashkit_libhashkit_la-algorithm.lo
  CXX    libhashkit/libhashkit_libhashkit_la-behavior.lo
  CXX    libhashkit/libhashkit_libhashkit_la-crc32.lo
  CXX    libhashkit/libhashkit_libhashkit_la-digest.lo
  CXX    libhashkit/libhashkit_libhashkit_la-encrypt.lo
  CXX    libhashkit/libhashkit_libhashkit_la-fnv_32.lo
  CXX    libhashkit/libhashkit_libhashkit_la-fnv_64.lo
  CXX    libhashkit/libhashkit_libhashkit_la-function.lo
  CXX    libhashkit/libhashkit_libhashkit_la-has.lo
  CXX    libhashkit/libhashkit_libhashkit_la-hashkit.lo
  CXX    libhashkit/libhashkit_libhashkit_la-jenkins.lo
  CXX    libhashkit/libhashkit_libhashkit_la-ketama.lo
  CXX    libhashkit/libhashkit_libhashkit_la-md5.lo
  CXX    libhashkit/libhashkit_libhashkit_la-murmur.lo
  CXX    libhashkit/libhashkit_libhashkit_la-one_at_a_time.lo
  CXX    libhashkit/libhashkit_libhashkit_la-str_algorithm.lo
  CXX    libhashkit/libhashkit_libhashkit_la-strerror.lo
  CXX    libhashkit/libhashkit_libhashkit_la-string.lo
  CXX    libhashkit/libhashkit_libhashkit_la-nohsieh.lo
  CXXLD  libhashkit/libhashkit.la
  CXX    libmemcached/csl/libmemcached_libmemcached_la-context.lo
In file included from ./libmemcached/common.h:72,
                from ./libmemcached/csl/common.h:40,
                from libmemcached/csl/context.cc:38:
./libmemcached-1.0/memcached.h:46:27: error: tr1/cinttypes: No such file or directory
make[1]: *** [libmemcached/csl/libmemcached_libmemcached_la-context.lo] Error 1
make[1]: Leaving directory `/root/memcache/libmemcached-1.0.10'
make: *** [all] Error 2

I so needed to install the below:

Code:
yum install gcc44.x86_64 gcc44-c++.x86_64
export CC=/usr/bin/gcc44
export CXX=/usr/bin/g++44

It would then let me configure it.

Code:
./configure
make
make install

Then add the memcached.so to php.ini, and restart apache. I also removed memcache.so as this was going to be replacing it.

Change the Xenforo config to use Libmemcached as the cache handler

Code:
vim /home/worthy/public_html/forum/library/config.php

There are extra things which can be applied against memcached, so I removed the WHM version, and manually installed it from PECL. Igbinary and JSON

Igbinary has been installed via WHM.

Code:
pecl download memcached
tar -xzvf memcached-2.1.0.tgz
cd memcached-2.1.0
phpize
./configure --enable-memcached-igbinary
make
make install

I then downloaded the JSON pecl module, configured that:

Code:
pecl download json
tar -xzvf json-1.2.1.tgz
cd json-1.2.1
phpize
./configure
make
make install

I then recompiled memcached

Code:
cd ../memcached-2.1.0
make clean
./configure --enable-memcached-igbinary --enable-memcached-json
make
make install

added the igbinary.so and json.so extension to php.ini

Code:
vim /usr/lib/php.ini

Restarted apache and memcache

Code:
/etc/init.d/httpd restart
/etc/init.d/memcached restart

I've also installed phpmemcacheadmin in place of the memcache.php file

Code:
mkdir memcached
cd memcached/
wget http://phpmemcacheadmin.googlecode.com/files/phpMemcachedAdmin-1.2.2-r262.tar.gz
tar -xvzf phpMemcachedAdmin-1.2.2-r262.tar.gz
tar -xvzf phpMemcachedAdmin-1.2.2-r262.tar.gz
chmod +r *
chmod 0777 Config/Memcache.php
 
Should be OK setting it to use 256M of memory then.

So add this to php.ini under extension=apc.so

Code:
extension=apc.so
apc.enabled=1
apc.shm_size=256M
apc.shm_segments=1
apc.ttl=86400
apc.user_ttl=86400
apc.gc_ttl=3600
apc.enable_cli=1
apc.stat=1
apc.optimization=0
apc.num_files_hint=4096
apc.user_entries_hint=4096
apc.localcache=1
apc.localcache.size=2048
apc.slam_defense=0
apc.write_lock=1
apc.include_once_override=0

Then restart apache.
I will test this later today. :) Thanks!
 
Is it because I'm running an older version? Installing with Pecl failed when it tried to compile...
Code:
/usr/include/php5/ext/pcre/php_pcre.h:29:18: fatal error: pcre.h: No such file or directory
compilation terminated.
make: *** [apc.lo] Error 1
ERROR: `make' failed
apt-get install libpcre3-dev should sort that if you are on ubuntu or debian.
 
Top Bottom