saza-ku / isucon13

0 stars 0 forks source link

11250224 #10

Open saza-ku opened 1 year ago

saza-ku commented 1 year ago

isucon3

alp

+-------+--------+-----+-----+-----+-----+-----+-----+
| COUNT | METHOD | URI | MIN | MAX | SUM | AVG | P99 |
+-------+--------+-----+-----+-----+-----+-----+-----+
+-------+--------+-----+-----+-----+-----+-----+-----+

slow query

explain

Reading from STDIN ...

# No events processed.

netdata

http://localhost:19993/#menu_services;after=1700879052182;before=1700879132189

pprof

go tool pprof -http=0.0.0.0:1080 http://isucon3/pprof/11250224
saza-ku commented 1 year ago

isucon2

alp

+-------+--------+------------------------------------------+--------+--------+--------+--------+--------+
| COUNT | METHOD |                   URI                    |  MIN   |  MAX   |  SUM   |  AVG   |  P99   |
+-------+--------+------------------------------------------+--------+--------+--------+--------+--------+
| 1     | POST   | /api/initialize                          | 16.204 | 16.204 | 16.204 | 16.204 | 16.204 |
| 2     | GET    | /api/livestream/.+/statistics            | 5.596  | 5.604  | 11.200 | 5.600  | 5.604  |
| 2     | GET    | /api/user/.+/statistics                  | 4.648  | 4.820  | 9.468  | 4.734  | 4.820  |
| 1     | POST   | /api/register                            | 0.040  | 0.040  | 0.040  | 0.040  | 0.040  |
| 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.016  | 0.016  | 0.032  | 0.016  | 0.016  |
| 2     | POST   | /api/livestream/.+/livecomment/.+/report | 0.012  | 0.016  | 0.028  | 0.014  | 0.016  |
| 3     | POST   | /api/login                               | 0.004  | 0.004  | 0.012  | 0.004  | 0.004  |
| 1     | POST   | /api/livestream/.+/enter                 | 0.008  | 0.008  | 0.008  | 0.008  | 0.008  |
| 3     | GET    | /api/tag                                 | 0.004  | 0.004  | 0.004  | 0.001  | 0.004  |
| 1     | GET    | /api/payment                             | 0.000  | 0.000  | 0.000  | 0.000  | 0.000  |
+-------+--------+------------------------------------------+--------+--------+--------+--------+--------+

slow query

Count: 1000  Time=0.01s (6s)  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: 2000  Time=0.00s (4s)  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 (4s)  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: 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 (3s)  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 (3s)  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')

explain

Reading from STDIN ...

# 2.9s user time, 30ms system time, 43.30M rss, 58.12M vsz
# Current date: Sat Nov 25 02:25:35 2023
# Hostname: ip-192-168-0-12
# Files: STDIN
# Overall: 38.83k total, 77 unique, 485.36 QPS, 0.43x concurrency ________
# Time range: 2023-11-25T02:24:12 to 2023-11-25T02:25:32
# Attribute          total     min     max     avg     95%  stddev  median
# ============     ======= ======= ======= ======= ======= ======= =======
# Exec time            34s     1us   511ms   878us     5ms     4ms   316us
# Lock time           36ms       0    37us       0     1us       0     1us
# Rows sent         50.22k       0   7.32k    1.32    0.99   54.17    0.99
# Rows examine      36.58M       0  14.00k  987.79   1.96k  511.72  964.41
# Query size         7.70M       5   1.94M  207.80  158.58  10.48k  118.34

# Profile
# Rank Query ID                      Response time Calls R/Call V/M   Item
# ==== ============================= ============= ===== ====== ===== ====
#    1 0xDFFCC1D78939C4D781C7C583...  6.4342 18.9%  1000 0.0064  0.00 INSERT users
#    2 0xD2A0864774622BA36F655749...  6.1679 18.1%  1001 0.0062  0.00 INSERT themes
#    3 0xFD38427AE3D09E3883A680F7...  4.9473 14.5% 14992 0.0003  0.00 SELECT livestreams livecomments
#    4 0xF1B8EF06D6CA63B24BFF433E...  4.6128 13.5%  2000 0.0023  0.00 SELECT users livestreams livecomments
# MISC 0xMISC                        11.9382 35.0% 19836 0.0006   0.0 <73 ITEMS>

# Query 1: 83.33 QPS, 0.54x concurrency, ID 0xDFFCC1D78939C4D781C7C58349101F50 at byte 131262
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T02:24:13 to 2023-11-25T02:24:25
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count          2    1000
# Exec time     18      6s     4ms    28ms     6ms     9ms     1ms     6ms
# Lock time      3     1ms     1us    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     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 (148, 'lota0', 'すずすずすずらん', '普段ウェブデザイナーをしています。\nよろしくおねがいします!\n\n連絡は以下からお願いします。\n\nウェブサイト: http://lota.example.com/\nメールアドレス: lota@example.com\n', '$2a$04$PUrpyrjNpP70jWQyFIS90OhOzVk3PRTdtDSn97v5GlHG5//.Pc8ma')\G

# Query 2: 27.81 QPS, 0.17x concurrency, ID 0xD2A0864774622BA36F6557496405CF75 at byte 416688
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T02:24:13 to 2023-11-25T02:24:49
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count          2    1001
# Exec time     18      6s   101us    82ms     6ms     8ms     2ms     6ms
# Lock time      3     1ms       0     3us     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 (474, false)\G

# Query 3: 937 QPS, 0.31x concurrency, ID 0xFD38427AE3D09E3883A680F7BAF95D3A at byte 6182524
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T02:24:33 to 2023-11-25T02:24:49
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count         38   14992
# Exec time     14      5s   295us     3ms   329us   332us    32us   316us
# Lock time     38    14ms       0    19us       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 = 621\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: 133.33 QPS, 0.31x concurrency, ID 0xF1B8EF06D6CA63B24BFF433E06CCEB22 at byte 5607476
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T02:24:28 to 2023-11-25T02:24:43
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count          5    2000
# Exec time     13      5s     2ms    23ms     2ms     2ms   627us     2ms
# Lock time      6     2ms       0     7us     1us     1us       0     1us
# Rows sent      3   1.95k       1       1       1       1       0       1
# Rows examine  10   3.82M   1.96k   1.96k   1.96k   1.96k       2   1.96k
# Query size     4 322.06k     163     166  164.89  158.58       0  158.58
# String:
# Hosts        localhost
# Users        isucon
# Query_time distribution
#   1us
#  10us
# 100us
#   1ms  ################################################################
#  10ms  #
# 100ms
#    1s
#  10s+
# Tables
#    SHOW TABLE STATUS FROM `isupipe` LIKE 'users'\G
#    SHOW CREATE TABLE `isupipe`.`users`\G
#    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 
SELECT IFNULL(SUM(l2.tip), 0) 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 = 753\G
# *************************** 1. row ***************************
#            id: 1
#   select_type: SIMPLE
#         table: u
#    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: 100.00
#         Extra: NULL
# *************************** 3. row ***************************
#            id: 1
#   select_type: SIMPLE
#         table: l
#    partitions: NULL
#          type: eq_ref
# possible_keys: PRIMARY
#           key: PRIMARY
#       key_len: 8
#           ref: isupipe.l2.livestream_id
#          rows: 1
#      filtered: 10.00
#         Extra: Using where

netdata

http://localhost:19992/#menu_services;after=1700879052193;before=1700879132200

pprof

go tool pprof -http=0.0.0.0:1080 http://isucon2/pprof/11250224
saza-ku commented 1 year ago

isucon1

alp

+-------+--------+-------------------------------+--------+--------+---------+--------+--------+
| COUNT | METHOD |              URI              |  MIN   |  MAX   |   SUM   |  AVG   |  P99   |
+-------+--------+-------------------------------+--------+--------+---------+--------+--------+
| 10    | GET    | /api/livestream/.+/statistics | 25.436 | 27.165 | 262.242 | 26.224 | 27.165 |
| 2     | GET    | /api/livestream/.+            | 0.200  | 0.200  | 0.400   | 0.200  | 0.200  |
| 2     | GET    | /api/user/.+                  | 0.004  | 0.056  | 0.060   | 0.030  | 0.056  |
| 2     | GET    | /api/tag                      | 0.000  | 0.000  | 0.000   | 0.000  | 0.000  |
+-------+--------+-------------------------------+--------+--------+---------+--------+--------+

slow query

Count: 62976  Time=0.00s (65s)  Lock=0.00s (0s)  Rows=1.0 (62976), 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: 62978  Time=0.00s (55s)  Lock=0.00s (0s)  Rows=1.0 (62978), isucon[isucon]@localhost
  SELECT COUNT(*) FROM livestreams l INNER JOIN reactions r ON l.id = r.livestream_id WHERE l.id = N

Count: 10  Time=0.03s (0s)  Lock=0.00s (0s)  Rows=7495.0 (74950), isucon[isucon]@localhost
  SELECT * FROM livestreams

Count: 20  Time=0.01s (0s)  Lock=0.00s (0s)  Rows=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM livestream_tags WHERE livestream_id = N

Count: 56  Time=0.00s (0s)  Lock=0.00s (0s)  Rows=0.8 (44), isudns[isudns]@localhost
  SELECT content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE disabled=N and name='S' and domain_id=N

Count: 52  Time=0.00s (0s)  Lock=0.00s (0s)  Rows=0.5 (26), isudns[isudns]@localhost
  SELECT content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE disabled=N and type='S' and name='S'

Count: 22  Time=0.00s (0s)  Lock=0.00s (0s)  Rows=1.0 (22), isucon[isucon]@localhost
  SELECT * FROM themes WHERE user_id = N

Count: 6  Time=0.00s (0s)  Lock=0.00s (0s)  Rows=1.0 (6), isucon[isucon]@localhost
  SELECT IFNULL(MAX(tip), N) FROM livestreams l INNER JOIN livecomments l2 ON l2.livestream_id = l.id WHERE l.id = N

Count: 6  Time=0.00s (0s)  Lock=0.00s (0s)  Rows=1.0 (6), isucon[isucon]@localhost
  SELECT COUNT(*) FROM livestreams l INNER JOIN reactions r ON r.livestream_id = l.id WHERE l.id = N

Count: 60  Time=0.00s (0s)  Lock=0.00s (0s)  Rows=0.0 (0), isudns[isudns]@localhost
  select kind,content from domains, domainmetadata where domainmetadata.domain_id=domains.id and name='S'

explain

Reading from STDIN ...

# 17.2s user time, 270ms system time, 36.62M rss, 51.13M vsz
# Current date: Sat Nov 25 02:25:49 2023
# Hostname: ip-192-168-0-11
# Files: STDIN
# Overall: 150.40k total, 27 unique, 1.95k QPS, 2.16x concurrency ________
# Time range: 2023-11-25T02:24:28 to 2023-11-25T02:25:45
# Attribute          total     min     max     avg     95%  stddev  median
# ============     ======= ======= ======= ======= ======= ======= =======
# Exec time           166s     2us    78ms     1ms     2ms   821us   690us
# Lock time          237ms       0     2ms     1us     1us    16us     1us
# Rows sent        219.96k       0   7.32k    1.50    0.99   61.03    0.99
# Rows examine     143.55M       0  10.71k 1000.82  964.41  130.54  964.41
# Query size        15.81M       6     195  110.22  118.34   10.99   97.36

# Profile
# Rank Query ID                      Response time Calls R/Call V/M   Item
# ==== ============================= ============= ===== ====== ===== ====
#    1 0xFD38427AE3D09E3883A680F7... 89.8954 54.1% 74950 0.0012  0.00 SELECT livestreams livecomments
#    2 0xC499D81D570D361DB61FC43A... 75.5962 45.5% 74950 0.0010  0.00 SELECT livestreams reactions
#    3 0x050F7D44808F43E5D33D0B90...  0.3225  0.2%    10 0.0322  0.01 SELECT livestreams
#    4 0xF7144185D9A142A426A36DC5...  0.2266  0.1%    20 0.0113  0.00 SELECT livestream_tags
# MISC 0xMISC                         0.1711  0.1%   472 0.0004   0.0 <23 ITEMS>

