saza-ku / isucon13

0 stars 0 forks source link

11250313 #22

Open saza-ku opened 1 year ago

saza-ku commented 1 year ago

複数台構成

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

4500 ぐらい

saza-ku commented 1 year ago

isucon1

alp

+-------+--------+------------------------------------------+--------+--------+---------+--------+--------+
| COUNT | METHOD |                   URI                    |  MIN   |  MAX   |   SUM   |  AVG   |  P99   |
+-------+--------+------------------------------------------+--------+--------+---------+--------+--------+
| 2342  | GET    | /api/user/.+/icon                        | 0.004  | 1.424  | 179.376 | 0.077  | 0.576  |
| 266   | GET    | /api/livestream/.+/livecomment           | 0.004  | 2.556  | 116.634 | 0.438  | 2.052  |
| 62    | GET    | /api/livestream/.+                       | 0.008  | 4.328  | 113.418 | 1.829  | 4.328  |
| 7     | GET    | /api/user/.+/statistics                  | 4.176  | 20.000 | 101.835 | 14.548 | 20.000 |
| 298   | GET    | /api/livestream/.+/reaction              | 0.004  | 1.948  | 101.649 | 0.341  | 1.784  |
| 32    | POST   | /api/livestream/.+/moderate              | 0.284  | 7.884  | 65.085  | 2.034  | 7.884  |
| 237   | POST   | /api/register                            | 0.004  | 0.712  | 50.024  | 0.211  | 0.604  |
| 280   | POST   | /api/livestream/.+/livecomment           | 0.004  | 1.124  | 47.484  | 0.170  | 0.940  |
| 115   | POST   | /api/livestream/.+                       | 0.072  | 1.268  | 46.196  | 0.402  | 1.212  |
| 234   | POST   | /api/icon                                | 0.012  | 1.000  | 33.500  | 0.143  | 0.776  |
| 250   | POST   | /api/livestream/.+/reaction              | 0.008  | 0.748  | 28.760  | 0.115  | 0.548  |
| 242   | POST   | /api/login                               | 0.004  | 0.744  | 20.065  | 0.083  | 0.656  |
| 2     | GET    | /api/livestream/.+/statistics            | 6.728  | 6.800  | 13.528  | 6.764  | 6.800  |
| 1     | POST   | /api/initialize                          | 13.400 | 13.400 | 13.400  | 13.400 | 13.400 |
| 50    | POST   | /api/livestream/.+/livecomment/.+/report | 0.012  | 1.096  | 8.856   | 0.177  | 1.096  |
| 78    | GET    | /api/livestream                          | 0.004  | 0.700  | 8.692   | 0.111  | 0.700  |
| 94    | GET    | /api/tag                                 | 0.004  | 0.860  | 7.581   | 0.081  | 0.860  |
| 56    | GET    | /api/livestream/.+/report                | 0.004  | 0.852  | 5.620   | 0.100  | 0.852  |
| 41    | GET    | /api/livestream/.+/ngwords               | 0.004  | 0.652  | 5.600   | 0.137  | 0.652  |
| 29    | POST   | /api/livestream/.+/enter                 | 0.004  | 0.276  | 1.912   | 0.066  | 0.276  |
| 19    | DELETE | /api/livestream/.+/exit                  | 0.004  | 0.248  | 1.036   | 0.055  | 0.248  |
| 6     | GET    | /api/user/.+/theme                       | 0.032  | 0.148  | 0.436   | 0.073  | 0.148  |
| 4     | GET    | /api/user/.+                             | 0.000  | 0.004  | 0.008   | 0.002  | 0.004  |
| 1     | GET    | /api/payment                             | 0.004  | 0.004  | 0.004   | 0.004  | 0.004  |
+-------+--------+------------------------------------------+--------+--------+---------+--------+--------+

slow query

Count: 13859  Time=0.00s (40s)  Lock=0.00s (0s)  Rows=0.1 (1160), 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: 9566  Time=0.00s (27s)  Lock=0.00s (0s)  Rows=0.5 (4807), 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: 17405  Time=0.00s (5s)  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'

Count: 42466  Time=0.00s (3s)  Lock=0.00s (0s)  Rows=0.0 (0), isudns[isudns]@localhost
  #

Count: 165  Time=0.01s (1s)  Lock=0.00s (0s)  Rows=0.0 (0), isudns[isudns]@localhost
  commit

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

Count: 328  Time=0.00s (0s)  Lock=0.00s (0s)  Rows=0.5 (164), isudns[isudns]@localhost
  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: 1444  Time=0.00s (0s)  Lock=0.00s (0s)  Rows=0.0 (0), isudns[isudns]@localhost
  insert into records (content,ttl,prio,type,domain_id,disabled,name,ordername,auth) values ('S',N,N,'S',N,N,'S',NULL,N)

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

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

explain

Reading from STDIN ...

# 17.3s user time, 650ms system time, 36.75M rss, 51.09M vsz
# Current date: Sat Nov 25 03:15:02 2023
# Hostname: ip-192-168-0-11
# Files: STDIN
# Overall: 133.92k total, 21 unique, 1.42k QPS, 1.52x concurrency ________
# Time range: 2023-11-25T03:13:28 to 2023-11-25T03:15:02
# Attribute          total     min     max     avg     95%  stddev  median
# ============     ======= ======= ======= ======= ======= ======= =======
# Exec time           143s     1us    29ms     1ms     5ms     2ms   131us
# Lock time          195ms       0    12ms     1us     1us    54us       0
# Rows sent          9.42k       0       1    0.07    0.99    0.26       0
# Rows examine      50.50M       0   1.48k  395.39   1.39k  620.93       0
# Query size        10.34M       5     222   80.94  151.03   49.05   51.63

# Profile
# Rank Query ID                      Response time Calls R/Call V/M   Item
# ==== ============================= ============= ===== ====== ===== ====
#    1 0x42EF7D7D98FBCC9723BF896E... 72.7638 50.8% 21760 0.0033  0.00 SELECT records
#    2 0x3D83BC87F3B3A00D571FFC81... 48.4501 33.8% 14960 0.0032  0.00 SELECT records
#    3 0x22279D81D51006139E0C7640...  9.4336  6.6% 27422 0.0003  0.00 SELECT domains domainmetadata
#    4 0x8F7679D452333ED3C7D60D22...  7.1143  5.0% 63224 0.0001  0.00 ADMIN RESET STMT
# MISC 0xMISC                         5.5516  3.9%  6555 0.0008   0.0 <17 ITEMS>

# Query 1: 233.98 QPS, 0.78x concurrency, ID 0x42EF7D7D98FBCC9723BF896EBFC51D24 at byte 21783207
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T03:13:29 to 2023-11-25T03:15:02
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count         16   21760
# Exec time     50     73s   716us    22ms     3ms     7ms     2ms     3ms
# Lock time     22    44ms       0     3ms     2us     1us    25us     1us
# Rows sent     17   1.63k       0       1    0.08    0.99    0.26       0
# Rows examine  58  29.38M   1.25k   1.48k   1.38k   1.46k   62.36   1.33k
# Query size    28   2.96M     129     222  142.71  158.58   12.35  136.99
# String:
# Hosts        localhost
# 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='hmk2qbi883vrx70.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='hmk2qbi883vrx70.u.isucon.dev' and domain_id=4"] at /usr/bin/pt-query-digest line 7796.

# Query 2: 159.15 QPS, 0.52x concurrency, ID 0x3D83BC87F3B3A00D571FFC8104A6E50C at byte 33215962
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T03:13:28 to 2023-11-25T03:15:02
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count         11   14960
# Exec time     33     48s   675us    25ms     3ms     7ms     2ms     3ms
# Lock time     15    30ms       0     3ms     2us     1us    30us     1us
# Rows sent     77   7.33k       0       1    0.50    0.99    0.50    0.99
# Rows examine  39  20.19M   1.25k   1.48k   1.38k   1.46k   62.85   1.33k
# Query size    18   1.95M     126     221  136.71  151.03   11.78  124.25
# String:
# Hosts        localhost
# Users        isudns
# Query_time distribution
#   1us
#  10us
# 100us  #
#   1ms  ################################################################
#  10ms  #
# 100ms
#    1s
#  10s+
# Tables
#    SHOW TABLE STATUS FROM `isudns` LIKE 'records'\G
#    SHOW CREATE TABLE `isudns`.`records`\G
# EXPLAIN 
SELECT content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE disabled=0 and type='SOA' and name='uyzhp5ltouc8ymo3tor5ueyivsg6fqz0.u.isucon.dev'\G
# *************************** 1. row ***************************
#            id: 1
#   select_type: SIMPLE
#         table: records
#    partitions: NULL
#          type: ALL
# possible_keys: NULL
#           key: NULL
#       key_len: NULL
#           ref: NULL
#          rows: 1514
#      filtered: 0.10
#         Extra: Using where

