William Jiang

JavaScript,PHP,Node,Perl,LAMP Web Developer – http://williamjxj.com; https://github.com/williamjxj?tab=repositories

PHP APC vs. Memcached

PHP APC vs. Memcached

APC is Alternative PHP Cache. I used some of PHP Memcached in projects but not APC.
By reading the PHP APC documents, I found it even more easy to use than Memcached.
According to PHP documents:

  • Memcached if you need to preserve state across several web servers (if you’re load balanced and it’s important that what’s in the cache is the same for all servers).
  • APC if you just need access to quick memory to read (& write) on a (or each) server.

Remember APC can also compile and speed up your script execution time. So you could for example be using APC for increased execution performance, while using memcached for cache storage.

PHP Performance APC + Memcached

In my CentOS server, the config is at: /etc/php.d/apc.ini:

; Enable apc extension module
extension = apc.so
// and can be viewed at:
$ php -r 'phpinfo();' |grep apc

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: