日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

Erlang非業(yè)余研究

 ~水手~!! 2011-04-25


淘寶商品庫是淘寶網最核心的數(shù)據(jù)庫之一,采用MySQL主備集群的架構,特點是數(shù)據(jù)量大且增長速度快,讀多寫少,對安全性要求高,并發(fā)請求高。

演講內容包括淘寶商品庫硬件的選型決策, 安全性和性能的平衡,特別是創(chuàng)新引入PCI-E Flash卡和Flashcache作為Cache提高IO性能,在保證安全性的前提下就包括MySQL、InnoDB引擎、文件系統(tǒng)、系統(tǒng)Page Cache、 IO調度算法、DM層(Flashcache)、Raid卡、設備驅動在內的整條IO路徑的Cache進行優(yōu)化,進一步挖掘了系統(tǒng)IO的潛能,重點介紹優(yōu) 化過程中的一些經驗教訓、測量手段和工具。

玩得開心!

Post Footer automatically generated by wp-posturl plugin for wordpress.

Categories: Linux, 調優(yōu) Tags: ,

EEP 36: Line numbers in exceptions

April 2nd, 2011 Yu Feng No comments

原創(chuàng)文章,轉載請注明: 轉載自Erlang非業(yè)余研究

本文鏈接地址: EEP 36: Line numbers in exceptions

最近關于Erlang程序在異常打印堆棧時候帶上行號信息的提案開始被討論了,具體看這里:
EEP 36: Line numbers in exceptions: http://www./eeps/eep-0036.html

初學Erlang的人估計都有這個困惑,程序異常的時候打印堆棧不假,但是只打出函數(shù)名,如果模塊很長的話,很難找到具體發(fā)生異常的點,通常再通過 打日志的方式來定位,非常的低效無聊。有人開玩笑說是Erlang鼓勵寫短函數(shù)和模塊. 我曾經想了個方法解決這個問題, 見 這里 , 但不是完美的方案。

EEP 36則是從編譯器直接搞定這個問題,會爽很多, 我們看下他的效果:
Read more…

Post Footer automatically generated by wp-posturl plugin for wordpress.

Categories: Erlang探索 Tags: ,

oprofile抓不到采樣數(shù)據(jù)問題和解決方法

April 1st, 2011 Yu Feng 1 comment

原創(chuàng)文章,轉載請注明: 轉載自Erlang非業(yè)余研究

本文鏈接地址: oprofile抓不到采樣數(shù)據(jù)問題和解決方法

最近有同學反映在某些新機器上做性能調優(yōu)的時候, oprofile 有時抓不到數(shù)據(jù),我之前也遇到這個情況,很是無語,今天特地驗證了下。

# 我們的操作系統(tǒng)和機器配置大概是這樣的:
$sudo aspersa/summary
# Aspersa System Summary Report ##############################
        Date | 2011-03-31 16:26:05 UTC (local TZ: CST +0800)
    Hostname | my031226.sqa.cm4
      Uptime | 10:00,  4 users,  load average: 0.00, 0.78, 5.29
      System | Huawei Technologies Co., Ltd.; Tecal RH2285; vV100R001 (Main Server Chassis)
 Service Tag | 2102317716N0AA000062
     Release | Red Hat Enterprise Linux Server release 5.4 (Tikanga)
      Kernel | 2.6.18-164.el5
Architecture | CPU = 64-bit, OS = 64-bit
   Threading | NPTL 2.5
    Compiler | GNU CC version 4.1.2 20080704 (Red Hat 4.1.2-44).
     SELinux | Disabled
# Processor ##################################################
  Processors | physical = 2, cores = 12, virtual = 24, hyperthreading = yes
      Speeds | 24x2400.151
      Models | 24xIntel(R) Xeon(R) CPU X5670 @ 2.93GHz
      Caches | 24x12288 KB
..
 
$sudo rm -f /root/.oprofile/daemonrc
 
$sudo opcontrol --setup --no-vmlinux
$sudo opcontrol --init
$sudo opcontrol --reset
$sudo opcontrol --start
Using 2.6+ OProfile kernel interface.
Using log file /var/lib/oprofile/samples/oprofiled.log
Daemon started.
Profiler running.
 
$sudo opcontrol --status
Daemon running: pid 9253
Separate options: none
vmlinux file: none
Image filter: none
Call-graph depth: 0
 