# Query 3: 294.86 QPS, 0.10x concurrency, ID 0x22279D81D51006139E0C76405B54C261 at byte 5850538
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T03:13:29 to 2023-11-25T03:15:02
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count         20   27422
# Exec time      6      9s    82us    12ms   344us     1ms   556us   159us
# Lock time     36    72ms       0     2ms     2us     1us    30us     1us
# Rows sent      0       0       0       0       0       0       0       0
# Rows examine   0       0       0       0       0       0       0       0
# Query size    28   2.98M     114     114     114     114       0     114
# String:
# Hosts        localhost
# 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
# *************************** 1. row ***************************
#            id: 1
#   select_type: SIMPLE
#         table: domains
#    partitions: NULL
#          type: const
# possible_keys: PRIMARY,name_index
#           key: name_index
#       key_len: 257
#           ref: const
#          rows: 1
#      filtered: 100.00
#         Extra: Using index
# *************************** 2. row ***************************
#            id: 1
#   select_type: SIMPLE
#         table: domainmetadata
#    partitions: NULL
#          type: ref
# possible_keys: domainmetadata_idx
#           key: domainmetadata_idx
#       key_len: 4
#           ref: const
#          rows: 1
#      filtered: 100.00
#         Extra: NULL

# Query 4: 672.60 QPS, 0.08x concurrency, ID 0x8F7679D452333ED3C7D60D22131CEFD4 at byte 24680541
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T03:13:28 to 2023-11-25T03:15:02
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count         47   63224
# Exec time      4      7s     9us    11ms   112us   348us   330us    44us
# 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
# Query size    19   1.99M      33      33      33      33       0      33
# String:
# Hosts        localhost
# Users        isudns
# Query_time distribution
#   1us  #
#  10us  ################################################################
# 100us  ##########
#   1ms  #
#  10ms  #
# 100ms
#    1s
#  10s+
administrator command: Reset stmt\G

netdata

http://localhost:19991/#menu_services;after=1700881995690;before=1700882071723

pprof

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

isucon3

alp

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

slow query

Count: 6768  Time=0.02s (102s)  Lock=0.00s (0s)  Rows=3.7 (25065), isucon[isucon]@isucon1
  SELECT * FROM livestream_tags WHERE livestream_id = N

Count: 3956  Time=0.01s (32s)  Lock=0.00s (0s)  Rows=1.0 (3956), isucon[isucon]@isucon1
  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: 3957  Time=0.01s (30s)  Lock=0.00s (0s)  Rows=1.0 (3957), isucon[isucon]@isucon1
  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: 11922  Time=0.00s (19s)  Lock=0.00s (0s)  Rows=0.8 (8988), isucon[isucon]@isucon1
  SELECT image FROM icons WHERE user_id = N

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

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

Count: 2019  Time=0.00s (6s)  Lock=0.00s (0s)  Rows=0.0 (0), isucon[isucon]@isucon1
  COMMIT

Count: 234  Time=0.03s (6s)  Lock=0.00s (0s)  Rows=0.3 (77), isucon[isucon]@isucon1
  SELECT id, user_id, livestream_id, word FROM ng_words WHERE user_id = N AND livestream_id = N

explain

Reading from STDIN ...

# 22.2s user time, 470ms system time, 44.41M rss, 59.18M vsz
# Current date: Sat Nov 25 03:15:09 2023
# Hostname: ip-192-168-0-13
# Files: STDIN
# Overall: 184.21k total, 86 unique, 1.72k QPS, 3.22x concurrency ________
# Time range: 2023-11-25T03:13:15 to 2023-11-25T03:15:02
# Attribute          total     min     max     avg     95%  stddev  median
# ============     ======= ======= ======= ======= ======= ======= =======
# Exec time           344s     1us   407ms     2ms    13ms     6ms   159us
# Lock time          393ms       0    38ms     2us     1us   139us     1us
# Rows sent        224.92k       0   7.32k    1.25    0.99   30.84    0.99
# Rows examine     158.67M       0  14.03k  903.17   8.46k   2.31k    1.96
# Query size        42.09M       6   1.94M  239.59  346.17   5.41k   54.21

# Profile
# Rank Query ID                     Response time  Calls  R/Call V/M   Ite
# ==== ============================ ============== ====== ====== ===== ===
#    1 0xF7144185D9A142A426A36DC... 137.2843 39.9%   7728 0.0178  0.01 SELECT livestream_tags
#    2 0xF1B8EF06D6CA63B24BFF433...  40.5143 11.8%   4206 0.0096  0.01 SELECT users livestreams livecomments
#    3 0xDB74D52D39A7090F224C4DE...  38.2181 11.1%   4207 0.0091  0.01 SELECT users livestreams reactions
#    4 0x84B457C910C4A79FC9EBECB...  31.9804  9.3%  14007 0.0023  0.01 SELECT icons
# MISC 0xMISC                        96.1323 27.9% 154066 0.0006   0.0 <82 ITEMS>

