Home Backend Development PHP Tutorial A brief analysis of PHP's apc extension (1)

A brief analysis of PHP's apc extension (1)

Jul 29, 2016 am 09:15 AM
apc cache nbsp php

I finally generated the apc.so extension file under php5.5, and I can’t wait to test apc. With the apc.so file, it is easy to make php support apc. Open the configuration file php in use. .ini, just add extension=apc.so, restart the web server (if using nginx, restart php-fpm) to make it take effect, and then use phpinfo() to check whether it has taken effect.

Before official use, we need to copy a file named apc.php in the source code folder of apc to the root directory of the website being used. This file displays various indicators of the current apc in the form of a web page. This allows us to observe the running process of apc more intuitively. There are only two places in this file that we need to change, one is the login account and the other is the login password. The purpose of the account and password will be explained in detail when used.

defaults('ADMIN_USERNAME','username');         // Admin Username
defaults('ADMIN_PASSWORD','password');         // Admin Password - CHANGE THIS TO ENABLE!!!
Copy after login
When we visit apc.php, the following interface (partial) will appear. "Refresh Data" is the refresh data, and "Version Check" is the version check. It is not the focus of our concern. What we need to care about is "View Host Stats", "System Cache Entries" and "User Cache Entries".

A brief analysis of PHPs apc extension (1)

First let's take a look at "View Host Stats". This option is used to display the host's statistical information, which is divided into "General Cache Information", Let's look at the "File Cache Information", "User Cache Information", "Runtime Settings", "Host Status Diagrams", and "Detailed Memory Usage and Fragmentation" one by one

"General Cache Information": About. An overall introduction to apc cache, including a series of information such as apc version, php version, apc host information, etc.

"File Cache Information": Describes system cache-related information. If conditions permit, apc will automatically cache all files. When the user visits the visited PHP page again, the cache file will be read first, and the detailed information of the cache file is recorded in "System Cache Entries". Here is a statistics on the system cache, Cached Files. (Number and size of cached files), Hits (number of cache hits), Misses (number of cache misses), Request Rate (hits, misses) (request rate, including hits and misses), Hit Rate (request hit rate), Miss Rate (request miss rate), Insert Rate (unknown), Cache full count (number of times the cache exceeds the upper limit). Through this information, we can understand the hit status of the system cache, whether the cache content exceeds the upper limit, and then make corresponding adjustments according to the situation.

A brief analysis of PHPs apc extension (1)

“User Cache Information”: Describes user cache related information. Different from system cache, user cache requires users to manually store and call with the help of apc_add, apc_store, app_fetch and other functions. Cached Variables (number and size of cached variables), other information descriptions have the same meaning as the descriptions in the system cache.

A brief analysis of PHPs apc extension (1)

Summary:

1 The apc.php file needs to change the user name and password

2 APC has two major functions: system cache - automatically cache php files, user cache - manual cache php variables

3 Cached Files( Variables) can let us know the number and size of cached variables. Rate related parameters let us know the request hit rate. Cache full count lets us know that the memory allocated for apc is not enough and needs to be adjusted.

The above has introduced a brief analysis of PHP's apc extension (1), including various aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

In this chapter, we are going to learn the following topics related to routing ?

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

CakePHP Creating Validators CakePHP Creating Validators Sep 10, 2024 pm 05:26 PM

Validator can be created by adding the following two lines in the controller.

See all articles