この文章では、Linuxコマンド、sar, top, psを使って、一般的に負荷といわれるものの原因を切り分けることを目的とする。
「複数のタスクによるサーバリソースの奪い合いの結果に生じる待ち時間」を一言で表した言葉。OSのチューニングとは負荷の原因を知り、それを取り除くことにほかならない。
- ロードアベレージ(処理を実行したくても、実行できなくて待たされているプロセス(CPUの実行権限が与えられるのを待っている、またはディスクI/Oが完了するのを待っている)の数)を見る
core-toolbar { | |
font-family: RobotoDraft, sans-serif; | |
background-color: #4058A3; | |
box-shadow: 0px 3px 2px rgba(0, 0, 0, 0.2); | |
color: #fff; | |
font-size: 20px; | |
font-weight: 400; | |
height: 42px; | |
} |
// Based on http://bit.ly/215MBZ | |
function FailureDetector(ws) { | |
// ws stands for window size. | |
// How many heartbeat intervals we keep track of. | |
this.ws = ws || 100; | |
this.window = []; | |
this.last = null; | |
} | |
exports.FailureDetector = FailureDetector; |
http = require('http'); | |
fs = require('fs'); | |
fd = fs.openSync(__filename, 'r'); | |
size = fs.fstatSync(fd).size; | |
server = http.createServer(function(req, res) { | |
res.writeHead(200, { | |
'Content-Length': size, | |
'Content-Type': 'text/plain' |