SMP IRQ Affinity


感谢 @淘宝褚霸 等人的大量文档。各位SA,如果你的服务器cpu使用很不均衡,top 中si的用量很大,不妨试试这个脚本。
五一前优化服务器,把smp_affinity 和 rps/rfs的内容通通看了遍,花了两天时间写了个自动配置的脚本,在github上:http://t.cn/zTQ5HRW ,欢迎抓虫。

Scaling in the Linux Networking Stack:
http://www.mjmwired.net/kernel/Documentation/networking/scaling.txt
SMP IRQ Affinity: 
https://cs.uwaterloo.ca/~brecht/servers/apic/SMP-affinity.txt
linux kernel 2.6.35中RFS特性详解:
http://www.pagefault.info/?p=115 
Linux 多核下绑定硬件中断到不同 CPU(IRQ Affinity):
http://www.vpsee.com/2010/07/load-balancing-with-irq-smp-affinity/
计算 SMP IRQ Affinity : 
http://www.vpsee.com/2010/07/smp-irq-affinity/
Linux SMP IRQ Affinity:
http://www.igigo.net/archives/231
Linux内核 RPS/RFS功能详细测试分析:
http://www.igigo.net/archives/204 
rfs: Receive Flow Steering : 
http://lwn.net/Articles/381955/ 
rps: Receive packet steering:
http://lwn.net/Articles/361440/ 
Receive Packet Steering :
http://lwn.net/Articles/331582/ 
Software receive packet steering : 
http://lwn.net/Articles/328339/ 
MYSQL数据库网卡软中断不平衡问题及解决方案 : 
http://blog.yufeng.info/archives/2037
SMP affinity and proper interrupt handling in Linux
http://www.alexonlinux.com/smp-affinity-and-proper-
interrupt-handling-in-linux
Why interrupt affinity with multiple cores is not 
such a good thing
http://www.alexonlinux.com/why-interrupt-affinity-
with-multiple-cores-is-not-such-a-good-thing

183 total views, 30 views today

经典存储架构 Haystack GFS TFS

经典论文翻译导读之《Finding a needle in Haystack: Facebook’s photo storage》   http://www.importnew.com/3292.html

优酷网视频存储架构   http://blog.csdn.net/starxu85/article/details/5673029

经典论文翻译导读之《Google File System》  http://www.importnew.com/3491.html

淘宝CDN、TFS的介绍:

http://www.infoq.com/cn/presentations/zws-taobao-image-store-cdn

http://tfs.taobao.org/index.html 

60 total views, 25 views today

varnish 503 “ Could not get storage”的一个解决方案

五一高峰,临时帮同事调varnish 503错误,通过“varnishlog -d -c -m TxStatus:503”看到问题所在“ FetchError c Could not get storage”,通过 varnishadm 调整“param.set nuke_limit 512”,503问题立解。没有仔细研究过varnish的更多资料,临时记录。

几条用到的命令:

varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082

param.set nuke_limit 512

param.show nuke_limit

watch -n 5 ‘varnishlog -d -c -m TxStatus:503′

varnishncsa |awk ‘$9 ~ 50′

参考资料:

1,varnish源码,github

2,http://useranswer.com/answer/varnish-returning-503-fetcherror-could-not-get-storage/

3,https://www.varnish-cache.org/trac/ticket/1012

4,http://serverfault.com/questions/372584/varnish-returning-503-fetcherror-could-not-get-storage

5,https://www.varnish-cache.org/forum/topic/530

6,http://serverfault.com/questions/372046/how-much-storage-is-varnish-using

7,https://www.varnish-software.com/static/book/Tuning.html#storage-backends

8,https://github.com/varnish/Varnish-Cache/blob/master/bin/varnishd/cache/cache_fetch.c

67 total views, 21 views today

关于tcp_tw_recycle和tcp_timestamps 的误解

网上大量流传的 tcp_tw_recycle=1 并且tcp_timestamps=0 的优化建议真是害人不浅,连 HAproxy的example里都存在这样的错误:http://t.cn/zTo2IOQ ,传送门:http://t.cn/zOPRrSi http://t.cn/zTo2IOR

记得去年在kernel的文档里面发现过 tw_recyle的描述中提到 timestamps 必须等于1 recyle才会生效,但今年没找到那篇,如果哪位找到kernel的原文,麻烦请 @我 一下

35 total views, 16 views today

MySQL如何避免使用swap[copy]

这几篇文章写的比较深入浅出,收集

MySQL如何避免使用swap http://www.realzyy.com/?p=923

MySQL如何避免使用swap(二)http://www.realzyy.com/?p=943

MySQL如何避免使用swap(三)http://www.realzyy.com/?p=1245

The MySQL “swap insanity” problem and the effects of the NUMA architecture  http://blog.jcole.us/2010/09/28/mysql-swap-insanity-and-the-numa-architecture/

[中文翻译版本] NUMA 架构中 MySQL 的 “swap insanity” 问题  http://sohulinux.blog.sohu.com/181968823.html

Should you have your swap file enabled while running MySQL ?  http://www.mysqlperformanceblog.com/2008/04/06/should-you-have-your-swap-file-enabled-while-running-mysql/

A brief update on NUMA and MySQL http://blog.jcole.us/2012/04/16/a-brief-update-on-numa-and-mysql/

 

40 total views, 18 views today

xtradb cluster and galera cluster mysql

Comparing Percona XtraDB Cluster with Semi-Sync replication Cross-WAN   http://www.mysqlperformanceblog.com/2012/06/14/comparing-percona-xtradb-cluster-with-semi-sync-replication-cross-wan/

Investigating MySQL Replication Latency in Percona XtraDB Cluster http://www.mysqlperformanceblog.com/2013/03/03/investigating-replication-latency-in-percona-xtradb-cluster/

Consistency across a WAN http://mysqlha.blogspot.com/2010/04/consistency-across-wan.html

Is Synchronous Data Replication over WAN Really a Viable Strategy?   http://scale-out-blog.blogspot.com/2012/08/is-synchronous-data-replication-over.html

Galera Synchronous Multi-Master Replication for MySQL http://www.percona.com/live/mysql-conference-2012/sessions/galera-synchronous-multi-master-replication-mysql

Galera Cluster for MySQL http://www.codership.com/content/using-galera-cluster

Percona XtraDB Cluster  http://www.percona.com/software/percona-xtradb-cluster

34 total views, 14 views today

关于结对编程的一些收集

变化是如何产生的——有关结对编程  http://www.juvenxu.com/2013/01/10/how-change-happened-about-pair-programming/

结对编程成为主流,但反响冷淡  http://www.infoq.com/cn/news/2012/10/pair-programming-wsj

结对编程的利与弊  http://coolshell.cn/articles/16.html

结对编程的价值及注意点 http://www.juvenxu.com/2012/05/23/pair-programming-values-and-warnings/

敏捷咨询师结指出对编程顺利推行的四个原因 http://www.linuxeden.com/html/news/20130226/136210.html

27 total views, 15 views today