Skip to content

Instantly share code, notes, and snippets.

@ichyo
Created September 13, 2019 06:09
Show Gist options
  • Save ichyo/26f244ee3b07eaaa85cc7c7e922b95f6 to your computer and use it in GitHub Desktop.
Save ichyo/26f244ee3b07eaaa85cc7c7e922b95f6 to your computer and use it in GitHub Desktop.

以下の変更をして50%の確率で11000点が出るようになった

  • Campaing を1にする
  • Categoryは不変なのでオンメモリにする
  • items に (created_at) の インデックスを貼る
  • itemsdescription が大きいので不要なところではSELECTに入れないようにする
  • nginx+app without login, mysql, app for login の3台に分ける
  • 同じ商品を買う人のLock待ちが多すぎて死なないように db.SetMaxOpenConns に適切な数を与える
  • 同じ商品を買う人の大量アクセスをさばくために nginx の設定を色々変える

以下の変更ができなかったので0点になって予選に落ちた

  • 同じ商品を買う人の大量アクセスをさばくために nginx の設定で worker_connections を十分大きな数にする
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment