centos要安装imagick 首先安装ImageMagick

yum install -y ImageMagick ImageMagick-devel

然后安装imagick

wget http://pecl.php.net/get/imagick-3.4.3.tgz
tar zxvf imagick-3.4.3.tgz
cd imagick-3.4.3
/usr/local/php/bin/phpize
./configure –with-php-config=/usr/local/php/bin/php-config
make
make install

安装成功后写入php.ini并重启

/usr/local/php/etc/php.ini
extension=imagick.so

/etc/init.d/php-fpm reload

php-imagick的安装

[client]
port = 3306
socket = “D:/mysql/mysql.sock”

[mysqld]
port= 3306
socket = “D:/mysql/mysql.sock”
basedir = “D:/mysql”
tmpdir = “D:/tmp”
datadir = “D:/mysql/data”
pid_file = “mysql.pid”
key_buffer = 64M
max_allowed_packet = 512M
sort_buffer_size = 5120K
net_buffer_length = 256K
read_buffer_size = 1024K
read_rnd_buffer_size = 5120K
myisam_sort_buffer_size = 256M
log_error = “mysql_error.log”
lower_case_table_names=1

plugin_dir = “D:/mysql/lib/plugin/”

server-id = 1

innodb_data_home_dir = “D:/mysql/data”
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = “D:/mysql/data”
innodb_buffer_pool_size = 256M
innodb_additional_mem_pool_size = 32M

innodb_log_file_size = 640M
innodb_log_buffer_size = 64M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
wait_timeout = 2880000
interactive_timeout = 2880000

[mysqldump]
quick
max_allowed_packet = 512M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 200M
sort_buffer_size = 200M
read_buffer = 32M
write_buffer = 32M

[myisamchk]
key_buffer = 200M
sort_buffer_size = 200M
read_buffer = 32M
write_buffer = 32M

[mysqlhotcopy]
interactive-timeout

一直以来我都是用Loadrunner去做性能测试。Loadrunner实际上是一个很重的性能测试工具。他的功能很全面,是一把很好的牛刀。

如果我们只是需要对一个页面做简单的性能测试,使用Loadruner这把牛刀就不是一个很好的选择了。

所以就找了把小刀--ab来试试。这把小刀真的是轻巧又锋利,在这里就记录一下对ab测试过程中的一些自己的理解,供大家参考。

我们就拿百度首页来祭刀吧。首先你得有一把刀,也就是安装好Apache,网上教程一大堆就不复述了,本文使用MacBook自带的ab命令进行测试。

测试场景:模拟10个用户,对百度首页发起总共100次请求。

测试命令: abs -n 100 -c 10 https://www.baidu.com/index.html

Read More →

centos 系统安装Goaccess

1. 需要安装 GeoIP, ncurses, glib2

#yum -y install glib2 glib2-devel ncurses ncurses-devel GeoIP GeoIP-devel

2.下载 GoAccess 解压编译安装

$ wget http://tar.goaccess.io/goaccess-1.2.tar.gz
$ tar -xzvf goaccess-1.2.tar.gz
$ cd goaccess-1.2/
$ ./configure –enable-utf8 –enable-geoip=legacy
$ make
# make install

3.使用

goaccess -d -f access.log -a > test.html

Read More →