Open saza-ku opened 7 months ago
+-------+--------+-----+-----+-----+-----+-----+-----+
| COUNT | METHOD | URI | MIN | MAX | SUM | AVG | P99 |
+-------+--------+-----+-----+-----+-----+-----+-----+
+-------+--------+-----+-----+-----+-----+-----+-----+
Reading from STDIN ...
# No events processed.
http://localhost:19993/#menu_services;after=1700879775372;before=1700879855379
go tool pprof -http=0.0.0.0:1080 http://isucon3/pprof/11250236
+-------+--------+------------------------------------------+--------+--------+--------+--------+--------+
| COUNT | METHOD | URI | MIN | MAX | SUM | AVG | P99 |
+-------+--------+------------------------------------------+--------+--------+--------+--------+--------+
| 1 | POST | /api/initialize | 13.364 | 13.364 | 13.364 | 13.364 | 13.364 |
| 2 | GET | /api/livestream/.+/statistics | 5.588 | 5.660 | 11.248 | 5.624 | 5.660 |
| 2 | GET | /api/user/.+/statistics | 3.240 | 3.252 | 6.492 | 3.246 | 3.252 |
| 1 | POST | /api/register | 0.044 | 0.044 | 0.044 | 0.044 | 0.044 |
| 1 | POST | /api/livestream/.+ | 0.036 | 0.036 | 0.036 | 0.036 | 0.036 |
| 3 | POST | /api/livestream/.+/reaction | 0.008 | 0.012 | 0.032 | 0.011 | 0.012 |
| 2 | POST | /api/livestream/.+/livecomment | 0.012 | 0.016 | 0.028 | 0.014 | 0.016 |
| 2 | POST | /api/livestream/.+/livecomment/.+/report | 0.012 | 0.012 | 0.024 | 0.012 | 0.012 |
| 1 | POST | /api/livestream/.+/enter | 0.008 | 0.008 | 0.008 | 0.008 | 0.008 |
| 3 | POST | /api/login | 0.000 | 0.004 | 0.004 | 0.001 | 0.004 |
| 3 | GET | /api/tag | 0.000 | 0.004 | 0.004 | 0.001 | 0.004 |
| 1 | GET | /api/payment | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
+-------+--------+------------------------------------------+--------+--------+--------+--------+--------+
Count: 1000 Time=0.01s (5s) Lock=0.00s (0s) Rows=0.0 (0), isucon[isucon]@localhost
INSERT INTO users (id, name, display_name, description, password) VALUES (N, 'S', 'S', 'S', 'S')
Count: 14992 Time=0.00s (4s) Lock=0.00s (0s) Rows=1.0 (14992), isucon[isucon]@localhost
SELECT IFNULL(SUM(l2.tip), N) FROM livestreams l INNER JOIN livecomments l2 ON l.id = l2.livestream_id WHERE l.id = N
Count: 14992 Time=0.00s (4s) Lock=0.00s (0s) Rows=1.0 (14992), isucon[isucon]@localhost
SELECT COUNT(*) FROM livestreams l INNER JOIN reactions r ON l.id = r.livestream_id WHERE l.id = N
Count: 2000 Time=0.00s (3s) Lock=0.00s (0s) Rows=1.0 (2000), isucon[isucon]@localhost
SELECT IFNULL(SUM(l2.tip), N) FROM users u
INNER JOIN livestreams l ON l.user_id = u.id
INNER JOIN livecomments l2 ON l2.livestream_id = l.id
WHERE u.id = N
Count: 2000 Time=0.00s (3s) Lock=0.00s (0s) Rows=1.0 (2000), isucon[isucon]@localhost
SELECT COUNT(*) FROM users u
INNER JOIN livestreams l ON l.user_id = u.id
INNER JOIN reactions r ON r.livestream_id = l.id
WHERE u.id = N
Count: 510 Time=0.00s (2s) Lock=0.00s (0s) Rows=0.0 (0), isucon[isucon]@localhost
INSERT INTO themes (user_id, dark_mode) VALUES (N, true)
Count: 490 Time=0.00s (2s) Lock=0.00s (0s) Rows=0.0 (0), isucon[isucon]@localhost
INSERT INTO themes (user_id, dark_mode) VALUES (N, false)
Count: 103 Time=0.01s (0s) Lock=0.00s (0s) Rows=0.0 (0), isucon[isucon]@localhost
INSERT INTO tags(name) VALUES ('S')
Reading from STDIN ...
# 2.9s user time, 40ms system time, 43.32M rss, 58.14M vsz
# Current date: Sat Nov 25 02:37:38 2023
# Hostname: ip-192-168-0-12
# Files: STDIN
# Overall: 38.86k total, 78 unique, 479.73 QPS, 0.35x concurrency ________
# Time range: 2023-11-25T02:36:15 to 2023-11-25T02:37:36
# Attribute total min max avg 95% stddev median
# ============ ======= ======= ======= ======= ======= ======= =======
# Exec time 28s 1us 422ms 729us 4ms 3ms 316us
# Lock time 35ms 0 87us 0 1us 0 1us
# Rows sent 50.23k 0 7.32k 1.32 0.99 54.15 0.99
# Rows examine 36.61M 0 14.00k 987.85 1.96k 511.69 964.41
# Query size 7.70M 5 1.94M 207.78 158.58 10.47k 118.34
# Profile
# Rank Query ID Response time Calls R/Call V/M Item
# ==== ============================= ============= ===== ====== ===== ====
# 1 0xDFFCC1D78939C4D781C7C583... 5.3250 18.8% 1000 0.0053 0.00 INSERT users
# 2 0xD2A0864774622BA36F655749... 4.9767 17.6% 1001 0.0050 0.00 INSERT themes
# 3 0xFD38427AE3D09E3883A680F7... 4.9355 17.4% 14992 0.0003 0.00 SELECT livestreams livecomments
# 4 0xC499D81D570D361DB61FC43A... 4.3197 15.2% 14992 0.0003 0.00 SELECT livestreams reactions
# MISC 0xMISC 8.7900 31.0% 6873 0.0013 0.0 <74 ITEMS>
# Query 1: 100 QPS, 0.53x concurrency, ID 0xDFFCC1D78939C4D781C7C58349101F50 at byte 114582
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T02:36:16 to 2023-11-25T02:36:26
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 2 1000
# Exec time 18 5s 3ms 14ms 5ms 7ms 930us 5ms
# Lock time 3 1ms 0 12us 1us 1us 0 1us
# Rows sent 0 0 0 0 0 0 0 0
# Rows examine 0 0 0 0 0 0 0 0
# Query size 5 401.18k 192 463 410.81 420.77 16.87 400.73
# String:
# Hosts localhost
# Users isucon
# Query_time distribution
# 1us
# 10us
# 100us
# 1ms ################################################################
# 10ms #
# 100ms
# 1s
# 10s+
# Tables
# SHOW TABLE STATUS LIKE 'users'\G
# SHOW CREATE TABLE `users`\G
INSERT INTO users (id, name, display_name, description, password) VALUES (129, 'maayasasaki0', 'ちょっぴりちょこれーと', '普段営業をしています。\nよろしくおねがいします!\n\n連絡は以下からお願いします。\n\nウェブサイト: http://maayasasaki.example.com/\nメールアドレス: maayasasaki@example.com\n', '$2a$04$a2FyUeWJPpgE//4QaPNUSePy8ie9/KM46MavQwzvTx32r05ZE2vPC')\G
# Query 2: 33.37 QPS, 0.17x concurrency, ID 0xD2A0864774622BA36F6557496405CF75 at byte 114321
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T02:36:16 to 2023-11-25T02:36:46
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 2 1001
# Exec time 17 5s 109us 13ms 5ms 6ms 663us 5ms
# Lock time 3 1ms 0 10us 1us 1us 0 1us
# Rows sent 0 0 0 0 0 0 0 0
# Rows examine 0 0 0 0 0 0 0 0
# Query size 0 57.07k 55 60 58.38 56.92 0.19 56.92
# String:
# Hosts localhost
# Users isucon
# Query_time distribution
# 1us
# 10us
# 100us #
# 1ms ################################################################
# 10ms #
# 100ms
# 1s
# 10s+
# Tables
# SHOW TABLE STATUS LIKE 'themes'\G
# SHOW CREATE TABLE `themes`\G
INSERT INTO themes (user_id, dark_mode) VALUES (128, false)\G
# Query 3: 1.07k QPS, 0.35x concurrency, ID 0xFD38427AE3D09E3883A680F7BAF95D3A at byte 8316893
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T02:36:32 to 2023-11-25T02:36:46
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 38 14992
# Exec time 17 5s 295us 7ms 329us 332us 67us 316us
# Lock time 38 14ms 0 17us 0 1us 0 1us
# Rows sent 29 14.64k 1 1 1 1 0 1
# Rows examine 39 14.33M 1001 1003 1002 964.41 0 964.41
# Query size 22 1.71M 117 120 119.85 118.34 0.64 118.34
# String:
# Hosts localhost
# Users isucon
# Query_time distribution
# 1us
# 10us
# 100us ################################################################
# 1ms #
# 10ms
# 100ms
# 1s
# 10s+
# Tables
# SHOW TABLE STATUS FROM `isupipe` LIKE 'livestreams'\G
# SHOW CREATE TABLE `isupipe`.`livestreams`\G
# SHOW TABLE STATUS FROM `isupipe` LIKE 'livecomments'\G
# SHOW CREATE TABLE `isupipe`.`livecomments`\G
# EXPLAIN /*!50100 PARTITIONS*/
SELECT IFNULL(SUM(l2.tip), 0) FROM livestreams l INNER JOIN livecomments l2 ON l.id = l2.livestream_id WHERE l.id = 4025\G
# *************************** 1. row ***************************
# id: 1
# select_type: SIMPLE
# table: l
# partitions: NULL
# type: const
# possible_keys: PRIMARY
# key: PRIMARY
# key_len: 8
# ref: const
# rows: 1
# filtered: 100.00
# Extra: Using index
# *************************** 2. row ***************************
# id: 1
# select_type: SIMPLE
# table: l2
# partitions: NULL
# type: ALL
# possible_keys: NULL
# key: NULL
# key_len: NULL
# ref: NULL
# rows: 1003
# filtered: 10.00
# Extra: Using where
# Query 4: 1.07k QPS, 0.31x concurrency, ID 0xC499D81D570D361DB61FC43A94BB888A at byte 8009921
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T02:36:32 to 2023-11-25T02:36:46
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 38 14992
# Exec time 15 4s 256us 3ms 288us 301us 36us 273us
# Lock time 37 13ms 0 87us 0 1us 0 1us
# Rows sent 29 14.64k 1 1 1 1 0 1
# Rows examine 39 14.33M 1001 1004 1002.50 964.41 0 964.41
# Query size 18 1.44M 98 101 100.85 97.36 0 97.36
# String:
# Hosts localhost
# Users isucon
# Query_time distribution
# 1us
# 10us
# 100us ################################################################
# 1ms #
# 10ms
# 100ms
# 1s
# 10s+
# Tables
# SHOW TABLE STATUS FROM `isupipe` LIKE 'livestreams'\G
# SHOW CREATE TABLE `isupipe`.`livestreams`\G
# SHOW TABLE STATUS FROM `isupipe` LIKE 'reactions'\G
# SHOW CREATE TABLE `isupipe`.`reactions`\G
# EXPLAIN
SELECT COUNT(*) FROM livestreams l INNER JOIN reactions r ON l.id = r.livestream_id WHERE l.id = 3539\G
# *************************** 1. row ***************************
# id: 1
# select_type: SIMPLE
# table: l
# partitions: NULL
# type: const
# possible_keys: PRIMARY
# key: PRIMARY
# key_len: 8
# ref: const
# rows: 1
# filtered: 100.00
# Extra: Using index
# *************************** 2. row ***************************
# id: 1
# select_type: SIMPLE
# table: r
# partitions: NULL
# type: ALL
# possible_keys: NULL
# key: NULL
# key_len: NULL
# ref: NULL
# rows: 1004
# filtered: 10.00
# Extra: Using where
http://localhost:19992/#menu_services;after=1700879775383;before=1700879855390
go tool pprof -http=0.0.0.0:1080 http://isucon2/pprof/11250236
isucon1
alp
slow query
explain
netdata
http://localhost:19991/#menu_services;after=1700879775371;before=1700879851525
pprof