2014WordPress ultimate 6 times acceleration

Source: Internet
Author: User
Tags apc wordpress version
Since everyone is so fond of WordPress, I will share some of my experiences! For the sake of real-time proof, I specifically downloaded a newly clean WP plug-in which it is not installed. APC closed to open the default homepage 1. the original WP, the execution time is between 0.60-0.67 seconds 2. use me

Since everyone is so fond of WordPress, I will share some of my experiences!

In order to prove it, I download a newly clean WP.

No plug-ins are installed. APC is disabled.

Open the default homepage

1. original WP, execution time between 0.60-0.67 seconds

2. in my way, the page execution time is increased to 0.15-0.20 seconds.

Then, open the APC

1. the execution time of the original WP is increased0.29-0.38Seconds

2. in my way, the page execution time is increased0.04-0.05Seconds

Performance increased by 6 times

If you don't talk about caching, it's all bad. caching is not a solution, and caching always needs to expire.

I will not talk about other optimization methods.

Especially, the performance can be improved a lot.

Make wordpress fast and use good memory

The following two PHP extensions are available:

1. apc

2. zend opcache

I tested the performance and started them.

Then, put all wp php files in the memory.

For example, if your wordpress directory is in/var/www/wp

The method is as follows:

1. copy a wp

Cp-rf/var/www/wp/var/www/wp2

2. delete non-php files

Cd/var/www/wp2

Find.-type f | grep-v ". php" | xargs rm-f

4. put it in the memory

Cp-rf/var/www/wp2/dev/shm

5. You can delete all php files in the original directory.

Cd/var/www

Find.-type f | grep ". php" | xargs rm-f

Now, we have filtered out all php files in the wp directory and put them all in the memory.

Last step

6. Configure nginx

Server {

Listen 80;

Server_name 21andy.com www.21andy.com;

Root/var/www/wp;

Index index.html index. php;

Location /{

Try_files $ uri/index. php;

}

Location ~ *. Php $ {

Fastcgi_index index. php;

Fastcgi_pass unix:/dev/shm/php-fpm.sock;

Fastcgi_param SCRIPT_FILENAME/dev/shm/wp/$ fastcgi_script_name;

Include fastcgi_params;

}

}

7. restart nginx and php-fpm!

After separating the latest wordpress version

Php files 8.4 MB in total, all in the memory

Other files: 4.7 MB

Do not install the plug-in after the heat

If you want to install it, you need to separate it.

Address: http://www.21andy.com/new/20131220/2161.html

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.