Lamp and lnmp acceleration and cache optimization (ii)

Source: Internet
Author: User
Tags zts pkill

Start configuration software, specific software installation, can see lamp and lnmp Acceleration and cache optimization (i.)

VI /application/php/lib/php.ini

LaMP

extension_dir = "/application/php5.3.27/lib/php/extensions/no-debug-zts-20090626/"

Extension = memcache.so//Add

Extension = pdo_mysql.so

Extension = imagick.so

/application/apache/bin/apachectl Restart

LNMP

extension_dir = "/application/php5.3.27/lib/php/extensions/no-debug-non-zts-20090626/"

Extension = memcache.so

Extension = pdo_mysql.so

Extension = imagick.so

Pkill PHP-FPM//restart

/application/php/sbin/php-fpm

Vim index.php

<?php

Phpinfo ();

?>

Go to the home page, ctrl+f search memcache pdo_mysql imagickto see if there are

Configuring the Eaccelerator Cache directory

Mkdir-p/tmp/eaccelerator can be used with TMPFS memory file system or solid state drive

Chown-r Nginx.nginx /tmp/eaccelerator

Chown-r www.www /tmp/eaccelerator


Cat >> /application/php/lib/php.ini<<eof

[Eaccelerator]

Extension=eaccelerator.so

Eaccelerator.shm_size= "64"

Eaccelerator.cache_dir= "/tmp/eaccelerator"

eaccelerator.enable= "1"

Eaccelerator.optimizer= "1"

Eaccelerator.check_mtime= "1"

eaccelerator.debug= "0"

Eaccelerator.filter= ""

eaccelerator.shm_max= "0"

Eaccelerator.shm_ttl= "3600"

eaccelerator.shm_prune_period= "3600"

eaccelerator.shm_only= "0"

eaccelerator.compress= "1"

Eaccelerator.compress_level= "9"

Eof

#/application/php/bin/php-v

PHP 5.3.27 (CLI) (BUILT:APR 3 2016 22:23:16)

Copyright (c) 1997-2013 the PHP Group

Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies

With eaccelerator v0.9.6, Copyright (c) 2004-2010 eaccelerator, by Eaccelerator

Module is in effect


# ls/tmp/eaccelerator/

0 1 2 3 4 5 6 7 8 9 a B c D E F

find/tmp/eaccelerator/-type F//No files, not yet cached


/application/apache/bin/apachectl Restart//Restart service Apache

find/tmp/eaccelerator/-type F

/tmp/eaccelerator/3/8/eaccelerator-86746.765166//cache is available


KILL-USR2 ' cat/app/logs/php-fpm.pid '//restart Nginx

find/tmp/eaccelerator/-type F

/tmp/eaccelerator/e/3/eaccelerator-86746.763441

Supplemental: kill-9 Process number killall-9 process number Pkill process name

#ps-ef | grep php-fpm | awk ' {print $} ' | Xargs Kill

/application/php/sbin/php-fpm

# Ps-ef |  grep php-fpm | awk ' {print ' kill ' $ ' | Bash

Eaccelerator and XCache two, choose one.

VI Xcache-1.3.2/xcache.ini

3 ; Zend_extension =/usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so//commented out

6 ; Zend_extension_ts = c:/php/extensions/php_xcache.dll//commented out

8 Extension = xcache.so//uncomment no spaces before

Xcache.size = 128M

Xcache.count = 2//cpu core number Cat/proc/cpuinfo |grep-c processor

Xcache.ttl = 86400

Xcache.gc_interval = 3600

Approx. xcache.var_size = 0


Cat Xcache-1.3.2/xcache.ini >> /application/php/lib/php.ini //Append

/application/php/bin/php-v

PHP warning:cannot Load module ' XCache ' because conflicting module ' eaccelerator ' is already loaded in Unknown on Li NE 0 //There will be conflicting errors

need to comment out the previous Eaccelerator restart service

Pressure test


This article is from the "what-all" blog, please be sure to keep this source http://hequan.blog.51cto.com/5701886/1770388

Lamp and lnmp acceleration and cache optimization (ii)

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.