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

fillLivestreamResponse N+1解消 #8

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

cureseven
Copy link
Member

#1
fillLivestreamResponse
ベンチ復帰待ち


@cureseven
Copy link
Member Author

@mism-mism fillLivestreamResponse ベンチ待ちです

@cureseven
Copy link
Member Author

sql: no rows in result set 時間きたので途中やめ

var livestreamTagModels []*LivestreamTagModel
if err := tx.SelectContext(ctx, &livestreamTagModels, "SELECT * FROM livestream_tags WHERE livestream_id = ?", livestreamModel.ID); err != nil {
return Livestream{}, err
if len(results) == 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

要らない

WHERE l.id = ?
`
err = tx.SelectContext(ctx, &results, query, livestreamModel.ID)
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errがErrNoRowsなら Livestream{}, nilを返す必要がある

@cureseven
Copy link
Member Author

cureseven commented Nov 25, 2023

 

整合性チェックに失敗しました
benchmark-critical: [仕様違反] POST /api/livestream/reservation へのリクエストに対して、レスポンスボディに必要なフィールドがありません: Livestream.ID,Livestream.Owner,Livestream.Tags,Livestream.Title,Livestream.Description,Livestream.PlaylistUrl,Livestream.ThumbnailUrl,Livestream.StartAt,Livestream.EndAt

@cureseven
Copy link
Member Author

cureseven commented Nov 25, 2023

現時点の状態
13,742

2023-11-25T07:09:18.056Z	info	isupipe-benchmarker	SSL接続が有効になっています
2023-11-25T07:09:18.056Z	info	isupipe-benchmarker	静的ファイルチェックを行います
2023-11-25T07:09:18.056Z	info	isupipe-benchmarker	静的ファイルチェックが完了しました
2023-11-25T07:09:18.056Z	info	isupipe-benchmarker	webappの初期化を行います
2023-11-25T07:09:19.826Z	info	isupipe-benchmarker	ベンチマーク走行前のデータ整合性チェックを行います
2023-11-25T07:09:36.567Z	info	isupipe-benchmarker	整合性チェックが成功しました
2023-11-25T07:09:36.567Z	info	isupipe-benchmarker	ベンチマーク走行を開始します
2023-11-25T07:09:38.571Z	info	isupipe-benchmarker	DNS水責め負荷が上昇します	{"parallelis": 3}
2023-11-25T07:09:40.571Z	info	isupipe-benchmarker	DNS水責め負荷が上昇します	{"parallelis": 4}
2023-11-25T07:09:42.571Z	info	isupipe-benchmarker	DNS水責め負荷が上昇します	{"parallelis": 6}
2023-11-25T07:09:44.571Z	info	isupipe-benchmarker	DNS水責め負荷が上昇します	{"parallelis": 9}
2023-11-25T07:09:50.571Z	info	isupipe-benchmarker	DNS水責め負荷が上昇します	{"parallelis": 13}
2023-11-25T07:10:36.568Z	info	isupipe-benchmarker	ベンチマーク走行を停止します
2023-11-25T07:10:36.568Z	warn	isupipe-benchmarker	ライブコメントを配信に投稿できないため、視聴者が離脱します	{"viewer": "xmiura0", "livestream_id": 7626, "error": "Post \"https://gototsubasa0.u.isucon.dev:443/api/livestream/7626/livecomment\": context canceled: ベンチマーク走行が継続できないエラーが発生しました"}
2023-11-25T07:10:36.568Z	warn	isupipe-benchmarker	ライブコメントを配信に投稿できないため、視聴者が離脱します	{"viewer": "kazuya070", "livestream_id": 7630, "error": "Post \"https://yasuhiro280.u.isucon.dev:443/api/livestream/7630/livecomment\": context canceled: ベンチマーク走行が継続できないエラーが発生しました"}
2023-11-25T07:10:36.860Z	info	isupipe-benchmarker	ベンチマーク走行終了
2023-11-25T07:10:36.860Z	info	isupipe-benchmarker	最終チェックを実施します
2023-11-25T07:10:36.860Z	info	isupipe-benchmarker	最終チェックが成功しました
2023-11-25T07:10:36.860Z	info	isupipe-benchmarker	重複排除したログを以下に出力します
2023-11-25T07:10:36.860Z	info	isupipe-benchmarker	配信を最後まで視聴できた視聴者数	{"viewers": 66}

[リクエストタイムアウト] POST /api/register: Post "https://pipe.u.isucon.dev:443/api/register": read udp 10.0.9.232:44222->35.78.167.13:53: i/o timeout: タイムアウトによりリクエスト失敗
[一般エラー] POST /api/icon へのリクエストに対して、期待されたHTTPステータスコードが確認できませんでした (expected:201, actual:500)
[一般エラー] GET /api/livestream/7528/report へのリクエストに対して、期待されたHTTPステータスコードが確認できませんでした (expected:200, actual:500)
[一般エラー] POST /api/livestream/7528/livecomment/1035/report へのリクエストに対して、期待されたHTTPステータスコードが確認できませんでした (expected:201, actual:404)
[一般エラー] GET /api/livestream/7524/report へのリクエストに対して、期待されたHTTPステータスコードが確認できませんでした (expected:200, actual:500)
[一般エラー] POST /api/livestream/7524/livecomment/1017/report へのリクエストに対して、期待されたHTTPステータスコードが確認できませんでした (expected:201, actual:404)
[一般エラー] GET /api/livestream/7533/report へのリクエストに対して、期待されたHTTPステータスコードが確認できませんでした (expected:200, actual:500)
[一般エラー] POST /api/livestream/7524/livecomment/1020/report へのリクエストに対して、期待されたHTTPステータスコードが確認できませんでした (expected:201, actual:404)
[一般エラー] POST /api/livestream/7533/livecomment/1066/report へのリクエストに対して、期待されたHTTPステータスコードが確認できませんでした (expected:201, actual:404)
canceled
名前解決成功数 26587
売上: 13742
Top 20 Sort By Total
Count    Total     Mean   Stddev     Min   P50.0   P90.0   P95.0   P99.0     Max   2xx  3xx  4xx  5xx  TotalBytes   MinBytes  MeanBytes   MaxBytes  Request
  802  178.455   0.2225   0.1743   0.002   0.191   0.479   0.565   0.696   0.795   800    0    2    0    12071592          0      15051      64188  GET /api/livestream/<num>/livecomment
  836  164.815   0.1971   0.1710   0.000   0.163   0.450   0.525   0.692   0.832   834    0    2    0    10704988          0      12805      61773  GET /api/livestream/<num>/reaction
  174  156.933   0.9019   0.1971   0.038   0.949   1.084   1.115   1.177   1.181   171    0    3    0    10572071          0      60759      63860  GET /api/livestream/search?limit=<num> HTTP/1.1
 7090   87.702   0.0124   0.0078   0.000   0.011   0.023   0.028   0.038   0.089  7090    0    0    0   410078396       6969      57838     171847  GET /api/user/*/icon
  571   68.467   0.1199   0.0360   0.000   0.123   0.161   0.177   0.209   0.261   568    0    2    1      266774          0        467        516  POST /api/register HTTP/1.1
  893   56.339   0.0631   0.0177   0.003   0.062   0.084   0.093   0.107   0.134   886    0    7    0     1730083          0       1937       2704  POST /api/livestream/<num>/livecomment
    5   55.614  11.1228   5.1582   5.167  12.686  18.065  18.065  18.065  18.065     2    0    3    0         202          0         40        102  GET /api/livestream/<num>/statistics
  267   43.139   0.1616   0.0795   0.000   0.165   0.255   0.291   0.378   0.487   263    0    4    0      305891          0       1145       1487  POST /api/livestream/reservation HTTP/1.1
  741   28.227   0.0381   0.0147   0.001   0.038   0.057   0.063   0.078   0.089   741    0    0    0     1368429       1552       1846       2230  POST /api/livestream/<num>/reaction
   21   19.160   0.9124   0.7277   0.098   1.342   1.766   1.794   1.824   1.824    21    0    0    0     2386036      98961     113620     128948  GET /api/livestream/search?tag=<tag>
  587   13.481   0.0230   0.0096   0.007   0.021   0.036   0.040   0.057   0.080   564    0    0   23       12469         14         21        154  POST /api/icon HTTP/1.1
  203    9.281   0.0457   0.0269   0.007   0.042   0.082   0.099   0.118   0.142   203    0    0    0      290277          3       1429      22497  GET /api/livestream HTTP/1.1
  576    6.278   0.0109   0.0063   0.001   0.010   0.019   0.022   0.033   0.047   574    0    2    0         128          0          0         64  POST /api/login HTTP/1.1
  158    4.041   0.0256   0.0101   0.005   0.024   0.039   0.050   0.055   0.068   157    0    1    0        7062          0         44        929  GET /api/livestream/<num>/ngwords
  210    3.580   0.0170   0.0225   0.001   0.011   0.034   0.054   0.147   0.173   207    0    0    3       73365          3        349      11278  GET /api/livestream/<num>/report
  253    3.121   0.0123   0.0081   0.000   0.010   0.024   0.029   0.038   0.049   253    0    0    0     1541951       6089       6094       6095  GET /api/tag HTTP/1.1
  108    2.482   0.0230   0.0143   0.002   0.020   0.041   0.052   0.069   0.084   108    0    0    0        2484         23         23         23  POST /api/livestream/<num>/moderate
    1    1.753   1.7530   0.0000   1.753   1.753   1.753   1.753   1.753   1.753     1    0    0    0          27         27         27         27  POST /api/initialize HTTP/1.1
   14    1.310   0.0936   0.0331   0.023   0.102   0.121   0.144   0.144   0.144    14    0    0    0        1971        133        140        161  GET /api/user/*/statistics
   77    0.812   0.0105   0.0076   0.000   0.009   0.019   0.030   0.037   0.037    77    0    0    0           0          0          0          0  POST /api/livestream/<num>/enter

top-slow.log

@mism-mism mism-mism mentioned this pull request Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants