Words Zendopcache and APC

Source: Internet
Author: User
Tags apc apcu zend

What's the difference between APC and Zendopcache
Http://www.laruence.com/2013/03/18/2846.html

Click ( here ) to collapse or open

    1. 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.


    2. 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.


    3. This raises the question of what to do with the opcode cache, which uses the Zend o+, and the APC user Data cache.


    4. 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

    1. 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.


    2. 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.


    3. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.