Open saza-ku opened 1 year ago
+-------+--------+-----+-----+-----+-----+-----+-----+
| COUNT | METHOD | URI | MIN | MAX | SUM | AVG | P99 |
+-------+--------+-----+-----+-----+-----+-----+-----+
+-------+--------+-----+-----+-----+-----+-----+-----+
Reading from STDIN ...
# No events processed.
http://localhost:19993/#menu_services;after=1700878912771;before=1700878992778
go tool pprof -http=0.0.0.0:1080 http://isucon3/pprof/11250221
+-------+--------+------------------------------------------+--------+--------+--------+--------+--------+
| COUNT | METHOD | URI | MIN | MAX | SUM | AVG | P99 |
+-------+--------+------------------------------------------+--------+--------+--------+--------+--------+
| 1 | POST | /api/initialize | 15.060 | 15.060 | 15.060 | 15.060 | 15.060 |
| 2 | GET | /api/livestream/.+/statistics | 5.588 | 5.644 | 11.232 | 5.616 | 5.644 |
| 2 | GET | /api/user/.+/statistics | 2.588 | 2.624 | 5.212 | 2.606 | 2.624 |
| 1 | POST | /api/register | 0.040 | 0.040 | 0.040 | 0.040 | 0.040 |
| 1 | POST | /api/livestream/.+ | 0.032 | 0.032 | 0.032 | 0.032 | 0.032 |
| 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.016 | 0.028 | 0.014 | 0.016 |
| 3 | POST | /api/login | 0.000 | 0.004 | 0.008 | 0.003 | 0.004 |
| 1 | POST | /api/livestream/.+/enter | 0.008 | 0.008 | 0.008 | 0.008 | 0.008 |
| 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: 510 Time=0.01s (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.01s (2s) Lock=0.00s (0s) Rows=0.0 (0), isucon[isucon]@localhost
INSERT INTO themes (user_id, dark_mode) VALUES (N, false)
Count: 2000 Time=0.00s (2s) 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 (2s) 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: 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, 30ms system time, 43.32M rss, 58.14M vsz
# Current date: Sat Nov 25 02:23:16 2023
# Hostname: ip-192-168-0-12
# Files: STDIN
# Overall: 38.84k total, 79 unique, 479.51 QPS, 0.35x concurrency ________
# Time range: 2023-11-25T02:21:52 to 2023-11-25T02:23:13
# Attribute total min max avg 95% stddev median
# ============ ======= ======= ======= ======= ======= ======= =======
# Exec time 29s 1us 561ms 736us 5ms 4ms 316us
# Lock time 35ms 0 86us 0 1us 0 1us
# Rows sent 50.23k 0 7.32k 1.32 0.99 54.16 0.99
# Rows examine 36.58M 0 14.00k 987.52 1.96k 511.90 964.41
# Query size 7.70M 5 1.94M 207.77 158.58 10.48k 118.34
# Profile
# Rank Query ID Response time Calls R/Call V/M Item
# ==== ============================= ============= ===== ====== ===== ====
# 1 0xDFFCC1D78939C4D781C7C583... 5.8289 20.4% 1000 0.0058 0.00 INSERT users
# 2 0xD2A0864774622BA36F655749... 5.4008 18.9% 1001 0.0054 0.00 INSERT themes
# 3 0xFD38427AE3D09E3883A680F7... 4.9331 17.2% 14992 0.0003 0.00 SELECT livestreams livecomments
# 4 0xC499D81D570D361DB61FC43A... 4.2957 15.0% 14992 0.0003 0.00 SELECT livestreams reactions
# MISC 0xMISC 8.1583 28.5% 6855 0.0012 0.0 <75 ITEMS>
# Query 1: 90.91 QPS, 0.53x concurrency, ID 0xDFFCC1D78939C4D781C7C58349101F50 at byte 458859
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T02:21:53 to 2023-11-25T02:22:04
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 2 1000
# Exec time 20 6s 3ms 45ms 6ms 8ms 2ms 5ms
# Lock time 3 1ms 1us 8us 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 (521, 'hiroshisuzuki1', 'たんぽぽたね', '普段寿司職人をしています。\nよろしくおねがいします!\n\n連絡は以下からお願いします。\n\nウェブサイト: http://hiroshisuzuki.example.com/\nメールアドレス: hiroshisuzuki@example.com\n', '$2a$04$/0I5Z3FbgSF8C7k8qSfp3.ytDI6zVKZQ0u1qb4OeREpHxQzl6CTFW')\G
# Query 2: 32.29 QPS, 0.17x concurrency, ID 0xD2A0864774622BA36F6557496405CF75 at byte 664102
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T02:21:53 to 2023-11-25T02:22:24
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 2 1001
# Exec time 18 5s 102us 12ms 5ms 7ms 777us 5ms
# Lock time 3 1ms 0 13us 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 (755, true)\G
# Query 3: 1.07k QPS, 0.35x concurrency, ID 0xFD38427AE3D09E3883A680F7BAF95D3A at byte 9308187
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T02:22:10 to 2023-11-25T02:22:24
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 38 14992
# Exec time 17 5s 290us 3ms 329us 332us 42us 316us
# Lock time 38 13ms 0 34us 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 = 5571\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 7917157
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T02:22:10 to 2023-11-25T02:22:24
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 38 14992
# Exec time 15 4s 251us 3ms 286us 301us 31us 273us
# Lock time 38 14ms 0 86us 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 = 3367\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=1700878912836;before=1700878992846
go tool pprof -http=0.0.0.0:1080 http://isucon2/pprof/11250221
isucon1
alp
slow query
explain
netdata
http://localhost:19991/#menu_services;after=1700878912858;before=1700878988923
pprof