Sentry 搭建

docker run -d –name sentry-redis redis

docker run -d –name sentry-postgres -e POSTGRES_PASSWORD=secret -e POSTGRES_USER=sentry postgres

docker run –rm sentry config generate-secret-key 这一步会生成一个密钥key,比如 *l%)ti9=v#!pt__!#hpz3g33tq3hy2afpv%sda6^^ghr24)k4q ,先记下来,后面步骤中多个容器会共享该key

docker run -it –rm -e SENTRY_SECRET_KEY=’*l%)ti9=v#!pt__!#hpz3g33tq3hy2afpv%sda6^^ghr24)k4q’ –link sentry-postgres:postgres –link sentry-redis:redis sentry upgrade

docker run -d -p 9090:9000 –name my-sentry -e SENTRY_SECRET_KEY=’*l%)ti9=v#!pt__!#hpz3g33tq3hy2afpv%sda6^^ghr24)k4q’ –link sentry-redis:redis –link sentry-postgres:postgres sentry

docker run -d –name sentry-cron -e SENTRY_SECRET_KEY=’*l%)ti9=v#!pt__!#hpz3g33tq3hy2afpv%sda6^^ghr24)k4q’ –link sentry-postgres:postgres –link sentry-redis:redis sentry run cron

docker run -d –name sentry-worker-1 -e SENTRY_SECRET_KEY=’*l%)ti9=v#!pt__!#hpz3g33tq3hy2afpv%sda6^^ghr24)k4q’ –link sentry-postgres:postgres –link sentry-redis:redis sentry run worker

golang CPU性能火焰图分析

step 1 获取cpu采样

go tool pprof http://localhost:6001/debug/pprof/profile

执行完成后会打印采样文件所在的位置

step 2 web端火焰图展示

go tool pprof -http=0.0.0.0:8081 /home/xxxx/pprof/pprof.gsmdatasvrd.samples.cpu.037.pb.gz

利用客户端给kafka写消息

./kafka-console-producer.sh –topic mmm_m_m_topic –bootstrap-server 9.124.353.105:9092

提供交互式终端,可以写入消息

./kafka-topics.sh –create –botstrap-server 9.134.153.105:9092 –replication-factor 1 –partition 12 –topic mmm_m_m_topic

创建topic

使用fio测试磁盘性能

yum install fio

fio -filename=test.data -direct=1 -iodepth 1 -thread -rw=randrw -ioengine=psync -bs=16k -size=500M -numjobs=10 -runtime=10 -group_reporting -name=mytest

关注write IOPS 和 read IOPS所在行的数据