# Query 1: 1.41k QPS, 1.70x concurrency, ID 0xFD38427AE3D09E3883A680F7BAF95D3A at byte 28521339
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T02:24:52 to 2023-11-25T02:25:45
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count         49   74950
# Exec time     54     90s   304us    23ms     1ms     2ms   799us   839us
# Lock time     46   111ms       0     2ms     1us     1us    16us     1us
# Rows sent     33  73.19k       1       1       1       1       0       1
# Rows examine  49  71.55M    1001    1001    1001    1001       0    1001
# Query size    54   8.57M     117     120  119.85  118.34    0.64  118.34
# String:
# Databases    isupipe
# 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 = 174\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: 1001
#      filtered: 10.00
#         Extra: Using where

# Query 2: 1.41k QPS, 1.43x concurrency, ID 0xC499D81D570D361DB61FC43A94BB888A at byte 45462983
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T02:24:52 to 2023-11-25T02:25:45
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count         49   74950
# Exec time     45     76s   282us    12ms     1ms     2ms   692us   596us
# Lock time     52   126ms       0     1ms     1us     1us    17us     1us
# Rows sent     33  73.19k       1       1       1       1       0       1
# Rows examine  49  71.55M    1001    1001    1001    1001       0    1001
# Query size    45   7.21M      98     101  100.85   97.36       0   97.36
# String:
# Databases    isupipe
# 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 = 6528\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: 1001
#      filtered: 10.00
#         Extra: Using where

# Query 3: 0.37 QPS, 0.01x concurrency, ID 0x050F7D44808F43E5D33D0B90BCF57CC9 at byte 27930289
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.01
# Time range: 2023-11-25T02:24:52 to 2023-11-25T02:25:19
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count          0      10
# Exec time      0   322ms    13ms    78ms    32ms    65ms    20ms    27ms
# Lock time      0     9us       0     1us       0     1us       0     1us
# Rows sent     33  73.19k   7.32k   7.32k   7.32k   7.32k       0   7.32k
# Rows examine   0  73.19k   7.32k   7.32k   7.32k   7.32k       0   7.32k
# Query size     0     250      25      25      25      25       0      25
# String:
# Databases    isupipe
# 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
# EXPLAIN 
SELECT * FROM livestreams\G
# *************************** 1. row ***************************
#            id: 1
#   select_type: SIMPLE
#         table: livestreams
#    partitions: NULL
#          type: ALL
# possible_keys: NULL
#           key: NULL
#       key_len: NULL
#           ref: NULL
#          rows: 7387
#      filtered: 100.00
#         Extra: NULL

# Query 4: 0.74 QPS, 0.01x concurrency, ID 0xF7144185D9A142A426A36DC55C1D2623 at byte 28857641
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T02:24:52 to 2023-11-25T02:25:19
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count          0      20
# Exec time      0   227ms     4ms    27ms    11ms    18ms     6ms    11ms
# Lock time      0    16us       0     2us       0     1us       0     1us
# Rows sent      0       0       0       0       0       0       0       0
# Rows examine   0 214.18k  10.71k  10.71k  10.71k  10.71k       0  10.71k
# Query size     0   1.09k      56      56      56      56       0      56
# String:
# Databases    isupipe
# Hosts        localhost
# Users        isucon
# Query_time distribution
#   1us
#  10us
# 100us
#   1ms  ################################################################
#  10ms  ################################################################
# 100ms
#    1s
#  10s+
# Tables
#    SHOW TABLE STATUS FROM `isupipe` LIKE 'livestream_tags'\G
#    SHOW CREATE TABLE `isupipe`.`livestream_tags`\G
# EXPLAIN 
SELECT * FROM livestream_tags WHERE livestream_id = 7491\G
# *************************** 1. row ***************************
#            id: 1
#   select_type: SIMPLE
#         table: livestream_tags
#    partitions: NULL
#          type: ALL
# possible_keys: NULL
#           key: NULL
#       key_len: NULL
#           ref: NULL
#          rows: 11137
#      filtered: 10.00
#         Extra: Using where

netdata

http://localhost:19991/#menu_services;after=1700879052184;before=1700879128360

pprof

go tool pprof -http=0.0.0.0:1080 http://isucon1/pprof/11250224