# Query 1: 83.10 QPS, 1.48x concurrency, ID 0xF7144185D9A142A426A36DC55C1D2623 at byte 64601712
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.01
# Time range: 2023-11-25T03:13:29 to 2023-11-25T03:15:02
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count          4    7728
# Exec time     39    137s     2ms    62ms    18ms    40ms    12ms    17ms
# Lock time      2     8ms       0   908us     1us     1us    11us     1us
# Rows sent     12  29.17k       0      11    3.86    4.96    1.75    4.96
# Rows examine  51  82.44M  10.71k  11.17k  10.92k  10.80k  228.00  10.80k
# Query size     0 422.41k      53      56   55.97   54.21    0.12   54.21
# String:
# Hosts        isucon1
# Users        isucon
# Query_time distribution
#   1us
#  10us
# 100us
#   1ms  #######################
#  10ms  ################################################################
# 100ms
#    1s
#  10s+
# Tables
#    SHOW TABLE STATUS LIKE 'livestream_tags'\G
#    SHOW CREATE TABLE `livestream_tags`\G
# EXPLAIN /*!50100 PARTITIONS*/
SELECT * FROM livestream_tags WHERE livestream_id = 7540\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: 11614
#      filtered: 10.00
#         Extra: Using where

# Query 2: 45.23 QPS, 0.44x concurrency, ID 0xF1B8EF06D6CA63B24BFF433E06CCEB22 at byte 71694986
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.01
# Time range: 2023-11-25T03:13:29 to 2023-11-25T03:15:02
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count          2    4206
# Exec time     11     41s     2ms    81ms    10ms    28ms    10ms     4ms
# Lock time      2    10ms       0     5ms     2us     1us    71us     1us
# Rows sent      1   4.11k       1       1       1       1       0       1
# Rows examine   5   8.58M   1.96k   2.43k   2.09k   2.27k  143.77   2.06k
# Query size     1 676.99k     163     166  164.82  158.58       0  158.58
# String:
# Hosts        isucon1
# 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
#    SHOW TABLE STATUS LIKE 'livestreams'\G
#    SHOW CREATE TABLE `livestreams`\G
#    SHOW TABLE STATUS LIKE 'livecomments'\G
#    SHOW CREATE TABLE `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 = 12\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: 1275
#      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

# Query 3: 45.24 QPS, 0.41x concurrency, ID 0xDB74D52D39A7090F224C4DEEAF3028C9 at byte 65365586
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.01
# Time range: 2023-11-25T03:13:29 to 2023-11-25T03:15:02
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count          2    4207
# Exec time     11     38s     2ms    88ms     9ms    27ms     9ms     3ms
# Lock time      4    16ms       0     9ms     3us     1us   142us     1us
# Rows sent      1   4.11k       1       1       1       1       0       1
# Rows examine   5   8.55M   1.96k   2.39k   2.08k   2.27k  143.75   2.06k
# Query size     1 594.98k     143     146  144.82  143.84    0.83  143.84
# String:
# Hosts        isucon1
# 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
#    SHOW TABLE STATUS LIKE 'livestreams'\G
#    SHOW CREATE TABLE `livestreams`\G
#    SHOW TABLE STATUS LIKE 'reactions'\G
#    SHOW CREATE TABLE `reactions`\G
# EXPLAIN 
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 = 259\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: r
#    partitions: NULL
#          type: ALL
# possible_keys: NULL
#           key: NULL
#       key_len: NULL
#           ref: NULL
#          rows: 1251
#      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.r.livestream_id
#          rows: 1
#      filtered: 10.00
#         Extra: Using where

# Query 4: 150.61 QPS, 0.34x concurrency, ID 0x84B457C910C4A79FC9EBECB8B1065C66 at byte 79715799
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.01
# Time range: 2023-11-25T03:13:29 to 2023-11-25T03:15:02
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count          7   14007
# Exec time      9     32s    49us    40ms     2ms    10ms     4ms     1ms
# Lock time      3    13ms       0   279us       0     1us     2us     1us
# Rows sent      4  10.74k       0       1    0.79    0.99    0.41    0.99
# Rows examine   0   1.35M       0     226  100.74  202.40   65.56   92.72
# Query size     1 599.19k      41      44   43.80   42.48    0.29   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 
SELECT image FROM icons WHERE user_id = 1038\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: 226
#      filtered: 10.00
#         Extra: Using where

netdata

http://localhost:19993/#menu_services;after=1700881995680;before=1700882075687

pprof

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