What's the difference between APC and Zendopcache
Http://www.laruence.com/2013/03/18/2846.html
Click ( here ) to collapse or open
-
In the past, many people would have chosen to use APC, In addition to the opcode cache, APC provides a set of user data caches (apc_store/apc_fetch), so there is no problem with APC for many students who need to use the user data cache.
-
-
However, recently Zend Optimizer plus open source, the test shows that Zend o+ in opcode cache, because the opcode cache optimization, so it is more efficient than APC, Later, PHP5.5 has Zend o+ as part of the source code. will be published along with PHP.
-
-
This raises the question of what to do with the opcode cache, which uses the Zend o+, and the APC user Data cache.
-
-
At the beginning, I just added a switch apc.opcode_cache_enable to APC, so that the user could use APC to close the opcode cache for this purpose, However, APC's user data cache uses the same storage mechanism as the opcode cache, which requires data to be strictly correct, so locks are much more, and tests show that APC's user data cache is almost as efficient as local memcached.
What is opcode
http://www.nowamagic.net/librarys/veda/detail/1325
Click ( here ) to collapse or open
-
OpCode is part of a computer directive, Used to specify the action to be performed, the format and specification of the instruction is specified by the directive specification of the processor. In addition to the instruction itself, there is usually an operand required by the instruction, and there may be instructions that do not require an explicit operand. These operands may be the value in the register, the value in the stack, the value of a block of memory, or the value in the IO port, and so on.
-
-
Usually opcode there is another appellation: bytecode (byte codes). For example, Java Virtual Machine (JVM),. NET Common Intermediate language (Cil:common intermeditate Language) and so on.
-
-
php opcode is in the previous introduction, PHP is built on the Zend virtual machine (Zend VM). php's opcode is the instruction in the Zend virtual machine.
Simply put,
Both APC and Zendopcache can do opcode cache, but ZendOpcache is much more efficient than APC, so it can be used Zend opcache do opcode cache with ZendOpcache
However, APC provides an additional user Data Cache, and ZendOpcache does not provide, in order for these two to be used in a non-conflicting, shut down apc opcode The cache function can be used together.
So the APC set apc.enable_opcode_cache=0 can be used with Zendopcache.
this What is the User Data cache, which should be a static variable or something like that?
Because PHP is like a daemon Java language, there is no real static variables, when the type of static variables are required,
For example, the game server id,ip, such as rarely updated information can be stored in this area, eliminating the repeated reading of the database.
In addition, APC has removed the opcode cache function and renamed APCU at 5.5, meaning that only the user cache is available, but 5.5 can also be used with an APC patch.
In the php5.6 need to use APCU directly, no one in the patch APC to php5.6
This article is from the "Half City" blog, please be sure to keep this source http://vabc1314.blog.51cto.com/2164199/1844762
Words Zendopcache and APC