[Resolved] APC Locking Question

Status
Not open for further replies.

semprot

Well-Known Member
#1
This is not related with litespeed, but i hope i can find the answer here.

I am installing APC in new server using steps described here
Code:
http://www.inmotionhosting.com/support/website/php-configuration/install-apc-for-php
It is successfully installed, but i notice there is difference between APC in my old server & new server.

Both use APC 3.1.13.

In old server :
  • In "Shared Memory", it is said "1 Segment(s) with 9.0 GBytes (mmap memory, pthread read/write Locks locking)".
  • There is no "apc.shm_strings_buffer".

In new server :
  • In "Shared Memory", it is said "1 Segment(s) with 9.0 GBytes (mmap memory, pthread mutex Locks locking)".
  • There is "apc.shm_strings_buffer = 4M", even though i do not define it in php.ini, so it should be automatically added?

My questions :
  1. About the locking which one is better? And if "mutex" is worse, how can i change "mutex" to "read/write" ?
  2. Should i set "apc.shm_strings_buffer" to something larger? My shm_size is 9G.

And in my old server i use PHP 5.3.28, and in new server i use PHP 5.4.36, i don't know if this php version matters to the differences above?

Thank you.
 

NiteWave

Administrator
#2
it's not recommended to use apc with php 5.4 and above

1) http://pecl.php.net/package/apc
3.1.13 -- still beta, Release Date 2012-09-03, 2+ years ago.

2) http://www.sitepoint.com/understanding-opcache/
"the APC cache won’t work with the newest PHP versions. It doesn’t support PHP 5.5 at all.It’s not advised to install it on PHP 5.4 either, as it has been reported that such configuration can lead to execution errors that break the whole application. Just check the Wikipedia article on PHP accelerators or this Stack Overflow thread to get some details."
 

semprot

Well-Known Member
#3
it's not recommended to use apc with php 5.4 and above

1) http://pecl.php.net/package/apc
3.1.13 -- still beta, Release Date 2012-09-03, 2+ years ago.

2) http://www.sitepoint.com/understanding-opcache/
"the APC cache won’t work with the newest PHP versions. It doesn’t support PHP 5.5 at all.It’s not advised to install it on PHP 5.4 either, as it has been reported that such configuration can lead to execution errors that break the whole application. Just check the Wikipedia article on PHP accelerators or this Stack Overflow thread to get some details."
Do you think it worths to stuck to 5.3 just to use APC?
Or it's better to use 5.4 or 5.5 with xcache?

Which one is faster?
  • 5.3 with APC,
  • or 5.4 with xcache

Thank you.
 
Last edited:

semprot

Well-Known Member
#5
php 5.4/5.5 should be faster than 5.3
you may try Opcache as well. compare which one is faster for your site --- xcache or opcache
I read in your link that opcache doesn't support variable caching..
I think i will try xcache, or maybe apcu, with php 5.4.

Thank you for the help. :)

Update: i've changed from APC to xcache. Seems work fine :)
 
Last edited:
Status
Not open for further replies.
Top