-
Notifications
You must be signed in to change notification settings - Fork 0
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
Comments
見れるようになった! |
ベンチの回し方参考: https://github.com/matsuu/aws-isucon/blob/main/isucon11-qualify/README.md#bench
|
ログのみかた
|
ブラウザからログインする
|
サーバで
|
Cloud Trace を試してみる |
alp でアクセスログ分析brew install alp $ cat access.log | alp ltsv -r --sort=sum -m "/api/condition/.+,/api/isu/.*,/isu/.*"
+-------+-----+-------+-----+------+-----+--------+------------------------------+-------+-------+----------+-------+-------+-------+-------+--------+-----------+------------+-------------+------------+
| COUNT | 1XX | 2XX | 3XX | 4XX | 5XX | METHOD | URI | MIN | MAX | SUM | AVG | P90 | P95 | P99 | STDDEV | MIN(BODY) | MAX(BODY) | SUM(BODY) | AVG(BODY) |
+-------+-----+-------+-----+------+-----+--------+------------------------------+-------+-------+----------+-------+-------+-------+-------+--------+-----------+------------+-------------+------------+
| 60688 | 0 | 54747 | 0 | 5941 | 0 | POST | /api/condition/.+ | 0.004 | 0.132 | 2114.512 | 0.035 | 0.088 | 0.100 | 0.104 | 0.025 | 0.000 | 14.000 | 70.000 | 0.001 |
| 218 | 0 | 44 | 0 | 174 | 0 | POST | /api/isu | 0.004 | 1.016 | 178.424 | 0.818 | 1.004 | 1.004 | 1.008 | 0.345 | 0.000 | 145.000 | 5370.000 | 24.633 |
| 182 | 0 | 13 | 0 | 169 | 0 | GET | /api/isu | 0.024 | 1.012 | 167.436 | 0.920 | 1.004 | 1.004 | 1.012 | 0.262 | 0.000 | 2478.000 | 6096.000 | 33.495 |
| 209 | 0 | 125 | 0 | 84 | 0 | GET | /api/isu/.* | 0.004 | 1.012 | 80.668 | 0.386 | 1.004 | 1.004 | 1.008 | 0.440 | 0.000 | 135259.000 | 1415692.000 | 6773.646 |
| 68 | 0 | 16 | 0 | 52 | 0 | POST | /api/auth | 0.016 | 1.012 | 36.696 | 0.540 | 1.004 | 1.004 | 1.012 | 0.490 | 0.000 | 19.000 | 184.000 | 2.706 |
| 29 | 0 | 20 | 0 | 9 | 0 | GET | /api/condition/.+ | 0.004 | 1.004 | 2.776 | 0.096 | 0.720 | 1.000 | 1.004 | 0.279 | 0.000 | 5431.000 | 39977.000 | 1378.517 |
| 9 | 0 | 9 | 0 | 0 | 0 | GET | /api/trend | 0.032 | 0.244 | 1.448 | 0.161 | 0.244 | 0.244 | 0.244 | 0.070 | 2661.000 | 2661.000 | 23949.000 | 2661.000 |
| 48 | 0 | 12 | 36 | 0 | 0 | GET | /assets/vendor.ee7444dd.js | 0.004 | 0.044 | 0.420 | 0.009 | 0.040 | 0.040 | 0.044 | 0.013 | 0.000 | 743417.000 | 8921004.000 | 185854.250 |
| 48 | 0 | 12 | 36 | 0 | 0 | GET | /assets/favicon.d0f5f504.svg | 0.004 | 0.028 | 0.260 | 0.005 | 0.020 | 0.028 | 0.028 | 0.008 | 0.000 | 592.000 | 7104.000 | 148.000 |
| 48 | 0 | 12 | 36 | 0 | 0 | GET | /assets/index.144d8ca8.css | 0.004 | 0.028 | 0.256 | 0.005 | 0.020 | 0.024 | 0.028 | 0.007 | 0.000 | 19066.000 | 228792.000 | 4766.500 |
| 1 | 0 | 1 | 0 | 0 | 0 | POST | /initialize | 0.256 | 0.256 | 0.256 | 0.256 | 0.256 | 0.256 | 0.256 | 0.000 | 21.000 | 21.000 | 21.000 | 21.000 |
| 48 | 0 | 12 | 36 | 0 | 0 | GET | /assets/index.23dac98b.js | 0.004 | 0.028 | 0.252 | 0.005 | 0.020 | 0.020 | 0.028 | 0.007 | 0.000 | 26667.000 | 320004.000 | 6666.750 |
| 26 | 0 | 22 | 4 | 0 | 0 | GET | / | 0.012 | 0.016 | 0.232 | 0.009 | 0.016 | 0.016 | 0.016 | 0.006 | 0.000 | 528.000 | 11616.000 | 446.769 |
| 48 | 0 | 12 | 36 | 0 | 0 | GET | /assets/logo_white.svg | 0.012 | 0.020 | 0.208 | 0.004 | 0.016 | 0.020 | 0.020 | 0.006 | 0.000 | 3285.000 | 39420.000 | 821.250 |
| 11 | 0 | 11 | 0 | 0 | 0 | GET | /assets/logo_orange.svg | 0.016 | 0.016 | 0.128 | 0.012 | 0.016 | 0.016 | 0.016 | 0.006 | 3288.000 | 3288.000 | 36168.000 | 3288.000 |
| 12 | 0 | 10 | 0 | 2 | 0 | GET | /api/user/me | 0.012 | 0.020 | 0.128 | 0.011 | 0.020 | 0.020 | 0.020 | 0.007 | 21.000 | 37.000 | 358.000 | 29.833 |
| 6 | 0 | 2 | 0 | 4 | 0 | POST | /api/signout | 0.004 | 0.032 | 0.044 | 0.007 | 0.032 | 0.032 | 0.032 | 0.011 | 21.000 | 21.000 | 84.000 | 14.000 |
| 30 | 0 | 18 | 12 | 0 | 0 | GET | /isu/.* | 0.000 | 0.004 | 0.032 | 0.001 | 0.004 | 0.004 | 0.004 | 0.002 | 0.000 | 528.000 | 9504.000 | 316.800 |
| 3 | 0 | 1 | 2 | 0 | 0 | GET | /register | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 528.000 | 528.000 | 176.000 |
+-------+-----+-------+-----+------+-----+--------+------------------------------+-------+-------+----------+-------+-------+-------+-------+--------+-----------+------------+-------------+------------+ |
|
slow query を取る
$ pt-query-digest logs/mariadb-slow.log
# 230ms user time, 0 system time, 32.39M rss, 39.49M vsz
# Current date: Sun Jun 19 18:32:32 2022
# Hostname: ip-172-31-11-189
# Files: logs/mariadb-slow.log
# Overall: 160 total, 5 unique, 0.11 QPS, 0.02x concurrency ______________
# Time range: 2022-06-19 18:04:04 to 18:29:17
# Attribute total min max avg 95% stddev median
# ============ ======= ======= ======= ======= ======= ======= =======
# Exec time 23s 100ms 271ms 143ms 219ms 35ms 134ms
# Lock time 14ms 0 3ms 86us 366us 284us 33us
# Rows sent 130 0 1 0.81 0.99 0.39 0.99
# Rows examine 6.73M 0 57.91k 43.06k 54.03k 20.70k 51.46k
# Rows affecte 36 0 28 0.23 0.99 2.16 0
# Bytes sent 98.00k 11 782 627.20 755.64 289.00 755.64
# Query size 808.89k 6 790.36k 5.06k 246.02 59.35k 124.25
# Profile
# Rank Query ID Response time Calls R/Call V/M It
# ==== =============================== ============= ===== ====== ===== ==
# 1 0x8155B89FFD74A9D523D19AC409... 18.3341 80.2% 130 0.1410 0.00 SELECT isu_condition
# 2 0xFFFCA4D67EA0A788813031B8BB... 3.4867 15.2% 20 0.1743 0.02 COMMIT
# MISC 0xMISC 1.0526 4.6% 10 0.1053 0.0 <3 ITEMS>
# Query 1: 0.09 QPS, 0.01x concurrency, ID 0x8155B89FFD74A9D523D19AC409FD97AF at byte 13046
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2022-06-19 18:04:05 to 18:29:17
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 81 130
# Exec time 80 18s 100ms 205ms 141ms 180ms 25ms 134ms
# Lock time 96 13ms 23us 3ms 103us 366us 312us 35us
# Rows sent 100 130 1 1 1 1 0 1
# Rows examine 100 6.73M 4.38k 57.91k 52.99k 54.03k 4.95k 51.46k
# Rows affecte 0 0 0 0 0 0 0 0
# Bytes sent 99 97.62k 743 782 768.97 755.64 10.01 755.64
# Query size 1 15.87k 125 125 125 125 0 125
# String:
# Databases isucondition
# Hosts localhost
# Users isucon
# Query_time distribution
# 1us
# 10us
# 100us
# 1ms
# 10ms
# 100ms ################################################################
# 1s
# 10s+
# Tables
# SHOW TABLE STATUS FROM `isucondition` LIKE 'isu_condition'\G
# SHOW CREATE TABLE `isucondition`.`isu_condition`\G
# EXPLAIN /*!50100 PARTITIONS*/
SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'bb76011b-add2-4428-98d3-e0ef0b79bf46' ORDER BY `timestamp` DESC LIMIT 1\G
# Query 2: 20 QPS, 3.49x concurrency, ID 0xFFFCA4D67EA0A788813031B8BBC3B329 at byte 1946
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.02
# Time range: 2022-06-19 18:04:04 to 18:04:05
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 12 20
# Exec time 15 3s 107ms 271ms 174ms 241ms 63ms 208ms
# Lock time 0 0 0 0 0 0 0 0
# Rows sent 0 0 0 0 0 0 0 0
# Rows examine 0 0 0 0 0 0 0 0
# Rows affecte 0 0 0 0 0 0 0 0
# Bytes sent 0 220 11 11 11 11 0 11
# Query size 0 120 6 6 6 6 0 6
# String:
# Databases isucondition
# Hosts localhost
# Users isucon
# Query_time distribution
# 1us
# 10us
# 100us
# 1ms
# 10ms
# 100ms ################################################################
# 1s
# 10s+
COMMIT\G |
ログにうまく動いてないかもって出てたわ... |
Cloud Trace で MySQL がいい感じに表示されてない理由わかった(ref: odanado/isucon11-qualifier-with-yuyushiki#2) 1系しかサポートしてないのが原因だった(isucon11 予選のそれは 2.3.0) |
1系なるほど… |
Cloud Monitoring を入れてみたけど動かない...
トラブルシューティングに従って
わからん 😇 |
Ubuntu 22.04 だと
https://cloud.google.com/monitoring/agent/monitoring?hl=ja#linux_operating_systems ではサポートしているって書いてるんだけどなあ... |
IPアドレス
リンク集
The text was updated successfully, but these errors were encountered: