ZendCache makes your site fly

Source: Internet
Author: User
Tags gz file
ZendCache to make your site fly, read ZendCache to make your site fly, Xue Qikang (xqk@163.net) commercial applications of the website, its transmission efficiency is very important, usually on some e-commerce sites, the response speed of the server determines its service quality, and the load of the server determines its maximum accessible capacity to customers. Technicians always want to "> <LINKhref =" http: // w

Xue Qikang (xqk@163.net)


The transmission efficiency of commercial websites is very important. in some e-commerce websites, the response speed of servers determines the service quality, the load of the server determines its maximum accessible capacity to customers. Technicians always try to increase the server response speed as much as possible. ZendCache is also an excellent product developed to speed up server response. Data proves that ZendCache can increase the server response speed to more than 300%.

 

I. What is ZendCache?

Let's take a look at how php runs. after a php script is sent to the server, the server searches for the corresponding file from the disk, compiles the script, runs the script, and finally sends the result. The time spent consists of searching for files, opening files, reading files, and compiling files. ZendCache is a php script high-speed Cache that stores the compilation results of the php script file that has just been executed in the memory of the Web server. if someone requests this page again next time, it can be sent out quickly. This eliminates the time required for the server to compile a script every time the user requests the php file. At the same time, it does not take time to search for and read php files from the disk. Therefore, the server speed can be greatly improved.

Currently, ZendCache can only run on Linux (glibc 2.1), Solaris 2.6, FreeBSD 3.4, and 4.0. Unfortunately, it does not support Windows systems currently.

II. install and use ZendCache

Register a user on zend.com, log on to zend.com, and download http://www.zend.com/store/products/zend-cache.php at the following address. Because zendCache is a software program that requires membership dues, we can only download a trial version with a limited date available for 30 days. However, zendCache is a full-featured software package. Try it. you can experience its powerful functions. To download the trial version, select Test drive available.

The entire download involves three steps. Step 1: Download the ZendCache package and directly select the software package for the corresponding platform from "Supported Platforms. Pay attention to the applicable platform of the software, the corresponding php version, and the type of the class library.

The second step is "Request Product License", that is, to obtain authorization from zend.com. you are required to provide the Host ID of your machine, that is, the MAC address of the NIC on your computer, zend.com provides a tool for reading the host Nic address. you can download an lmutil from zend.com. z. after decompression, run it to obtain the Nic address of the computer. Execution method:

#./Lmutil lmhostid

To obtain the host ID. You can also find the MAC address of the NIC from/var/log/messages.

Enter this ID number in the form for applying for the license, select "request", and wait patiently. Zend.com will send you an email within 48 hours to notify you to download your license. After receiving the email, go to http://www.zend.com/store/pickup.php to download it. License is a file named zend_cache.dat.

Installation (this article takes installation in linux as an example)

Decompress the zendcache-11_12.16.0.0-php_4.0.4-linux_glibc2.1-i386.tar.gz file

# Tar-zxvf zendcache-11_12.16.0.0-php_4.0.4-linux_glibc2.1-i386.tar.gz

# Cd ZendCache-1 [1]. 0.0-PHP_4.0.4-Linux_glibc2.1-i386

# Cp *. so/usr/local/Zend/lib

Copy zend_cache.dat to the/usr/local/Zend directory.

 

Edit the php. ini file and add the following lines:

; Start of sample Zend Cache configuration section

Zend_cache.use_cwd = 1

Zend_cache.memory_consumption = 64; 64 MB

Zend_cache.validate_timestamps = 1

Zend_extension =/usr/local/lib/ZendCache. so

; End of sample Zend Cache configuration section

Restart the apache server. Make the changes take effect.

Edit a simple php file test. php in the htdocs Directory of the Web server. the content is as follows:

<?

Phpinfo ();

?>

Then, type http: // localhost/test. php in the browser

If the second part of the screen appears

This program makes use of the Zend scripting language engine:
Zend Engine v1.x. x, Copyright (c) 1998-2000 Zend Technologies
With Zend Cache v1.x. x, Copyright (c) 1999-2000, by Zend Technologies

It indicates that ZendCache is working properly. The rest is to see its Cache hit effect.

III. test ZendCache hit rate

Some php code is released along with the ZendCache package, which intuitively shows the ZendCache hit effect. Simply copy the cache_gui sub-directory to the htdocs Directory of the Web server. In the url bar of the browser, type http: // localhost/cach_gui/index.html to see the Cache hit effect. As shown in, the hit after zendCache is installed by the author:

 


If the graph in the browser is not displayed and prompts that the GD module in the PHP compilation does not support the display of png images, you have to compile php again to enable the GD module to support the png graphic display. Articles on how to compile PHP to support png can be searched online, which is not described in this article. If you do not know whether your PHP supports png, you can use the phpinfo () function. Generally, if png is not supported during compilation, GD does not support png by default.

 

Note: If ZendOptimizer is used at the same time, you should place the above lines after ZendOptimizer, otherwise your Apache server will not start.

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.