PHP opcode cache: APC details

Source: Internet
Author: User
Tags apc apc configuration

Preface

Compared with other compiled languages, the performance of PHP is not outstanding, but the performance improvement is obvious after the opcode cache is used. common examples include eaccelerator, xcache, and APC. This document mainly introduces the use of APC.

 

APC Introduction

The alternative PHP cache (APC) is a free and open opcode cache for PHP. Its goal is to provide a free, open, and robust framework for caching and optimizing PHP intermediate code.

APC Official Website: http://www.php.net/manual/en/book.apc.php

Windows under the latest version of: http://downloads.php.net/pierre/

Download link: The http://downloads.php.net/pierre/php_apc-3.1.4-5.3-VC6-x86.zip uses the corresponding DLL based on your PHP build

 

APC Configuration

APC configuration mainly describes the configuration in windows and the configuration in Linux.ArticleMany

1. Download php_apc.dll to the PHP ext directory.

2. Modify PHP. ini to add extension = php_apc.dll

Add configuration items at the end of PHP. ini

; APC setting
[APC]
; An error will be reported when stat is enabled.
; APC. Stat = 0
APC. Enabled = "1"
APC. shm_segments = "1"
The problem here is that the default memory configuration for Windows 7 is changed. Do you know if you have any problems?
; APC. shm_size = "128"
; APC. TTL = 7200
; APC. user_ttl = 7200
; Corrected metric data
APC. TTL = "300"
APC. user_ttl = "300"
APC. num_files_hint = "1024"
APC. mmap_file_mask = "E:/Wamp/tmp/APC. xxxxxx"
APC. enable_cli = "1"

3. Restart the Apache server and check whether the APC configuration item exists in phpinfo. If yes, the configuration is successful.

 

APC control panel, control files from APC-3.1.4.tgz

 

APC cache Performance Comparison

Before cache is used

After cache is used

 

FAQs:

1. What is the cache Clearing Problem for opcode under fcgi?

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.