saza-ku / isucon13

0 stars 0 forks source link

11250354 #35

Open saza-ku opened 10 months ago

saza-ku commented 10 months ago

https://github.com/Saza-ku/isucon13/pull/36

9000 ぐらい

saza-ku commented 10 months ago

isucon1

alp

+-------+--------+------------------------------------------+-------+-------+---------+-------+-------+
| COUNT | METHOD |                   URI                    |  MIN  |  MAX  |   SUM   |  AVG  |  P99  |
+-------+--------+------------------------------------------+-------+-------+---------+-------+-------+
| 4771  | GET    | /api/user/.+/icon                        | 0.004 | 0.548 | 200.756 | 0.042 | 0.244 |
| 520   | GET    | /api/livestream/.+/livecomment           | 0.004 | 1.756 | 148.452 | 0.285 | 1.156 |
| 159   | GET    | /api/livestream/.+                       | 0.004 | 2.836 | 141.228 | 0.888 | 2.604 |
| 550   | GET    | /api/livestream/.+/reaction              | 0.004 | 1.556 | 130.356 | 0.237 | 1.020 |
| 617   | POST   | /api/livestream/.+/livecomment           | 0.004 | 0.444 | 64.956  | 0.105 | 0.332 |
| 161   | POST   | /api/livestream/.+                       | 0.084 | 1.120 | 46.624  | 0.290 | 0.676 |
| 408   | POST   | /api/register                            | 0.032 | 0.540 | 45.336  | 0.111 | 0.400 |
| 479   | POST   | /api/livestream/.+/reaction              | 0.004 | 0.376 | 32.732  | 0.068 | 0.348 |
| 411   | POST   | /api/icon                                | 0.004 | 0.616 | 31.212  | 0.076 | 0.288 |
| 236   | GET    | /api/livestream                          | 0.004 | 0.440 | 20.164  | 0.085 | 0.304 |
| 413   | POST   | /api/login                               | 0.004 | 0.380 | 17.220  | 0.042 | 0.260 |
| 127   | GET    | /api/livestream/.+/ngwords               | 0.008 | 0.336 | 9.148   | 0.072 | 0.300 |
| 171   | GET    | /api/livestream/.+/report                | 0.004 | 0.452 | 8.312   | 0.049 | 0.436 |
| 53    | POST   | /api/livestream/.+/livecomment/.+/report | 0.004 | 0.420 | 7.036   | 0.133 | 0.420 |
| 144   | GET    | /api/tag                                 | 0.004 | 0.308 | 5.984   | 0.042 | 0.288 |
| 92    | POST   | /api/livestream/.+/moderate              | 0.004 | 0.288 | 4.692   | 0.051 | 0.288 |
| 55    | POST   | /api/livestream/.+/enter                 | 0.004 | 0.248 | 2.216   | 0.040 | 0.248 |
| 11    | GET    | /api/user/.+/statistics                  | 0.024 | 0.236 | 1.720   | 0.156 | 0.236 |
| 44    | DELETE | /api/livestream/.+/exit                  | 0.004 | 0.216 | 1.452   | 0.033 | 0.216 |
| 9     | GET    | /api/user/.+/livestream                  | 0.040 | 0.260 | 1.056   | 0.117 | 0.260 |
| 10    | GET    | /api/user/.+/theme                       | 0.004 | 0.052 | 0.212   | 0.021 | 0.052 |
| 2     | GET    | /api/livestream/.+/statistics            | 0.028 | 0.028 | 0.056   | 0.028 | 0.028 |
| 4     | GET    | /api/user/.+                             | 0.000 | 0.004 | 0.004   | 0.001 | 0.004 |
| 1     | GET    | /api/payment                             | 0.000 | 0.000 | 0.000   | 0.000 | 0.000 |
+-------+--------+------------------------------------------+-------+-------+---------+-------+-------+

slow query

explain

Reading from STDIN ...

# No events processed.

netdata

http://localhost:19991/#menu_services;after=1700884481838;before=1700884557869

pprof

go tool pprof -http=0.0.0.0:1080 http://isucon1/pprof/11250354
saza-ku commented 10 months ago

isucon2

alp

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

slow query

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

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

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

Count: 406  Time=0.00s (1s)  Lock=0.00s (0s)  Rows=0.0 (0), isudns[isudns]@isucon1
  delete from records where domain_id=N and name='S' and type='S'

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

Count: 97850  Time=0.00s (1s)  Lock=0.00s (0s)  Rows=0.0 (0), isudns[isudns]@isucon1
  #

Count: 406  Time=0.00s (0s)  Lock=0.00s (0s)  Rows=0.0 (0), isudns[isudns]@isucon1
  commit

Count: 406  Time=0.00s (0s)  Lock=0.00s (0s)  Rows=0.0 (0), isudns[isudns]@isucon1
  insert into records (content,ttl,prio,type,domain_id,disabled,name,ordername,auth) values ('S',N,N,'S',N,N,'S',NULL,N)

Count: 406  Time=0.00s (0s)  Lock=0.00s (0s)  Rows=1.0 (406), isudns[isudns]@isucon1
  select id,name,master,last_check,notified_serial,type,options,catalog,account from domains where name='S'

Count: 812  Time=0.00s (0s)  Lock=0.00s (0s)  Rows=0.0 (0), isudns[isudns]@isucon1
  SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED

explain

Reading from STDIN ...

# 13.1s user time, 40ms system time, 36.75M rss, 51.18M vsz
# Current date: Sat Nov 25 03:56:17 2023
# Hostname: ip-192-168-0-12
# Files: STDIN
# Overall: 207.63k total, 20 unique, 2.50k QPS, 1.24x concurrency ________
# Time range: 2023-11-25T03:54:41 to 2023-11-25T03:56:04
# Attribute          total     min     max     avg     95%  stddev  median
# ============     ======= ======= ======= ======= ======= ======= =======
# Exec time           103s     1us     9ms   495us     2ms   707us    89us
# Lock time          152ms       0     4ms       0     1us    11us     1us
# Rows sent         16.02k       0       1    0.08    0.99    0.27       0
# Rows examine      89.36M       0   1.65k  451.30   1.53k  676.85       0
# Query size        16.43M       5     221   82.98  151.03   48.85  112.70

# Profile
# Rank Query ID                     Response time Calls  R/Call V/M   Item
# ==== ============================ ============= ====== ====== ===== ====
#    1 0x42EF7D7D98FBCC9723BF896... 56.9503 55.4%  36033 0.0016  0.00 SELECT records
#    2 0x3D83BC87F3B3A00D571FFC8... 36.6801 35.7%  24878 0.0015  0.00 SELECT records
#    3 0x22279D81D51006139E0C764...  4.9488  4.8%  45212 0.0001  0.00 SELECT domains domainmetadata
#    4 0x859BBB7E9D760686137A944...  1.4137  1.4%    406 0.0035  0.00 DELETE records
# MISC 0xMISC                        2.8063  2.7% 101105 0.0000   0.0 <16 ITEMS>

# Query 1: 522.22 QPS, 0.83x concurrency, ID 0x42EF7D7D98FBCC9723BF896EBFC51D24 at byte 59298826
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T03:54:41 to 2023-11-25T03:55:50
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count         17   36033
# Exec time     55     57s   707us     9ms     2ms     2ms   352us     2ms
# Lock time     29    45ms       0   971us     1us     1us     4us     1us
# Rows sent     18   3.03k       0       1    0.09    0.99    0.28       0
# Rows examine  58  51.86M   1.25k   1.65k   1.47k   1.61k  109.57   1.46k
# Query size    29   4.90M     129     221  142.67  158.58   12.31  136.99
# String:
# Hosts        isucon1
# Users        isudns
# Query_time distribution
#   1us
#  10us
# 100us  #
#   1ms  ################################################################
#  10ms
# 100ms
#    1s
#  10s+
# Tables
#    SHOW TABLE STATUS LIKE 'records'\G
#    SHOW CREATE TABLE `records`\G
# EXPLAIN /*!50100 PARTITIONS*/
SELECT content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE disabled=0 and name='inouenaoki1.u.isucon.dev' and domain_id=4\G
# EXPLAIN failed: DBD::mysql::st execute failed: Table 'isupipe.records' doesn't exist [for Statement "EXPLAIN SELECT content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE disabled=0 and name='inouenaoki1.u.isucon.dev' and domain_id=4"] at /usr/bin/pt-query-digest line 7796.

# Query 2: 360.55 QPS, 0.53x concurrency, ID 0x3D83BC87F3B3A00D571FFC8104A6E50C at byte 6749158
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T03:54:41 to 2023-11-25T03:55:50
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count         11   24878
# Exec time     35     37s   663us     7ms     1ms     2ms   335us     1ms
# Lock time     20    31ms       0   386us     1us     1us     2us     1us
# Rows sent     76  12.19k       0       1    0.50    0.99    0.50    0.99
# Rows examine  40  35.78M   1.25k   1.65k   1.47k   1.61k  109.97   1.46k
# Query size    19   3.24M     126     220  136.63  151.03   11.75  124.25
# String:
# Hosts        isucon1
# Users        isudns
# Query_time distribution
#   1us
#  10us
# 100us  #
#   1ms  ################################################################
#  10ms
# 100ms
#    1s
#  10s+
# Tables
#    SHOW TABLE STATUS LIKE 'records'\G
#    SHOW CREATE TABLE `records`\G
# EXPLAIN 
SELECT content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE disabled=0 and type='SOA' and name='sexzmlde0wyg8mts1qj0.u.isucon.dev'\G
# EXPLAIN failed: DBD::mysql::st execute failed: Table 'isupipe.records' doesn't exist [for Statement "EXPLAIN SELECT content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE disabled=0 and type='SOA' and name='sexzmlde0wyg8mts1qj0.u.isucon.dev'"] at /usr/bin/pt-query-digest line 7796.

# Query 3: 655.25 QPS, 0.07x concurrency, ID 0x22279D81D51006139E0C76405B54C261 at byte 47338092
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T03:54:41 to 2023-11-25T03:55:50
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count         21   45212
# Exec time      4      5s    73us     3ms   109us   125us    68us    98us
# Lock time     42    65ms       0   765us     1us     1us     3us     1us
# Rows sent      0       0       0       0       0       0       0       0
# Rows examine   0       0       0       0       0       0       0       0
# Query size    29   4.92M     114     114     114     114       0     114
# String:
# Hosts        isucon1
# Users        isudns
# Query_time distribution
#   1us
#  10us  ######################
# 100us  ################################################################
#   1ms  #
#  10ms
# 100ms
#    1s
#  10s+
# Tables
#    SHOW TABLE STATUS LIKE 'domains'\G
#    SHOW CREATE TABLE `domains`\G
#    SHOW TABLE STATUS LIKE 'domainmetadata'\G
#    SHOW CREATE TABLE `domainmetadata`\G
# EXPLAIN 
select kind,content from domains, domainmetadata where domainmetadata.domain_id=domains.id and name='u.isucon.dev'\G
# EXPLAIN failed: DBD::mysql::st execute failed: Table 'isupipe.domains' doesn't exist [for Statement "EXPLAIN select kind,content from domains, domainmetadata where domainmetadata.domain_id=domains.id and name='u.isucon.dev'"] at /usr/bin/pt-query-digest line 7796.

# Query 4: 5.97 QPS, 0.02x concurrency, ID 0x859BBB7E9D760686137A944406874C4D at byte 41052393
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T03:54:42 to 2023-11-25T03:55:50
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count          0     406
# Exec time      1      1s     2ms     8ms     3ms     4ms   582us     3ms
# Lock time      6     9ms       0     4ms    23us     1us   244us     1us
# Rows sent      0       0       0       0       0       0       0       0
# Rows examine   0 587.79k   1.25k   1.65k   1.45k   1.61k  117.67   1.39k
# Query size     0  33.95k      78      93   85.62   88.31    3.43   84.10
# String:
# Hosts        isucon1
# Users        isudns
# Query_time distribution
#   1us
#  10us
# 100us
#   1ms  ################################################################
#  10ms
# 100ms
#    1s
#  10s+
# Tables
#    SHOW TABLE STATUS LIKE 'records'\G
#    SHOW CREATE TABLE `records`\G
delete from records where domain_id=4 and name='shimizukenichi0.u.isucon.dev' and type='A'\G
# Converted for EXPLAIN
# EXPLAIN 
select * from  records where domain_id=4 and name='shimizukenichi0.u.isucon.dev' and type='A'\G

netdata

http://localhost:19992/#menu_services;after=1700884481865;before=1700884561873

pprof

go tool pprof -http=0.0.0.0:1080 http://isucon2/pprof/11250354
saza-ku commented 10 months ago

isucon3

alp

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

slow query

Count: 30778  Time=0.01s (160s)  Lock=0.00s (0s)  Rows=0.9 (26516), isucon[isucon]@isucon1
  SELECT image FROM icons WHERE user_id = N

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

Count: 1470  Time=0.01s (19s)  Lock=0.00s (0s)  Rows=1.0 (1470), isucon[isucon]@isucon1
  SELECT slot FROM reservation_slots WHERE start_at = N AND end_at = N

Count: 617  Time=0.03s (16s)  Lock=0.00s (0s)  Rows=0.1 (69), isucon[isucon]@isucon1
  SELECT id, user_id, livestream_id, word FROM ng_words WHERE user_id = N AND livestream_id = N

Count: 256  Time=0.03s (8s)  Lock=0.00s (0s)  Rows=1.0 (261), isucon[isucon]@isucon1
  SELECT * FROM livestreams WHERE user_id = N

Count: 74053  Time=0.00s (7s)  Lock=0.00s (0s)  Rows=1.0 (74053), isucon[isucon]@isucon1
  SELECT * FROM tags WHERE id = N

Count: 157  Time=0.04s (5s)  Lock=0.00s (0s)  Rows=0.0 (0), isucon[isucon]@isucon1
  UPDATE reservation_slots SET slot = slot - N WHERE start_at >= N AND end_at <= N

Count: 159  Time=0.03s (5s)  Lock=0.00s (0s)  Rows=9.3 (1480), isucon[isucon]@isucon1
  SELECT * FROM reservation_slots WHERE start_at >= N AND end_at <= N FOR UPDATE

Count: 17361  Time=0.00s (4s)  Lock=0.00s (0s)  Rows=4.3 (74062), isucon[isucon]@isucon1
  SELECT * FROM livestream_tags WHERE livestream_id = N

Count: 411  Time=0.01s (4s)  Lock=0.00s (0s)  Rows=0.0 (0), isucon[isucon]@isucon1
  INSERT INTO icons (user_id, image) VALUES (N, _binary'S')

explain

Reading from STDIN ...

# 14.7s user time, 30ms system time, 39.62M rss, 53.96M vsz
# Current date: Sat Nov 25 03:56:22 2023
# Hostname: ip-192-168-0-13
# Files: STDIN
# Overall: 217.52k total, 64 unique, 2.50k QPS, 3.11x concurrency ________
# Time range: 2023-11-25T03:54:41 to 2023-11-25T03:56:08
# Attribute          total     min     max     avg     95%  stddev  median
# ============     ======= ======= ======= ======= ======= ======= =======
# Exec time           270s     1us    68ms     1ms     8ms     4ms    98us
# Lock time          516ms       0    30ms     2us     1us   150us     1us
# Rows sent        434.07k       0   7.32k    2.04    4.96   36.94    0.99
# Rows examine      63.62M       0  14.01k  306.70   1.20k   1.18k    0.99
# Query size        36.30M       6 175.32k  174.99   54.21   3.10k   34.95

# Profile
# Rank Query ID                     Response time  Calls  R/Call V/M   Ite
# ==== ============================ ============== ====== ====== ===== ===
#    1 0x84B457C910C4A79FC9EBECB... 160.4429 59.3%  30778 0.0052  0.01 SELECT icons
#    2 0x38BC86A45F31C6B1EE32467...  20.6421  7.6%  26022 0.0008  0.00 SELECT themes
#    3 0x59F1B6DD8D9FEC059E55B3B...  19.1142  7.1%   1470 0.0130  0.00 SELECT reservation_slots
#    4 0x64CC8A4E8E4B39020337559...  16.1265  6.0%    617 0.0261  0.00 SELECT ng_words
# MISC 0xMISC                        54.1699 20.0% 158632 0.0003   0.0 <60 ITEMS>

# Query 1: 452.62 QPS, 2.36x concurrency, ID 0x84B457C910C4A79FC9EBECB8B1065C66 at byte 58738218
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.01
# Time range: 2023-11-25T03:54:42 to 2023-11-25T03:55:50
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count         14   30778
# Exec time     59    160s    47us    55ms     5ms    18ms     6ms     2ms
# Lock time      6    32ms       0   453us     1us     1us     3us     1us
# Rows sent      5  25.89k       0       1    0.86    0.99    0.34    0.99
# Rows examine   8   5.19M       0     397  176.77  363.48  110.46  166.51
# Query size     3   1.29M      41      44   43.88   42.48    0.22   42.48
# String:
# Hosts        isucon1
# Users        isucon
# Query_time distribution
#   1us
#  10us  ####
# 100us  ########################
#   1ms  ################################################################
#  10ms  ######################
# 100ms
#    1s
#  10s+
# Tables
#    SHOW TABLE STATUS LIKE 'icons'\G
#    SHOW CREATE TABLE `icons`\G
# EXPLAIN /*!50100 PARTITIONS*/
SELECT image FROM icons WHERE user_id = 827\G
# *************************** 1. row ***************************
#            id: 1
#   select_type: SIMPLE
#         table: icons
#    partitions: NULL
#          type: ALL
# possible_keys: NULL
#           key: NULL
#       key_len: NULL
#           ref: NULL
#          rows: 395
#      filtered: 10.00
#         Extra: Using where

