[iyunv@localhost ~]# service mysqld start
[iyunv@localhost ~]# mysql_secure_installation
Enter current password for root (enter for none): //默认数据库密码为空
Set root password? [Y/n] y //设置新密码
Remove anonymous users? [Y/n] y //移除匿名用户
Disallow root login remotely? [Y/n] n //是否禁止用户远程登录
Remove test database and access to it? [Y/n] y //是否移除test数据库
Reload privilege tables now? [Y/n] y //是否重启加载权限列表
2、创建用户和数据库,并授权php端能远程登录
1
2
3
4
5
6
7
8
mysql> grant all on *.* to 'admin'@'172.18.250.78' identified by "admin";
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> create database mytest;
Query OK, 1 row affected (0.00 sec)
mysql> create database bbs;
Query OK, 1 row affected (0.01 sec)
[iyunv@localhost upload]# ab -n100 -c10 http://172.18.250.77/wordpress/index.php
Benchmarking 172.18.250.77 (be patient).....done
Server Software: Apache/2.4.6
Server Hostname: 172.18.250.77
Server Port: 80
Document Path: /wordpress/index.php
Document Length: 0 bytes
Concurrency Level: 10
Time taken for tests: 3.908 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Non-2xx responses: 100
Total transferred: 34900 bytes
HTML transferred: 0 bytes
Requests per second: 25.59 [#/sec] (mean) //ab压力测试每秒请求个数
Time per request: 390.849 [ms] (mean)
Time per request: 39.085 [ms] (mean, across all concurrent requests)
Transfer rate: 8.72 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.3 0 1
Processing: 104 369 95.7 368 589
Waiting: 104 367 94.8 367 589
Total: 105 369 95.7 368 589
Percentage of the requests served within a certain time (ms)
50% 368
66% 410
75% 443
80% 455
90% 502
95% 536
98% 589
99% 589
100% 589 (longest request)
[iyunv@localhost upload]# ab -n100 -c10 http://172.18.250.77/wordpress/index.php
Benchmarking 172.18.250.77 (be patient).....done
Server Software: Apache/2.4.6
Server Hostname: 172.18.250.77
Server Port: 80
Document Path: /wordpress/index.php
Document Length: 0 bytes
Concurrency Level: 10
Time taken for tests: 1.489 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Non-2xx responses: 100
Total transferred: 34900 bytes
HTML transferred: 0 bytes
Requests per second: 67.18 [#/sec] (mean) //加载xcache后有了提升
Time per request: 148.853 [ms] (mean)
Time per request: 14.885 [ms] (mean, across all concurrent requests)
Transfer rate: 22.90 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.2 0 1
Processing: 38 141 31.0 139 240
Waiting: 37 141 31.0 138 240
Total: 38 141 31.0 139 240
Percentage of the requests served within a certain time (ms)
50% 139
66% 152
75% 160
80% 168
90% 179
95% 194
98% 216
99% 240
100% 240 (longest request)