iotopというコマンドを使うと、プロセスごとのIO使用状況が top コマンドのような感じに把握でき、システムのボトルネックの分析に使えます。

ubuntuの場合は

   1  apt-get install iotop

で導入できます。

iftop とあわせて Have a nice admin life!

posted by Png genki on Tue 28 Jun 2011 at 16:23

Singletonを使う場面はよくあるんですが、iOS4以降はGrand Central Dispatchがあるのでそれのdispatch_onceを使う必要があるみたいで、メモ。

GCD 前:

   1  + (MyController*)singleton {
   2  	static MyController *controller = nil;
   3  
   4  	if(!controller) {
   5  		controller = [[MyController] alloc] init];
   6  	}
   7  	return controller;
   8  }

GCD 後:

   1  + (MyController*)singleton {
   2  	static dispatch_once_t pred = 0;
   3  	static MyController *controller = nil;
   4   
   5   	dispatch_once(&pred, ^{
   6    		controller = [[MyController alloc] init];
   7   	});
   8   	return controller;
   9  }

Cocoa Fundamentals GuideのClass Factory Methods項の下のほーーーうにあるCreating a Singleton Instanceの説明もとても参考になります。これは読むべし:

Cocoa Fundamentals Guide
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/CocoaObjects.html#//apple_ref/doc/uid/TP40002974-CH4-SW32

また、Apple Developer Forumsのこの質問もとても勉強になります:

Apple Developer Forums
https://devforums.apple.com/message/455002#455002

下記も参考

Singletons: You're doing them wrong
http://cocoasamurai.blogspot.com/2011/04/singletons-your-doing-them-wrong.html

posted by Png satoko on Tue 28 Jun 2011 at 11:21

普段サーバの監視にmonitを使っていますが、ubuntu nattyの環境に入れようとしたところ、monitが起動しないという問題に遭遇しました。

理由を調べてもなかなか分からなかったのですが、どうやらパッケージインストール時に最初にある設定ファイルのままhttpdの設定を行うと起動しないようです。

   1  set httpd port 2812
   2    use address localhost # <- これがあると起動しない
   3    allow localhost

posted by Png genki on Tue 28 Jun 2011 at 00:16
Contents
iotopでプロセスごとのIO使用状況を調べる
[iPhone] Singleton: iOS4以降はGCDのdispatch_onceを使う
ubuntu nattyでmonitが起動しない?
Comments
瀧内元気: MacOS版は以下にあります * [genki/ViMouse](https://githu... '23-1
KingofSmack: Here also good reads for this mobile applicatio... '14-5
Spencer: You don't have to re-compile it, this version w... '14-4
staiano: Any chance we can get a recompile for 10.9? '14-1
dsjf: https://gist.github.com/6bf1bf2c3cbb5eb6e7a7 これ... '13-1
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