Last active
September 26, 2015 06:36
-
-
Save k2wanko/c347ab4825c6342823f9 to your computer and use it in GitHub Desktop.
ISUCON4 practice
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 開発環境 | |
必要なファイルをgitで管理して | |
ローカルで編集した後にrsyncでリモートでコピー | |
hook処理を入れてローカルのworking directoryとリモートのディレクトリは常に同期するようにした | |
設定ファイルのデプロイはシンボリックリンクを使い | |
サーバーの再起動はリモート側でシェルスクリプトを実行するようにした | |
# ボトルネックを確認する | |
DropboxのNginx.mdに書いてるisuconログフォーマットを使って | |
アクセスログを書き出し | |
Dropboxからsummary_log.pyをコピーして以下のコマンドで確認 | |
``` | |
$ sudo ./summary_log.py /var/log/nginx/access.log | |
Request by count | |
1560 GET /stylesheets/bootflat.min.css | |
1560 GET /stylesheets/bootstrap.min.css | |
1560 GET /images/isucon-bank.png | |
1560 GET /stylesheets/isucon-bank.css | |
1395 GET / | |
780 POST /login | |
165 GET /mypage | |
31 - | |
1 GET /report | |
Request by total time | |
50.503 0.0647474358974 POST /login | |
20.325 20.325 GET /report | |
4.237 0.0256787878788 GET /mypage | |
1.626 0.00116559139785 GET / | |
0.909 0.000582692307692 GET /images/isucon-bank.png | |
Request by out bytes | |
171188160 109736 GET /stylesheets/bootstrap.min.css | |
83325840 53414 GET /stylesheets/bootflat.min.css | |
26011440 16674 GET /images/isucon-bank.png | |
3543327 2540 GET / | |
1365000 875 GET /stylesheets/isucon-bank.css | |
358390 459 POST /login | |
309312 1874 GET /mypage | |
32696 32696 GET /report | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Kazuhiro Kubota | |
email = k2.wanko@gmail.com | |
[color] | |
ui = true | |
[alias] | |
co = checkout | |
st = status | |
br = branch | |
ci = commit | |
mg = merge | |
see = browse | |
graph = log --graph --date=short --decorate=short --pretty=format:'%Cgreen%h %Creset%cd %Cblue%cn %Cred%d %Creset%s' | |
gr = log --graph --date=short --decorate=short --pretty=format:'%Cgreen%h %Creset%cd %Cblue%cn %Cred%d %Creset%s' | |
stt = status -uno | |
difff = diff --word-diff | |
branch-clean = "!git branch -d $(git branch --merged | grep -v master | grep -v '*')" | |
hf = !git-hf | |
[merge] | |
ff = false | |
[push] | |
default = current |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
dir=${GIT_DIR:=$(dirname $0)} | |
${dir}/../scripts/sync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
dir=${GIT_DIR:=$(dirname $0)} | |
${dir}/../scripts/sync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
dir=${GIT_DIR:=$(dirname $0)/../.git} | |
if [ ! -L ${dir}/hooks ]; then | |
rm -rf $dir/hooks | |
ln -fs ../hooks $dir/hooks | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
dir=${GIT_DIR:=$(dirname $0)} | |
rsync -azc --delete --force --exclude=".git" ${dir}/../ isucon:webapp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment