isucon7's People
isucon7's Issues
パフォーマンス改善施策案
WEBアプリケーションのパフォーマンス改善に関して思いつく限りの施策を列挙しておいて、コンテスト中のiceboxとして参照できるようにしておく
ネットワーク
- DNS名前解決が遅い
- DNSキャッシュの利用
/etc/hosts
にハードコードしちゃう
- TCP
- 初期windowサイズを上げる
- TCP fast open
- TCP keep-aliveでコネクションをなるべく使い回す
- HTTP/2でリクエストを並列化する
- CDNを置いてレイテンシ削減
- ネットワーク越しに取得するリソースを減らす
- コンテンツの圧縮
- テキストはgzip/deflate
- brotliなんかも
- 画像はjpegとかwebpとか
- テキストはgzip/deflate
- WEB API通じて取得しているデータがあれば、キャッシュを利用したり、あらかじめデータをクロール&保存しておいて利用してネットワーク越しに取得しないようにする
アプリケーション
- 計算オーダーの削減
- 処理にあったデータ構造に変える
- リスト、配列、ハッシュなど
- ファイルへのスワップがないか
- I/Oをある程度のバッチで処理する
- ブロッキングしないように
- 同期処理は非同期処理に
- スレッドを使う
- 実行時間を早くする
- インタプリタ系の言語・ランタイムを使わずになんとかする
- 大量のレコードを走査するSQLクエリがあったら、LIMITとか条件をつけてバッチで処理するようにする
- レコードの取得結果や大きい文字列の処理結果(HTMLとかJSON)をオンメモリに持っておいてそっち使うようにする
ミドルウェア
- 設定項目をチューニング
- 複数のミドルウェア間の通信を早くする
- 同じホストにおいてソケットとかIPCで
- 同じAZ、あるいはなるべく近いリージョンに
- リバースプロキシ使う
データベース
- スキーマを変える
- テーブル構成を変える
- クエリのチューニング
- 適切なインデックス使う
- クエリを減らす
- クエリエンジンを変える
- パラメータチューニング
フロントエンド
- JSの実行処理を速くする
- 優先度の低いJSの実行処理をdeferする
- CSS/JSのインライン化
- クライアントキャッシュの有効利用
- service worker
- コンテンツの圧縮
- resource hintsやprefetchディレクティブの活用
ハードウェア・インフラ
- GPU使う
- ハードウェアアクセラレーションができるソフトウェアを使う
- 冗長化
- スケールアップ、スケールアウト
OS
- カーネルパラメータのチューニング
- ネットワーク周り
- tcpとか
- maxvnode
- swapのサイズとか
- ネットワーク周り
- ベースイメージが小さいOS使う
疑問
- フロントエンドはある?
ISUCON6でbenchmark実行できるようになるまで
10/22にfox,treby氏とISUCON7出ることになるので準備する
ISUCONをRuby, Sinatraでいい感じに戦うためのツール - The paradigm shift
ISUCON予選突破を支えたオペレーション技術 - ゆううきブログ
https://github.com/matsuu/vagrant-isucon/blob/master/isucon6-qualifier-standalone/Vagrantfile
上記をもってきて vagrant up
する. 40分ぐらいかかる
$ vagrant up
$ vagrant ssh
# serviceの操作のためにpassword設定しておく
> sudo passwd isucon
> ifconfig # ip addressを確認 DHCP
# benchmark動作テスト
# 起動直後はperl実装が動いている
> sudo -i -u isucon
> cd isucon6q
> ./isucon6q-bench -target http://127.0.0.1
上記で確認したIPaddressをブラウザで開くとページが表示される
# perlの動作とめる
> sudo systemctl stop isuda.perl.service
> sudo systemctl stop isutar.perl.service
# ruby動かす
> sudo systemctl start isuda.ruby.service
> sudo systemctl start isutar.ruby.service
https://github.com/isucon/isucon6-qualify/blob/master/Regulation.md
実装やregulationはこちらから確認
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.