Home  >  Article  >  Backend Development  >  ZendCache makes your site fly_PHP tutorial

ZendCache makes your site fly_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 16:58:27720browse

Transmission efficiency is very important for commercial application websites. Usually on some e-commerce sites, the response speed of the server determines the quality of its service, and the load of the server determines the maximum number of services it can provide to customers. access capacity. Technicians are always looking for ways to improve server response speed as much as possible. And zendcache is an excellent product developed to improve the response speed of the server. Data confirms that using zendcache can increase the server's response speed to more than 300% of the original.

1. What is zendcache

Let’s first look at how PHP runs. After a request PHP script is sent to the server, the server searches for the corresponding file on the disk, first compiles the script, then executes it, and finally sends the result. The time spent consists of finding the file, opening the file, reading the file, and compiling the file. zendcache is a high-speed cache for PHP scripts. It can store the compiled results of the PHP script file just executed in the memory of the web server. If someone requests this page again next time, it can send it out quickly. This eliminates the time it takes for the server to compile the script every time the user requests a php file. At the same time, the time spent searching and reading PHP files from the disk is eliminated. Therefore, the corresponding speed of the server can be greatly improved.

Currently zendcache can only run on linux (glibc 2.1), solaris 2.6 or above, freebsd 3.4 and 4.0. Unfortunately, it currently does not support Windows systems.

2. Install and use zendcache

Register a user on zend.com, log in to zend.com as this user, and then download http://www.zend.com/store/products/zend-cache.php from the following address. Since zendcache is a software that requires membership fees, we can only download a trial version with a limited date that can be used for 30 days. However, it is a fully functional software package. Give it a try and you can experience its powerful features. To download its trial version, directly select "test drive available" to download.

The entire download is divided into three steps. The first step is to download the zendcache software package and directly select the software package for the corresponding platform from "supported platforms". Pay attention to the applicable platform of the software and the corresponding PHP version and class library type.

The second step is to "request product license", which is to obtain authorization from zend.com and require the user to provide the host ID of his machine, which is the mac address of the computer's network card. zend.com provides a tool to read the host network card address. Users can download a small program called lmutil.z from zend.com, decompress it and execute it to obtain the computer's network card address. Execution method:

# ./lmutil lmhostid

You can get the host ID. In addition, users can also find the mac address of the network card from /var/log/messages.

Fill this ID number into the license application form, select "request", and wait patiently. zend.com will send you an email within 48 hours to notify you that you can download your own license. After receiving the email, go directly to http://www.zend.com/store/pickup.php to download. The license is a file named zend_cache.dat.

Installation (this article uses installation in the Linux environment as an example)

​Decompress the zendcache-1[1].0.0-php_4.0.4-linux_glibc2.1-i386.tar.gz file

#tar 

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631413.htmlTechArticleFor commercial application websites, its transmission efficiency is very important. Usually on some e-commerce sites, the server The response speed determines its service quality, and the server load determines it...
Statement:
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