EAccelerator module and test comparison of php

Source: Internet
Author: User
EAccelerator is a free and open source php accelerator. It optimizes and dynamically caches content, improves the cache performance of php scripts, and completely eliminates the server overhead when PHP scripts are compiled. It also optimizes scripts to accelerate execution efficiency. Improve your PHP code execution efficiency by 1-10 times

1. what is eAccelerator? What is the purpose?

EAccelerator is a free and open source php accelerator. It optimizes and dynamically caches content, improves the cache performance of php scripts, and completely eliminates the server overhead when PHP scripts are compiled. It also optimizes scripts to accelerate execution efficiency. Improve the code execution efficiency of your PHP program by 1-10 times;

II,EAccelerator installation and configuration

For more information about the installation method, see

Http://blog.51yip.com/php/177.html

Vi/usr/local/php/lib/php. ini

Zend_extension = "eaccelerator. so"

[Eaccelerator]

Eaccelerator. shm_size = "32" note: Shared memory size;
Eaccelerator. cache_dir = "/var/ecache" note: cache directory;
Eaccelerator. enable = "1"
Eaccelerator. optimizer = "1"
Eaccelerator. check_mtime = "1"
Eaccelerator. debug = "0"
Eaccelerator. filter = ""
Eaccelerator. shm_max = "0"
Eaccelerator. shm_ttl = "0"
Eaccelerator. shm_prune_period = "0"
Eaccelerator. shm_only = "0"
Eaccelerator. compress = "1"
Eaccelerator. compress_level = "9"

After configuration, restart apache or other services. go to phpinfo () and check the configuration.

EAccelerator
EAccelerator support Enabled
Version 0.9.5.3
Caching Enabled True
Optimizer Enabled True
Memory Size 33,554,396 Bytes
Memory Available 17,141,280 Bytes
Memory Allocated 16,413,116 Bytes
Cached Scripts 216
Removed Scripts 0
Cached Keys 0

Installed successfully. Just click two php files and check the results. I don't think it is as fast as possible. Haha.

Eaccelerator. cache_dir = "/var/ecache" note: cache directory;

Go to the directory and check what is in it.

A hexadecimal folder is generated.

III. Comparison of eAccelerator

1), test the php file

View copy print?
  1. $ Con = mysql_connect ("localhost", "dbadmin ","********");
  2. If (! $ Con)
  3. {
  4. Die ('could not connect: '. mysql_error ());
  5. }
  6. Mysql_select_db ("test", $ con );
  7. Mysql_query ('set names utf8 ');
  8. $ Result = mysql_query ("SELECT * FROM test3 ");
  9. While ($ row = mysql_fetch_array ($ result ))
  10. {
  11. Echo $ row ['A3 ']. "+". $ row ['AAA'];
  12. Echo" ";
  13. }
  14. Mysql_close ($ con );
  15. ?>
 ";}mysql_close($con);?>

2), there areResults of the eAccelerator module

3 ),NoneResults of the eAccelerator module

I personally think there is not much difference. this is just a test, because the file is easy to write and there is little data in the data table, which may be the reason for no difference. But it is difficult to see how many times it will be.

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.