1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ISUCON5 予選 part2

Posted at

研究室有志によるISUCON勉強会 ISUCON部 の第2回資料です。

概要

ISUCON 夏期講習 2017 の資料を参考に、各種logの解析と簡単なチューニングをする。

手順

# 毎回忘れずにやること
vagrant ssh image
sudo su - isucon
# 必要なものインストール
sudo apt-get install -y htop dstat glances
sudo apt-get install -y unzip

# alp インストール
mkdir -p ~/tmp
cd ~/tmp
wget https://github.com/tkuchiki/alp/releases/download/v0.3.1/alp_linux_amd64.zip
unzip alp_linux_amd64.zip
sudo install ./alp /usr/local/bin

# nginx の log format 変更
# 参考: https://github.com/gky360/isucon5-qual-etc/commit/1b7a1c334b0744fb7561461e530df224b5c02cae
sudo systemctl restart nginx
sudo rm /var/log/nginx/access.log
systemctl status nginx
# ここでベンチを回してみる

# alp
sudo alp -f /var/log/nginx/access.log

# 静的ファイルを nginx に処理させる
# 参考: https://github.com/gky360/isucon5-qual-etc/commit/9b6e6f6fe3fc11e352322df798a0947dc79762a0
sudo rm /var/log/nginx/access.log
sudo systemctl restart nginx

# mysql slow log
# /etc/mysql/my.cnf を編集
# 参考: https://github.com/gky360/isucon5-qual-etc/commit/df13fc1f043194786927084097b1ca11fed23d45
sudo systemctl restart mysql
sudo systemctl restart isuxi.go.service

# slow log 解析
sudo mysqldumpslow /var/log/mysql/slow.log

# percona tools
sudo apt-get install -y percona-toolkit
sudo pt-query-digest --limit 10 /var/log/mysql/slow.log | less
# 見方はここ参照: https://www.percona.com/doc/percona-toolkit/LATEST/pt-query-digest.html
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?