#這里喝杯茶,讓子彈飛一會兒
 
$sudo opcontrol --shutdown
Stopping profiling.
Killing daemon.
 
$opreport
opreport error: No sample file found: try running opcontrol --dump
or specify a session containing sample files
 
$tree /var/lib/oprofile/samples/current/
/var/lib/oprofile/samples/current/
 
0 directories, 0 files

確實是沒抓到sample文件!

經過無數(shù)次的分析和判斷,再加上goolge大神的幫助,找到問題的根源了:
Read more…

Post Footer automatically generated by wp-posturl plugin for wordpress.

Linux下方便的socket讀寫查看器(socktop)

March 31st, 2011 Yu Feng No comments

原創(chuàng)文章,轉載請注明: 轉載自Erlang非業(yè)余研究

本文鏈接地址: Linux下方便的socket讀寫查看器(socktop)

晚上 雕梁 說要找個工具來調查下unix域套接字的發(fā)送和接受情況,比如說A程序是否送出,B程序是否接收到,他找了tcpdump ,wireshark什么的,貌似都不支持。

這時候還是偉大的systemtap來救助了。 因為所有的socket通訊都是通過socket接口來的,任何family的通訊包括unix域套接都要走的,所以只要截獲了socket 讀寫的幾個syscall 就搞定了.

systemtap發(fā)行版本提供了個工具socktop, 位于 /usr/share/doc/systemtap/examples/network/socktop, 是個非常方便的工具, 干這個事情最合適了。
Read more…

Post Footer automatically generated by wp-posturl plugin for wordpress.

Linux pagecache的行為圖

March 30th, 2011 Yu Feng No comments

原創(chuàng)文章,轉載請注明: 轉載自Erlang非業(yè)余研究

本文鏈接地址: Linux pagecache的行為圖

看圖不說話:

Post Footer automatically generated by wp-posturl plugin for wordpress.

Categories: Linux, 調優(yōu) Tags: ,

latencytop深度了解你的Linux系統(tǒng)的延遲

March 29th, 2011 Yu Feng 6 comments

原創(chuàng)文章,轉載請注明: 轉載自Erlang非業(yè)余研究

本文鏈接地址: latencytop深度了解你的Linux系統(tǒng)的延遲

我們在系統(tǒng)調優(yōu)或者定位問題的時候,經常會發(fā)現(xiàn)多線程程序的效率很低,但是又不知道問題出在哪里,就知道上下文切換很多,但是為什么上下文切換,是誰導致切換,我們就不知道了。上下文切換可以用dstat這樣的工具查看,比如:

$dstat
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw
  9   2  87   2   0   1|7398k   31M|   0     0 | 9.8k   11k|  16k   64k
 20   4  69   3   0   4|  26M   56M|  34M  172M|   0     0 |  61k  200k
 21   5  64   6   0   3|  26M  225M|  35M  175M|   0     0 |  75k  216k
 21   5  66   4   0   4|  25M  119M|  34M  173M|   0     0 |  66k  207k
 19   4  68   5   0   3|  23M   56M|  33M  166M|   0     0 |  60k  197k
 
#或者用systemtap腳本來看
$sudo stap -e 'global cnt; probe scheduler.cpu_on {cnt<<<1;} probe timer.s(1){printf("%d\n", @count(cnt)); delete cnt;}'
217779
234141
234759

每秒高達200k左右的的上下文切換, 誰能告訴我發(fā)生了什么? 好吧,latencytop來救助了!

它的官網:http://www./

Skipping audio, slower servers, everyone knows the symptoms of latency. But to know what’s going on in the system, what’s causing the latency, how to fix it… that’s a hard question without good answers right now.

LatencyTOP is a Linux* tool for software developers (both kernel and userspace), aimed at identifying where in the system latency is happening, and what kind of operation/action is causing the latency to happen so that the code can be changed to avoid the worst latency hiccups.

它是Intel貢獻的另外一個性能查看器,還有一個是powertop,都是很不錯的工具.
Read more…

Post Footer automatically generated by wp-posturl plugin for wordpress.

    本站是提供個人知識管理的網絡存儲空間,所有內容均由用戶發(fā)布,不代表本站觀點。請注意甄別內容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權內容,請點擊一鍵舉報。
    轉藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多