INSERT INTO `wx_bonus_second` (`user_id`, `num_sum`, `number`, `type`, `total_amount`, `appid`) SELECT user_id,count(*) as num_sum,sum(case when `status`=1 then 1 else 0 end) as number,0 as type,sum( if( `status` = 1, total_amount, 0 )) as total_amount,wxappid FROM `wx_send_bonus` WHERE user_id is not null GROUP BY user_id ORDER BY number desc;html
UPDATE wx_bonus_second SET mobile_num=(SELECT count(distinct(mobile)) as mobile_num FROM wx_send_bonus WHERE user_id is not null and user_id=wx_bonus_second.user_id GROUP BY user_id)mysql
優化配置
kernel.shmmax = 1294967295
vm.swappiness = 0
Vm.swappiness = 0
net.ipv4.neigh.default.gc_stale_time=120
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0
net.ipv4.conf.default.arp_announce = 2
net.ipv4.conf.all.arp_announce=2
net.ipv4.tcp_max_tw_buckets = 6000
net.ipv4.tcp_syncookies = 1
net.core.somaxconn=65535
net.core.netdev_max_backlog=65535
net.ipv4.tcp_max_syn_backlog=65535
net.ipv4.tcp_fin_timeout=10
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_tw_recycle=1
net.core.wmem_default=87380
net.core.wmem_max=16777216
net.core.rmem_default=87380
net.core.rmem_max=16777216
net.ipv4.tcp_keepalive_time=120
net.ipv4.tcp_keepalive_intvl=30
net.ipv4.tcp_keepalive_probes=30
net.ipv4.tcp_synack_retries = 2
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv4.conf.lo.arp_announce=2sql
http://www.aikaiyuan.com/9962.html
kernel.shmmax = 4294967295
vm.swappiness = 0
Vm.swappiness = 0
net.core.somaxconn=65535
net.core.netdev_max_backlog=65535
net.ipv4.tcp_max_syn_backlog=65535
net.ipv4.tcp_fin_timeout=10
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_tw_recycle=1
net.core.wmem_default=87380
net.core.wmem_max=16777216
net.core.rmem_default=87380
net.core.rmem_max=16777216
net.ipv4.tcp_keepalive_time=120
net.ipv4.tcp_keepalive_intvl=30
net.ipv4.tcp_keepalive_probes=30
內核相關
kernl.shmmax=4294967295
vm.swappiness=0
Vm.swappiness=0api
增長資源限制swoole
磁盤調度策略(/sys/blocak/devname/queue/scheduler)
cat /sys/block/sda/queue/scheduler
noop anticipatory deadline [cfq]cookie
改變磁盤調度策略
echo deadline > /sys/block/sda/queue/scheduler
mysql併發數量
show global status like 'Threads_running';併發
原系統配置
vm.swappiness = 0
net.ipv4.neigh.default.gc_stale_time=120
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0
net.ipv4.conf.default.arp_announce = 2
net.ipv4.conf.all.arp_announce=2
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 4096
net.core.netdev_max_backlog = 4096
net.ipv4.tcp_synack_retries = 2
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv4.conf.lo.arp_announce=2app
Yii 2.0 權威指南yii
http://www.yiiframework.com/doc-2.0/index.htmltcp
Composer網站
https://packagist.org/packages/guanghua/yii-wechat
http://www.swiper.com.cn/api/Observer/2015/0308/219.html swiper.js插件
http://blog.csdn.net/xiaog351/article/details/51107808 yii結合swoole介紹