# Query 2: 382.68 QPS, 0.30x concurrency, ID 0x38BC86A45F31C6B1EE324671506C898A at byte 74060560
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T03:54:42 to 2023-11-25T03:55:50
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count         11   26022
# Exec time      7     21s   239us    18ms   793us     2ms   886us   568us
# Lock time      7    41ms       0    11ms     1us     1us    70us     1us
# Rows sent      5  25.41k       1       1       1       1       0       1
# Rows examine  46  29.40M    1000   1.37k   1.16k   1.33k  113.16   1.14k
# Query size     2   1.01M      38      41   40.90   40.45    0.56   40.45
# String:
# Hosts        isucon1
# 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
# EXPLAIN 
SELECT * FROM themes WHERE user_id = 1059\G
# *************************** 1. row ***************************
#            id: 1
#   select_type: SIMPLE
#         table: themes
#    partitions: NULL
#          type: ALL
# possible_keys: NULL
#           key: NULL
#       key_len: NULL
#           ref: NULL
#          rows: 1406
#      filtered: 10.00
#         Extra: Using where

# Query 3: 21.30 QPS, 0.28x concurrency, ID 0x59F1B6DD8D9FEC059E55B3BFD624E8C3 at byte 73112607
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T03:54:41 to 2023-11-25T03:55:50
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count          0    1470
# Exec time      7     19s     2ms    39ms    13ms    24ms     7ms    13ms
# Lock time      1     8ms       0     6ms     5us     1us   154us     1us
# Rows sent      0   1.44k       1       1       1       1       0       1
# Rows examine  19  12.28M   8.55k   8.55k   8.55k   8.55k       0   8.55k
# Query size     0 123.46k      86      86      86      86       0      86
# String:
# Hosts        isucon1
# Users        isucon
# Query_time distribution
#   1us
#  10us
# 100us
#   1ms  #################################
#  10ms  ################################################################
# 100ms
#    1s
#  10s+
# Tables
#    SHOW TABLE STATUS LIKE 'reservation_slots'\G
#    SHOW CREATE TABLE `reservation_slots`\G
# EXPLAIN 
SELECT slot FROM reservation_slots WHERE start_at = 1701824400 AND end_at = 1701828000\G
# *************************** 1. row ***************************
#            id: 1
#   select_type: SIMPLE
#         table: reservation_slots
#    partitions: NULL
#          type: ALL
# possible_keys: NULL
#           key: NULL
#       key_len: NULL
#           ref: NULL
#          rows: 8593
#      filtered: 1.00
#         Extra: Using where

# Query 4: 9.07 QPS, 0.24x concurrency, ID 0x64CC8A4E8E4B390203375597CE4D611F at byte 27271983
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T03:54:42 to 2023-11-25T03:55:50
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count          0     617
# Exec time      5     16s     4ms    49ms    26ms    38ms     9ms    27ms
# Lock time      0   681us       0    21us     1us     1us     1us     1us
# Rows sent      0      69       0       2    0.11    1.96    0.44       0
# Rows examine  13   8.44M  14.00k  14.01k  14.01k  13.78k       0  13.78k
# Query size     0  59.65k      97      99   98.99   97.36    0.26   97.36
# String:
# Hosts        isucon1
# Users        isucon
# Query_time distribution
#   1us
#  10us
# 100us
#   1ms  ###
#  10ms  ################################################################
# 100ms
#    1s
#  10s+
# Tables
#    SHOW TABLE STATUS LIKE 'ng_words'\G
#    SHOW CREATE TABLE `ng_words`\G
# EXPLAIN 
SELECT id, user_id, livestream_id, word FROM ng_words WHERE user_id = 1053 AND livestream_id = 7550\G
# *************************** 1. row ***************************
#            id: 1
#   select_type: SIMPLE
#         table: ng_words
#    partitions: NULL
#          type: ALL
# possible_keys: NULL
#           key: NULL
#       key_len: NULL
#           ref: NULL
#          rows: 14587
#      filtered: 1.00
#         Extra: Using where

netdata

http://localhost:19993/#menu_services;after=1700884481848;before=1700884561855

pprof

go tool pprof -http=0.0.0.0:1080 http://isucon3/pprof/11250354