Skip to content

gongqi-zhen/isucon14-SelfChronicle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

isucon14-SelfChronicle

ゆるっと スクリーンショット 2025-01-13 2 48 48

2024

  • 2024-12-08: isucon14
  • 2025-01-17: 感想戦モード2025年1月17日16時まで

本戦内容

  • DBにINDEXを付与
  • APP, DB分割
    • DB設定のbind-addressをlisten可に変更後、env.shで接続先を変更、DB接続は出来るがbenchmarkでmatching処理に失敗する
    • 原因はisuride-matcherのprocessが1つである必要があるため
    • isuride-matcherが(/api/internal/matching:internalGetMatching)を叩いている事が原因、daemonを止める必要があった

反省会

制限時間: 8時間
アプリ仕様・サービス内容を理解しし
何をするのか・どんな仕組みかを理解し、もっと効率良く出来ないかを競う競技である。

皆さん理解度が早く・手が動く
正直なところ、競技中にアプリが何をするのか・どんな仕組みか理解も理解が出来ていなかった。

感想戦モードを通して
何度もアプリケーションマニュアルを読み直し、動いている初期状態のコードを読み・やっと構成の理解が深まってくる。

ベンチマーク実行

2025-01-13.2.46.16.mov

実施内容

・適宜index付与
・internalGetMatchingのmatching呼び出し一度で全てマッチさせる
・chairの全権取得(*)を止めて必要なカラムを取得し、is_activeで絞り込む、不要なselectを止める
・chairに位置情報(latitude, longitude)を持たせる,初期化処理(postInitialize)でDBも初期化しているので、chair_locationsから情報を取得してchairに入れる
・matching構造体を定義してそこに距離を持たせる、chairとrideの距離を先に計算して距離が小さい順に並べておく、距離が遠すぎる場合はマッチングせずcontinueする。
・chairにtotal_distance, moved_atを持たせる
・appGetNearbyChairsを改善する
・multihostにする (DBサーバの設定を他のサーバから接続できるようにする。そしてisuride-matcherを止める。)
・DBの負荷が高いこと、matchingの確認頻度に併せて、notificationのRetryAfterMs設定を30 -> 400程度の調整する

[ToDos]
追記する...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages