Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当日やること会議場 #1

Closed
utgwkk opened this issue Sep 7, 2019 · 22 comments

Comments

@utgwkk
Copy link
Owner

commented Sep 7, 2019

競技始まったらやること

  • みんなの公開鍵を配置する
    • ssh config 共有する
  • レギュレーション把握する http://isucon.net/archives/53555007.html
  • 当日マニュアル読む https://gist.github.com/sota1235/a7356a5909af264c1c1c840dd216c98f
    • 得点源列挙する
    • webapp/docs 以下を読む
  • アプリケーションの雰囲気をつかむ
  • サーバに入ってるソフトウェア・ミドルウェアを把握する
  • 初期実装でベンチ回す
  • 計測する
  • N+1潰す
  • リソースについて共通かユーザ固有かをしらべる
    • 共通リソースにはキャッシュが効く
  • DBスキーマはく
    • 知らない機能を殺す

他にあったらてきとうに追記してください

@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

ufw と apparmor 潰した

@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

function add-user {
          user=$1
            sudo chown $1:$1 /home/$1
              sudo -u $1 mkdir -p /home/$1/.ssh
                sudo -u $1 chmod 700 /home/$1/.ssh
                  sudo -u $1 touch /home/$1/.ssh/authorized_keys
                    sudo -u $1 chmod 600 /home/$1/.ssh/authorized_keys
            }

            add-user nonylene
            add-user utgw
            add-user wass80
@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

sudo passwd $user

@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

hostname かえた

@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

percona-toolkit 入れた

@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

DefaultLimitNOFILE=262144

system.conf を user.conf にかく

@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

メモリ 3.85GB、コア 2 つ

@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

swap1GB

@utgwkk

This comment has been minimized.

Copy link
Owner Author

commented Sep 8, 2019

Python実装に切り替えた

@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

ping は返さないらしい

@wass88

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

pingとおすようにした

@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

/etc/security/limits.conf も切り替える必要があった!!

@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

https://github.com/matsuu/kataribe 入れた

kataribe -generate
cat /var/log/nginx/access.log | kataribe
@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

slow query 設定入れた

@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

mysql いい感じにした

@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

sudo cat /var/log/mysql/mysql-slow.log | pt-query-digest で pt-query-digest 見れます

@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

キャッシュ入れた

@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

isucari.python_native.service に python 直接立ち上げる君を入れた

@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

nonylene@innocent-isucon9
~ > cat slowlog.sh
#! /bin/bash

set -ex

mkdir log_`date -Iminute`
sudo cat /var/log/mysql/mysql-slow.log | pt-query-digest > log_`date -Iminute`/slow_`date -Iminute`.log
sudo cat /var/log/nginx/access.log | kataribe > log_`date -Iminute`/kataribe_`date -Iminute`.log
@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

nonylene@innocent-isucon9
~ > cat prepare.sh
#! /bin/bash

set -x

sudo rm /var/log/nginx/access.log
sudo rm /var/log/mysql/mysql-slow.log
sudo systemctl restart mysql
sudo systemctl restart nginx
@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

nonylene@innocent-isucon9
~ > cat start_native.sh
#! /bin/bash

set -ex

sudo systemctl stop isucari.python || true
sudo systemctl restart isucari.python_native
@nonylene

This comment has been minimized.

Copy link
Collaborator

commented Sep 8, 2019

nonylene@innocent-isucon9
~ > cat start_gunicorn.sh
#! /bin/bash

set -ex

sudo systemctl stop isucari.python_native || true
sudo systemctl restart isucari.python

@nonylene nonylene closed this Sep 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.