Configuration Optimization enables your PHP engine to run at full speed. As a popular Web programming language, the biggest advantage of php (as the mainstream development language) is speed. Php (as the mainstream development language) 4 has already done very well in this aspect as a popular Web programming language. The biggest advantage of php (as the mainstream development language) is speed. Php (as the mainstream development language) 4 is already doing very well in this aspect, and you can hardly find a script programming language faster than it. However, if your application load is large, and the bandwidth is small, or there are other bottlenecks that affect your server performance, you may wish to try out some prescriptions I have prescribed for you, check whether it is a lab.
I. code optimization
When it comes to code optimization, you may think of neat and clear code, but this article does not mean it here, because if you want to seek speed, it is necessary to adjust the source code of php (as the mainstream development language) accordingly. In general, it is to remove unnecessary comments and make the code unreadable. However, this is incredible for a good programmer. Fortunately, Zend Technologies has released the Zend optimization engine to help you do this. It is free now, but you must follow the Zend Optimizer license. This product can optimize the intermediate code generated by the engine.
It is relatively simple to install this engine. after downloading the version of the corresponding platform, uncompress the compressed file and use php (as the mainstream development language ). add the following two lines to the ini file and restart the Web server.
Zend_optimizer.optimization_level = 15
Zend_extension = "/path/to/ZendOptimizer. so"
Zend_loader.enable = Off
If it is a Win32 platform, it should be:
Zend_optimizer.optimization_level = 15
Zend_extension_ts = "C: pathoendOptimizer. dll"
Zend_loader.enable = Off
Ah! Not wrong, right? How are three rows? In fact, the third row is optional. Because it seems that turning zend_loader off can improve the speed, it is worth putting this third line in php (as the mainstream development language). ini. Note that you are not using Zend encryption.
II. Buffering
If we want to further speed up, we need to consider using the buffer technology. There are some optional solutions, including Zend Cache (test version), APC, Afterburner Cache, and jpCache.
These are the buffer modules. the intermediate code generated by php (as the mainstream development language) file requests is stored in the memory of the Web server, and a "compiled" version is returned for future requests. Because this reduces disk read/write and all work in the memory, this process can significantly improve application performance,
There are many ready-made products. who should I choose?
Zend Cache is a good commercial product. after loading those huge php (as the mainstream development language) pages for the first time, you will obviously feel the speed improvement, the server sets aside more resources. It is a pity that this product is for silver, but in some cases, you should not be stingy with the silver.
Afterburner Cache is a product of Bware Technologies and is currently in Beta version. it seems to be the same as Zend Cashe, but it cannot achieve the same effect as Zend Cache and cannot work with Zend optimization engine, but it is free, so I use this module.
APC (Alternative php (as the mainstream development language) Cache) is another free module released by Community Connect. it seems that it can be used in the production environment.
Web content compression
For an increasingly crowded network, saving bandwidth is just like saving water. According to IETF standards, most browsers should support gzip compressed content. In other words, you can send the content compressed with gzip to the browser, and the browser will transparently decompress the data.
Mod_gzip is a free apache (the most popular WEB server platform on Unix) module released by Remote Communications. it can compress static Web content and send it to browsers. This module is suitable for most static web pages. Although
Remotecommunications said that this module supports all the dynamic content generated by mod_php (as the mainstream development language), mod_perl, and mod, but it still does not seem to work, from the mail list of mod_gzip, it is estimated that this problem can be solved only by 1.3.14.6f.
If you want to compress the dynamic content, you can use class.gzip _ encode. php (as the mainstream development language), a php (as the mainstream development language) class used at the beginning and end of the script. For the entire website, the function is called in php (as the mainstream development language). ini auto_prepend and auto_append. For details, you can read the program of this class. this program is well annotated and the author tells you almost everything. However, before using it, your php (as the mainstream development language) should be compiled to support zlib.
Velocity Web programming language. The biggest advantage of php (as the mainstream development language) is speed. Php (as the mainstream development language) 4 has already done very well in this aspect...