关键字:mysql、性能、监控、dstat
时间:2018年6月

dstat介绍

dstat是一个综合的性能监控命令,不仅仅可用于MySQL,还可以监控cpu、内存、网络、磁盘等。

安装

root@debian:~# apt-get install dstat
...
root@debian:~# apt-get install python python-mysqldb
...

使用

创建shell脚本,通过环境变量指定mysql用户密码

root@debian:~# vim mysql5io.sh
#!/bin/bash
export DSTAT_MYSQL_USER='root'
export DSTAT_MYSQL_PWD='123456'
dstat --mysql5-io $@
:wq
root@debian:~# chmod 700 mysql5io.sh

执行shell查看mysql性能

root@debian:~# ./mysql5io.sh --help
...
root@debian:~# ./mysql5io.sh -cdglmnrstTy
Terminal width too small, trimming output.
-mysql5-io- ----total-cpu-usage---- -dsk/total- ---paging-- ---load-avg--->
 recv  sent|usr sys idl wai hiq siq| read  writ|  in   out | 1m   5m  15m >
0.02  0.08 |  0   0  99   0   0   0|4981B 6478B|   0     0 |0.48 0.20 0.07>
12.5k 58.4k|  5   1  94   1   0   0|   0    44k|   0     0 |0.52 0.22 0.07>
12.6k 58.6k|  1   1  99   0   0   0|   0     0 |   0     0 |0.52 0.22 0.07>
12.6k 58.9k|  1   0  99   0   0   0|   0     0 |   0     0 |0.52 0.22 0.07>
12.7k 59.1k|  4   1  95   0   0   0|   0     0 |   0     0 |0.52 0.22 0.07>
12.7k 59.4k|  1   0  99   0   0   0|   0     0 |   0     0 |0.52 0.22 0.07>
12.7k 59.6k|  1   0  98   1   0   0|   0    44k|   0     0 |0.48 0.21 0.07>
12.8k 59.9k|  7   1  91   1   0   0|   0    52k|   0     0 |0.48 0.21 0.07>
12.8k 60.1k|  1   0  99   0   0   0|   0     0 |   0     0 |0.48 0.21 0.07>
12.8k 60.4k|  0   1  99   0   0   0|   0     0 |   0     0 |0.48 0.21 0.07>

注:控制台窗口拉宽点可以看到更多数据。

关键字:个税、月薪、年终奖
时间:2018年6月

月薪
税前 个税 税后 备注
3,500.00 0.00 3,500.00
3,501.00 0.03 3,500.97 每多1元税前工资多扣0.03元税
5,000.00 45.00 4,955.00
5,001.00 45.10 4,955.90 每多1元税前工资多扣0.10元税
8,000.00 345.00 7,655.00
8,001.00 345.20 7,655.80 每多1元税前工资多扣0.20元税
10,000.00 745.00 9,255.00
12,500.00 1,245.00 11,255.00
12,501.00 1,245.25 11,255.75 每多1元税前工资多扣0.25元税
15,000.00 1,870.00 13,130.00
17,000.00 2,380.00 14,630.00
20,000.00 3,120.00 16,880.00
25,000.00 4,370.00 20,630.00
30,000.00 5,620.00 24,380.00
38,500.00 7,745.00 30,755.00
38,501.00 7,745.30 30,755.70 每多1元税前工资多扣0.30元税
58,500.00 13,745.00 44,755.00
58,501.00 13,745.35 44,755.65 每多1元税前工资多扣0.35元税
年终奖
税前 个税 税后 备注
18,000.00 540.00 17,460.00
18,001.00 1,695.10 16,305.90 税前多了1元,扣税多了1154.1
19,000.00 1,795.00 17,205.00 还没有18000的税后高
19,283.33 1,823.33 17,460.00 与18000税后相等
20,000.00 1,895.00 18,105.00
30,000.00 2,895.00 27,105.00
54,000.00 5,295.00 48,705.00
54,001.00 10,245.20 43,755.80 税前多了1元,扣税多了4949.2
57,000.00 10,845.00 46,155.00
58,000.00 11,045.00 46,955.00
59,000.00 11,245.00 47,755.00
60,000.00 11,445.00 48,555.00
60,187.50 11,482.50 48,705.00 与54000税后相等
108,000.00 21,045.00 86,955.00
108,001.00 25,995.25 82,005.75 税前多了1元,扣税多了4949.25