Deploying xcache in centos improves script compilation Efficiency

Source: Internet
Author: User

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/36/6B/wKioL1OrmM_C7NcVAAUCaHKIRmk820.jpg "Title =" xcache-ini.png "alt =" wkiol1ormm_c7ncvaaucahkirmk8w.jpg "/>

When Improving the Performance of websites or network applications, there is usually opcode. xcache, as an open-source opcode cache optimizer, can greatly improve the PHP Execution speed, the official promotion range is 2-5 times. The compiled opcdoe is put into the shared memory to avoid tedious compilation every time, currently, xcache supports the release of all current PHP branches. I will install xcache IN THE centos environment. After the installation is complete, no special call is required unless the variable object is cached, xcache is not recommended for variable caching. The installation steps are relatively simple.

Step 1

Connect to SSH and enter the server

Step 2

Check the version to check whether xcache has been installed.

Php-V

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/36/72/wKiom1OrmZTgRm-FAAY1WM9AdUE448.jpg "Title =" php-v.png "alt =" wKiom1OrmZTgRm-FAAY1WM9AdUE448.jpg "/>

Or you can use the code by editing the PHP file.

Phpinfo ();

Check whether the xcache version exists on the search page. If no xcache version exists above, it indicates that xcache has not been installed on the server, so proceed to the next step.

Step 3

Install the latest xcache version.

Wget http://xcache.lighttpd.net/pub/Releases/3.1.0/xcache-3.1.0.tar.gz

Tar-zxvf xcache-3.1.0.tar.gz

CD xcache-3.1.0

Phpize

./Configure -- enable-xcache

Make & make install

Run the command line by line.

Step 4

VI/etc/PHP. ini

Open the php. ini configuration file and copy the following code to the bottom,

[Xcache-common]

; Change me-64 bit PHP =>/usr/lib64/PHP/modules/xcache. So

Extension =/usr/lib64/PHP/modules/xcache. So

; 32 bit PHP =>/usr/lib/PHP/modules/xcache. So

; Zend_extension =/usr/lib64/PHP/modules/xcache. So

[Xcache. admin]

Xcache. admin. Auth = on

; Xcache. admin. User = here is the user name

Xcache. admin. User = "mingkr"

; Xcache. admin. Pass = the MD5 encrypted password here

Xcache. admin. Pass = "ce9fc75bd0275562a293fa78e00781f1"

[Xcache]

The opcode of xcache. shm_scheme script is stored in MMAP in memory.

Xcache. shm_scheme = "MMAP"

; Xcache. Size indicates the size of the shared cache.

Xcache. size = 128 m

Xcache. Count = 1

Xcache. Slots = 8 K

Xcache. TTL = 3600

Xcache. gc_interval = 300

The above is the cache opcode configuration. If you need to use xcache to store variable data in the memory, refer to the following. We recommend that you use memcache instead of Data Object Storage.

Xcache. var_size = 0 m

Xcache. var_count = 1

Xcache. var_slots = 8 K

Xcache. var_ttl = 0

Xcache. var_maxttl = 0

Xcache. var_gc_interval = 300

; N/A for/dev/zero

Xcache. readonly_protection = off

Xcache. mmap_path = "/dev/Zero"

Xcache. cacher = on

Xcache. Stat = on

Repeat Step 2 to check whether the xcache is successfully installed.

Next, let's talk about how to manage and detect xcache execution and memory usage online.

Reference URL: http://mingkr.com/centos-xcache





This article is from the "Ming ke" blog, please be sure to keep this source http://mingkr.blog.51cto.com/8524905/1431112

Related Article

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.