tetsuzawa / isucon-practice-2023-03-01

0 stars 0 forks source link

ベンチマークを時系列に書いていくやつ #1

Open tetsuzawa opened 1 year ago

tetsuzawa commented 1 year ago

最初 3110

COUNT 1XX 2XX 3XX 4XX 5XX METHOD URI MIN MAX SUM AVG P95 MIN(BODY) MAX(BODY) AVG(BODY)
196 0 185 0 10 1 GET /users/transactions.json 0.020 8.040 541.520 2.763 5.639 0.000 32377.000 19855.510
1349 0 1349 0 0 0 GET /new_items/\d+.json 0.012 0.812 78.319 0.058 0.188 22729.000 24031.000 23509.979
68 0 40 0 28 0 POST /buy 1.604 1.624 69.170 1.017 1.612 29.000 49.000 36.162
57 0 35 0 22 0 POST /ship_done 0.161 0.808 30.760 0.540 0.808 0.000 83.000 39.175
54 0 38 0 16 0 POST /ship 0.515 0.820 29.565 0.547 0.812 0.000 61.000 51.481
286 0 286 0 0 0 GET /upload/[0-9a-zA-Z]+.jpg 0.000 0.324 26.768 0.094 0.204 36400.000 151818.000 80956.115
31 0 31 0 0 0 POST /complete 0.004 0.816 22.580 0.728 0.808 34.000 34.000 34.000
304 0 304 0 0 0 GET /users/\d+.json 0.012 0.280 21.692 0.071 0.208 91.000 24011.000 14570.115
153 0 153 0 0 0 GET /new_items.json 0.032 0.720 20.804 0.136 0.392 23022.000 23752.000 23403.863
63 0 55 0 8 0 POST /login 0.064 0.408 12.064 0.191 0.368 73.000 104.000 95.222
3605 0 3605 0 0 0 GET /items/\d+.json 0.004 0.120 5.920 0.002 0.004 1854.000 4156.000 2183.791
1 0 1 0 0 0 POST /initialize 5.200 5.200 5.200 5.200 5.200 31.000 31.000 31.000
59 0 59 0 0 0 GET /settings 0.004 0.240 2.968 0.050 0.192 2801.000 2953.000 2944.525
65 0 44 0 21 0 POST /sell 0.004 0.368 1.776 0.027 0.148 13.000 106.000 34.754
4 0 4 0 0 0 GET /static/js/2.ff6e1067.chunk.js.map 0.000 0.348 0.348 0.087 0.348 2169903.000 2169903.000 2169903.000
13 0 13 0 0 0 POST /bump 0.004 0.068 0.168 0.013 0.068 90.000 91.000 90.923
2 0 2 0 0 0 GET /static/js/main.babc3d4d.chunk.js 0.072 0.092 0.164 0.082 0.092 90365.000 90365.000 90365.000
2 0 2 0 0 0 GET /static/css/main.19393e92.chunk.css 0.040 0.076 0.116 0.058 0.076 994.000 994.000 994.000
2 0 2 0 0 0 GET /static/js/2.ff6e1067.chunk.js 0.000 0.076 0.076 0.038 0.076 508459.000 508459.000 508459.000
1 0 1 0 0 0 GET /static/js/runtime~main.a8a9905a.js 0.072 0.072 0.072 0.072 0.072 1502.000 1502.000 1502.000
50 0 36 0 14 0 GET /transactions/\d+.png 0.004 0.008 0.052 0.001 0.004 33.000 634.000 456.620
10 0 3 0 7 0 POST /items/edit 0.004 0.012 0.040 0.004 0.012 58.000 93.000 68.300
1 0 1 0 0 0 GET / 0.004 0.004 0.004 0.004 0.004 2037.000 2037.000 2037.000
4 0 4 0 0 0 GET /static/css/main.19393e92.chunk.css.map 0.000 0.004 0.004 0.001 0.004 1423.000 1423.000 1423.000
1 0 1 0 0 0 GET /items/\d+ 0.000 0.000 0.000 0.000 0.000 2037.000 2037.000 2037.000
1 0 1 0 0 0 GET /internal_server_error.png 0.000 0.000 0.000 0.000 0.000 22290.000 22290.000 22290.000
2 0 2 0 0 0 GET /timeline 0.000 0.000 0.000 0.000 0.000 2037.000 2037.000 2037.000
4 0 4 0 0 0 GET /static/js/main.babc3d4d.chunk.js.map 0.000 0.000 0.000 0.000 0.000 292234.000 292234.000 292234.000
1 0 1 0 0 0 GET /manifest.json 0.000 0.000 0.000 0.000 0.000 341.000 341.000 341.000
1 0 1 0 0 0 GET /favicon.png 0.000 0.000 0.000 0.000 0.000 176.000 176.000 176.000
1 0 1 0 0 0 GET /logo.png 0.000 0.000 0.000 0.000 0.000 23082.000 23082.000 23082.000
1 0 1 0 0 0 GET /reports.json 0.000 0.000 0.000 0.000 0.000 140129.000 140129.000 140129.000
tetsuzawa commented 1 year ago

https://github.com/tetsuzawa/isucon-practice-2023-03-01/pull/2/files

1310

COUNT 1XX 2XX 3XX 4XX 5XX METHOD URI MIN MAX SUM AVG P95 MIN(BODY) MAX(BODY) AVG(BODY)
271 0 267 0 4 0 GET /new_items/\d+.json 0.080 4.143 404.734 1.493 2.560 0.000 24086.000 23221.900
117 0 109 0 8 0 GET /users/transactions.json 0.040 5.832 325.243 2.780 5.800 0.000 25395.000 19103.410
221 0 221 0 0 0 GET /users/\d+.json 0.024 0.280 35.968 0.163 0.228 98.000 24012.000 12490.670
124 0 124 0 0 0 GET /new_items.json 0.124 0.468 34.758 0.280 0.400 23017.000 23866.000 23405.565
32 0 19 0 13 0 POST /buy 0.221 1.648 29.397 0.919 1.640 0.000 49.000 34.906
58 0 50 0 8 0 POST /login 0.072 0.532 12.996 0.224 0.432 73.000 103.000 94.293
24 0 15 0 9 0 POST /ship_done 0.804 0.808 11.348 0.473 0.808 29.000 83.000 39.875
23 0 16 0 7 0 POST /ship 0.357 1.072 11.245 0.489 0.824 0.000 61.000 51.043
13 0 13 0 0 0 POST /complete 0.004 0.824 8.128 0.625 0.824 34.000 34.000 34.000
1 0 1 0 0 0 POST /initialize 7.576 7.576 7.576 7.576 7.576 31.000 31.000 31.000
50 0 50 0 0 0 GET /settings 0.000 0.320 3.584 0.072 0.252 2940.000 2952.000 2946.700
1283 0 1283 0 0 0 GET /items/\d+.json 0.000 0.172 3.252 0.003 0.008 1843.000 4080.000 2265.033
54 0 54 0 0 0 GET /upload/[0-9a-zA-Z]+.jpg 0.000 0.256 3.232 0.060 0.220 51261.000 135848.000 78013.296
35 0 26 0 9 0 POST /sell 0.004 0.268 1.944 0.056 0.252 13.000 106.000 30.314
13 0 13 0 0 0 POST /bump 0.004 0.104 0.212 0.016 0.104 90.000 91.000 90.923
21 0 15 0 6 0 GET /transactions/\d+.png 0.000 0.008 0.044 0.002 0.004 33.000 628.000 451.762
6 0 3 0 3 0 POST /items/edit 0.000 0.008 0.024 0.004 0.008 58.000 93.000 75.167
1 0 1 0 0 0 GET /static/js/2.ff6e1067.chunk.js 0.004 0.004 0.004 0.004 0.004 508459.000 508459.000 508459.000
1 0 1 0 0 0 GET /static/js/main.babc3d4d.chunk.js 0.000 0.000 0.000 0.000 0.000 90365.000 90365.000 90365.000
1 0 1 0 0 0 GET /static/js/runtime~main.a8a9905a.js 0.000 0.000 0.000 0.000 0.000 1502.000 1502.000 1502.000
1 0 1 0 0 0 GET /static/css/main.19393e92.chunk.css 0.000 0.000 0.000 0.000 0.000 994.000 994.000 994.000
1 0 1 0 0 0 GET /reports.json 0.000 0.000 0.000 0.000 0.000 67088.000 67088.000 67088.000
# Rank Query ID           Response time  Calls R/Call V/M   Item
# ==== ================== ============== ===== ====== ===== ==============
# ==== ================== ============== ===== ====== ===== ==============
#    1 0xAAB2372E090ED10D 387.0212 77.7%   223 1.7355  0.17 SELECT UNION items
#    2 0x93761CC3349B416F  29.1312  5.8%   117 0.2490  0.02 SELECT items
#    3 0x312243B842F41381  21.9108  4.4%   139 0.1576  0.01 SELECT items
#    4 0x2C1B6BE83F13FC2B  17.4952  3.5%   105 0.1666  0.04 SELECT items
#    5 0x36DB5799406088D9  12.8130  2.6%    82 0.1563  0.01 SELECT items
#    6 0xE070DA9421CA8C8D   7.0496  1.4% 24108 0.0003  0.01 SELECT users
# MISC 0xMISC              22.7095  4.6% 63897 0.0004   0.0 <83 ITEMS>

# Query 1: 3.60 QPS, 6.24x concurrency, ID 0xAAB2372E090ED10D at byte 129767130
# Scores: V/M = 0.17
# Time range: 2023-03-08T12:31:47 to 2023-03-08T12:32:49
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count          0     223
# Exec time     77    387s   687ms      4s      2s      3s   546ms      2s
# Lock time      2    34ms    85us     3ms   151us   194us   243us   108us
# Rows sent     20  10.67k      49      49      49      49       0      49
# Rows examine  36  13.18M  10.15k 107.64k  60.51k 101.89k  20.32k  59.57k
# Query size     0  81.53k     365     383  374.37  381.65    6.29  363.48
# String:
# Databases    isucari
# Hosts        localhost
# Users        isucari
# Query_time distribution
#   1us
#  10us
# 100us
#   1ms
#  10ms
# 100ms  #####
#    1s  ################################################################
#  10s+
# Tables
#    SHOW TABLE STATUS FROM `isucari` LIKE 'items'\G
#    SHOW CREATE TABLE `isucari`.`items`\G
# EXPLAIN /*!50100 PARTITIONS*/
(SELECT * FROM `items` WHERE `status` IN ('on_sale', 'sold_out') AND category_id IN (66, 61, 65, 62, 63, 64) AND (`created_at` < '2019-08-12 15:50:21')) UNION DISTINCT (SELECT * FROM `items` WHERE `status` IN ('on_sale', 'sold_out') AND category_id IN (66, 61, 65, 62, 63, 64) AND `created_at` <= '2019-08-12 15:50:21' AND `id` < 49820) ORDER BY `created_at` DESC, `id` DESC LIMIT 49\G
# *************************** 1. row ***************************
#            id: 1
#   select_type: PRIMARY
#         table: items
#    partitions: NULL
#          type: range
# possible_keys: idx_category_id,items_status_category_id_created_at_id_index
#           key: items_status_category_id_created_at_id_index
#       key_len: 10
#           ref: NULL
#          rows: 10329
#      filtered: 100
#         Extra: Using index condition
# *************************** 2. row ***************************
#            id: 2
#   select_type: UNION
#         table: items
#    partitions: NULL
#          type: range
# possible_keys: PRIMARY,idx_category_id,items_status_category_id_created_at_id_index
#           key: PRIMARY
#       key_len: 8
#           ref: NULL
#          rows: 21906
#      filtered: 23.58
#         Extra: Using where
# *************************** 3. row ***************************
#            id: NULL
#   select_type: UNION RESULT
#         table: <union1,2>
#    partitions: NULL
#          type: ALL
# possible_keys: NULL
#           key: NULL
#       key_len: NULL
#           ref: NULL
#          rows: NULL
#      filtered: NULL
#         Extra: Using temporary; Using filesort
tetsuzawa commented 1 year ago
./main.go:559:11: dbx.Exec(
    "INSERT INTO `configs` (`name`, `val`) VALUES (?, ?) ON DUPLICATE KEY UPDATE `val` = VALUES(`val`)",
    "payment_service_url",
    ri.PaymentServiceURL,
)
./main.go:569:11: dbx.Exec(
    "INSERT INTO `configs` (`name`, `val`) VALUES (?, ?) ON DUPLICATE KEY UPDATE `val` = VALUES(`val`)",
    "shipment_service_url",
    ri.ShipmentServiceURL,
)
./main.go:594:11: r.URL.Query()
./main.go:619:10: dbx.Select(&items,
    "SELECT * FROM `items` WHERE `status` IN (?,?) AND (`created_at` < ?  OR (`created_at` <= ? AND `id` < ?)) ORDER BY `created_at` DESC, `id` DESC LIMIT ?",
    ItemStatusOnSale,
    ItemStatusSoldOut,
    time.Unix(createdAt, 0),
    time.Unix(createdAt, 0),
    itemID,
    ItemsPerPage+1,
)
./main.go:635:10: dbx.Select(&items,
    "SELECT * FROM `items` WHERE `status` IN (?,?) ORDER BY `created_at` DESC, `id` DESC LIMIT ?",
    ItemStatusOnSale,
    ItemStatusSoldOut,
    ItemsPerPage+1,
)
./main.go:712:11: r.URL.Query()
./main.go:773:8: dbx.Select(&items, inQuery, inArgs...)
./main.go:839:11: r.URL.Query()
./main.go:863:10: dbx.Select(&items,
    "SELECT * FROM `items` WHERE `seller_id` = ? AND `status` IN (?,?,?) AND (`created_at` < ?  OR (`created_at` <= ? AND `id` < ?)) ORDER BY `created_at` DESC, `id` DESC LIMIT ?",
    userSimple.ID,
    ItemStatusOnSale,
    ItemStatusTrading,
    ItemStatusSoldOut,
    time.Unix(createdAt, 0),
    time.Unix(createdAt, 0),
    itemID,
    ItemsPerPage+1,
)
./main.go:881:10: dbx.Select(&items,
    "SELECT * FROM `items` WHERE `seller_id` = ? AND `status` IN (?,?,?) ORDER BY `created_at` DESC, `id` DESC LIMIT ?",
    userSimple.ID,
    ItemStatusOnSale,
    ItemStatusTrading,
    ItemStatusSoldOut,
    ItemsPerPage+1,
)
./main.go:941:11: r.URL.Query()
./main.go:967:10: tx.Select(&items,
    "SELECT * FROM `items` WHERE (`seller_id` = ? OR `buyer_id` = ?) AND `status` IN (?,?,?,?,?) AND (`created_at` < ?  OR (`created_at` <= ? AND `id` < ?)) ORDER BY `created_at` DESC, `id` DESC LIMIT ?",
    user.ID,
    user.ID,
    ItemStatusOnSale,
    ItemStatusTrading,
    ItemStatusSoldOut,
    ItemStatusCancel,
    ItemStatusStop,
    time.Unix(createdAt, 0),
    time.Unix(createdAt, 0),
    itemID,
    TransactionsPerPage+1,
)
./main.go:989:10: tx.Select(&items,
    "SELECT * FROM `items` WHERE (`seller_id` = ? OR `buyer_id` = ?) AND `status` IN (?,?,?,?,?) ORDER BY `created_at` DESC, `id` DESC LIMIT ?",
    user.ID,
    user.ID,
    ItemStatusOnSale,
    ItemStatusTrading,
    ItemStatusSoldOut,
    ItemStatusCancel,
    ItemStatusStop,
    TransactionsPerPage+1,
)
./main.go:1273:11: tx.Exec("UPDATE `items` SET `price` = ?, `updated_at` = ? WHERE `id` = ?",
    price,
    time.Now(),
    itemID,
)
./main.go:1435:17: tx.Exec("INSERT INTO `transaction_evidences` (`seller_id`, `buyer_id`, `status`, `item_id`, `item_name`, `item_price`, `item_description`,`item_category_id`,`item_root_category_id`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)",
    targetItem.SellerID,
    buyer.ID,
    TransactionEvidenceStatusWaitShipping,
    targetItem.ID,
    targetItem.Name,
    targetItem.Price,
    targetItem.Description,
    category.ID,
    category.ParentID,
)
./main.go:1463:11: tx.Exec("UPDATE `items` SET `buyer_id` = ?, `status` = ?, `updated_at` = ? WHERE `id` = ?",
    buyer.ID,
    ItemStatusTrading,
    time.Now(),
    targetItem.ID,
)
./main.go:1523:11: tx.Exec("INSERT INTO `shippings` (`transaction_evidence_id`, `status`, `item_name`, `item_id`, `reserve_id`, `reserve_time`, `to_address`, `to_name`, `from_address`, `from_name`, `img_binary`) VALUES (?,?,?,?,?,?,?,?,?,?,?)",
    transactionEvidenceID,
    ShippingsStatusInitial,
    targetItem.Name,
    targetItem.ID,
    scr.ReserveID,
    scr.ReserveTime,
    buyer.Address,
    buyer.AccountName,
    seller.Address,
    seller.AccountName,
    "",
)
./main.go:1658:11: tx.Exec("UPDATE `shippings` SET `status` = ?, `img_binary` = ?, `updated_at` = ? WHERE `transaction_evidence_id` = ?",
    ShippingsStatusWaitPickup,
    img,
    time.Now(),
    transactionEvidence.ID,
)
./main.go:1795:11: tx.Exec("UPDATE `shippings` SET `status` = ?, `updated_at` = ? WHERE `transaction_evidence_id` = ?",
    ssr.Status,
    time.Now(),
    transactionEvidence.ID,
)
./main.go:1808:11: tx.Exec("UPDATE `transaction_evidences` SET `status` = ?, `updated_at` = ? WHERE `id` = ?",
    TransactionEvidenceStatusWaitDone,
    time.Now(),
    transactionEvidence.ID,
)
./main.go:1935:11: tx.Exec("UPDATE `shippings` SET `status` = ?, `updated_at` = ? WHERE `transaction_evidence_id` = ?",
    ShippingsStatusDone,
    time.Now(),
    transactionEvidence.ID,
)
./main.go:1948:11: tx.Exec("UPDATE `transaction_evidences` SET `status` = ?, `updated_at` = ? WHERE `id` = ?",
    TransactionEvidenceStatusDone,
    time.Now(),
    transactionEvidence.ID,
)
./main.go:1961:11: tx.Exec("UPDATE `items` SET `status` = ?, `updated_at` = ? WHERE `id` = ?",
    ItemStatusSoldOut,
    time.Now(),
    itemID,
)
./main.go:2079:17: tx.Exec("INSERT INTO `items` (`seller_id`, `status`, `name`, `price`, `description`,`image_name`,`category_id`) VALUES (?, ?, ?, ?, ?, ?, ?)",
    seller.ID,
    ItemStatusOnSale,
    name,
    price,
    description,
    imgName,
    category.ID,
)
./main.go:2104:11: tx.Exec("UPDATE `users` SET `num_sell_items`=?, `last_bump`=? WHERE `id`=?",
    seller.NumSellItems+1,
    now,
    seller.ID,
)
./main.go:2195:11: tx.Exec("UPDATE `items` SET `created_at`=?, `updated_at`=? WHERE id=?",
    now,
    now,
    targetItem.ID,
)
./main.go:2206:11: tx.Exec("UPDATE `users` SET `last_bump`=? WHERE id=?",
    now,
    seller.ID,
)
./main.go:2292:56: []byte(password)
./main.go:2337:53: []byte(password)
./main.go:2345:17: dbx.Exec("INSERT INTO `users` (`account_name`, `hashed_password`, `address`) VALUES (?, ?, ?)",
    accountName,
    hashedPassword,
    address,
)
./main.go:2387:9: dbx.Select(&transactionEvidences, "SELECT * FROM `transaction_evidences` WHERE `id` > 15007")
tetsuzawa commented 1 year ago

{"pass":true,"score":3310,"campaign":0,"language":"Go","messages":[]}

COUNT 1XX 2XX 3XX 4XX 5XX METHOD URI MIN MAX SUM AVG P95 MIN(BODY) MAX(BODY) AVG(BODY)
191 0 181 0 10 0 GET /users/transactions.json 0.020 8.056 545.400 2.855 6.432 0.000 32641.000 20190.738
70 0 40 0 30 0 POST /buy 1.033 1.644 71.393 1.020 1.616 0.000 49.000 35.129
1510 0 1509 0 1 0 GET /new_items/\d+.json 0.002 0.496 68.097 0.045 0.136 0.000 24081.000 23484.981
57 0 36 0 21 0 POST /ship_done 0.808 0.816 31.444 0.552 0.812 29.000 83.000 39.772
54 0 40 0 14 0 POST /ship 0.808 0.820 29.976 0.555 0.816 29.000 61.000 53.741
33 0 33 0 0 0 POST /complete 0.004 0.816 24.204 0.733 0.812 34.000 34.000 34.000
306 0 306 0 0 0 GET /users/\d+.json 0.012 0.336 23.176 0.076 0.224 96.000 23943.000 14672.569
140 0 140 0 0 0 GET /new_items.json 0.028 0.508 17.960 0.128 0.432 23039.000 23729.000 23418.314
62 0 54 0 8 0 POST /login 0.068 0.420 12.704 0.205 0.400 73.000 102.000 94.516
3877 0 3877 0 0 0 GET /items/\d+.json 0.000 0.160 6.295 0.002 0.004 1843.000 4158.000 2176.470
1 0 1 0 0 0 POST /initialize 6.008 6.008 6.008 6.008 6.008 31.000 31.000 31.000
54 0 54 0 0 0 GET /settings 0.000 0.244 2.812 0.052 0.188 2939.000 2951.000 2946.704
67 0 46 0 21 0 POST /sell 0.004 0.456 2.088 0.031 0.152 13.000 106.000 34.104
58 0 58 0 0 0 GET /upload/[0-9a-zA-Z]+.jpg 0.000 0.156 2.032 0.035 0.140 51730.000 130279.000 78061.259
13 0 13 0 0 0 POST /bump 0.004 0.160 0.224 0.017 0.160 90.000 92.000 90.923
50 0 36 0 14 0 GET /transactions/\d+.png 0.000 0.016 0.056 0.001 0.004 33.000 635.000 457.300
10 0 3 0 7 0 POST /items/edit 0.000 0.004 0.024 0.002 0.004 58.000 93.000 68.300
1 0 1 0 0 0 GET /static/js/2.ff6e1067.chunk.js 0.004 0.004 0.004 0.004 0.004 508459.000 508459.000 508459.000
1 0 1 0 0 0 GET /static/js/main.babc3d4d.chunk.js 0.000 0.000 0.000 0.000 0.000 90365.000 90365.000 90365.000
1 0 1 0 0 0 GET /static/js/runtime~main.a8a9905a.js 0.000 0.000 0.000 0.000 0.000 1502.000 1502.000 1502.000
1 0 1 0 0 0 GET /static/css/main.19393e92.chunk.css 0.000 0.000 0.000 0.000 0.000 994.000 994.000 994.000
1 0 1 0 0 0 GET /reports.json 0.000 0.000 0.000 0.000 0.000 147678.000 147678.000 147678.000
1 0 1 0 0 0 GET / 0.000 0.000 0.000 0.000 0.000 2037.000 2037.000 2037.000
tetsuzawa commented 1 year ago

3410

COUNT 1XX 2XX 3XX 4XX 5XX METHOD URI MIN MAX SUM AVG P95 MIN(BODY) MAX(BODY) AVG(BODY)
194 0 183 0 11 0 GET /users/transactions.json 0.020 8.044 560.552 2.889 5.632 0.000 32468.000 19447.139
70 0 42 0 28 0 POST /buy 1.608 1.644 72.492 1.036 1.620 29.000 49.000 36.100
1485 0 1485 0 0 0 GET /new_items/\d+.json 0.008 0.640 63.708 0.043 0.156 22624.000 24021.000 23491.976
59 0 38 0 21 0 POST /ship_done 0.804 0.840 33.100 0.561 0.812 29.000 83.000 39.576
55 0 41 0 14 0 POST /ship 0.808 0.812 30.711 0.558 0.808 29.000 61.000 53.873
36 0 34 0 2 0 POST /complete 0.004 0.820 25.362 0.704 0.808 0.000 34.000 32.111
140 0 140 0 0 0 GET /new_items.json 0.028 0.536 17.712 0.127 0.336 23042.000 23752.000 23437.193
62 0 54 0 8 0 POST /login 0.064 0.404 11.924 0.192 0.400 73.000 104.000 94.935
1 0 1 0 0 0 POST /initialize 7.348 7.348 7.348 7.348 7.348 31.000 31.000 31.000
3921 0 3921 0 0 0 GET /items/\d+.json 0.000 0.220 7.263 0.002 0.004 1852.000 4029.000 2173.981
54 0 54 0 0 0 GET /settings 0.004 0.320 2.368 0.044 0.164 2940.000 2953.000 2947.185
323 0 323 0 0 0 GET /users/\d+.json 0.000 0.240 2.300 0.007 0.016 95.000 23980.000 14398.536
58 0 58 0 0 0 GET /upload/[0-9a-zA-Z]+.jpg 0.004 0.200 1.845 0.032 0.135 51662.000 146741.000 79872.569
67 0 46 0 21 0 POST /sell 0.004 0.176 1.304 0.019 0.140 13.000 106.000 34.104
13 0 13 0 0 0 POST /bump 0.004 0.100 0.160 0.012 0.100 90.000 91.000 90.923
1 0 1 0 0 0 GET /static/css/main.19393e92.chunk.css 0.080 0.080 0.080 0.080 0.080 994.000 994.000 994.000
1 0 1 0 0 0 GET /static/js/main.babc3d4d.chunk.js 0.080 0.080 0.080 0.080 0.080 90365.000 90365.000 90365.000
52 0 38 0 14 0 GET /transactions/\d+.png 0.000 0.004 0.056 0.001 0.004 33.000 631.000 462.769
10 0 3 0 7 0 POST /items/edit 0.000 0.016 0.036 0.004 0.016 58.000 93.000 68.300
1 0 1 0 0 0 GET /static/js/runtime~main.a8a9905a.js 0.036 0.036 0.036 0.036 0.036 1502.000 1502.000 1502.000
1 0 1 0 0 0 GET /reports.json 0.004 0.004 0.004 0.004 0.004 147089.000 147089.000 147089.000
1 0 1 0 0 0 GET /static/js/2.ff6e1067.chunk.js 0.000 0.000 0.000 0.000 0.000 508459.000 508459.000 508459.000
# 15.7s user time, 110ms system time, 41.12M rss, 112.56M vsz
# Current date: Wed Mar  8 12:59:41 2023
# Hostname: ip-192-168-0-14
# Files: /var/log/mysql/mysqld-slow.log
# Overall: 309.50k total, 89 unique, 3.29k QPS, 0.93x concurrency ________
# Time range: 2023-03-08T12:57:51 to 2023-03-08T12:59:25
# Attribute          total     min     max     avg     95%  stddev  median
# ============     ======= ======= ======= ======= ======= ======= =======
# Exec time            87s     1us   743ms   281us   185us     5ms    40us
# Lock time             3s       0    21ms     8us    13us   134us       0
# Rows sent        185.66k       0      49    0.61    0.99    3.58       0
# Rows examine      34.37M       0  48.92k  116.46    0.99   2.01k       0
# Query size       130.76M       0 913.29k  443.01   38.53  16.37k   31.70

# Profile
# Rank Query ID           Response time Calls  R/Call V/M   Item
# ==== ================== ============= ====== ====== ===== ==============
#    1 0x930FF1E60F9B9ED6 30.4375 34.9%   1318 0.0231  0.06 SELECT items
#    2 0x93761CC3349B416F 12.7913 14.7%    117 0.1093  0.07 SELECT items
#    3 0xE070DA9421CA8C8D 10.0599 11.5%  91089 0.0001  0.00 SELECT users
#    4 0x99AA0165670CE848  8.0529  9.2% 102444 0.0001  0.01 ADMIN PREPARE
#    5 0x9A74397A1FB13CDE  6.3692  7.3%    167 0.0381  0.05 SELECT items
#    6 0x2C1B6BE83F13FC2B  5.5016  6.3%    128 0.0430  0.03 SELECT items
#    7 0x54AA9C3947003532  3.9544  4.5%    100 0.0395  0.14 INSERT items
#    8 0x4C0C6A2C3174E3A8  2.4756  2.8%     66 0.0375  0.01 SELECT items
#    9 0x3F18C2F28C3748A2  1.7643  2.0%     23 0.0767  0.13 SELECT items
#   10 0x4C4F0D7D775BE587  1.3515  1.6%     98 0.0138  0.02 INSERT transaction_evidences
#   11 0x064B215924067643  0.7302  0.8%     98 0.0075  0.01 INSERT shippings
# MISC 0xMISC              3.6813  4.2% 113847 0.0000   0.0 <78 ITEMS>

# Query 1: 23.12 QPS, 0.53x concurrency, ID 0x930FF1E60F9B9ED6 at byte 128465964
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.06
# Time range: 2023-03-08T12:58:06 to 2023-03-08T12:59:03
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count          0    1318
# Exec time     34     30s     2ms   359ms    23ms   110ms    37ms     9ms
# Lock time      2    53ms    20us     2ms    40us    84us    68us    27us
# Rows sent     33  63.07k      49      49      49      49       0      49
# Rows examine  45  15.81M   3.42k  48.91k  12.28k  46.68k  13.98k   6.63k
# Query size     0 325.71k     248     257  253.06  246.02       0  246.02
# String:
# Databases    isucari
# Hosts        localhost
# Users        isucari
# Query_time distribution
#   1us
#  10us
# 100us
#   1ms  ################################################################
#  10ms  ####################################################
# 100ms  #######
#    1s
#  10s+
# Tables
#    SHOW TABLE STATUS FROM `isucari` LIKE 'items'\G
#    SHOW CREATE TABLE `isucari`.`items`\G
# EXPLAIN /*!50100 PARTITIONS*/
SELECT * FROM `items` WHERE `status` IN ('on_sale','sold_out') AND category_id IN (64, 62, 63, 61, 65, 66) AND (`created_at` < '2019-08-12 15:46:03'  OR (`created_at` <= '2019-08-12 15:46:03' AND `id` < 49559)) ORDER BY `created_at` DESC, `id` DESC LIMIT 49\G
# *************************** 1. row ***************************
#            id: 1
#   select_type: SIMPLE
#         table: items
#    partitions: NULL
#          type: range
# possible_keys: PRIMARY,idx_category_id,items_status_category_id_created_at_id_index,items_status_created_at_id_index
#           key: items_status_category_id_created_at_id_index
#       key_len: 18
#           ref: NULL
#          rows: 10288
#      filtered: 100
#         Extra: Using index condition; Using filesort

# Query 2: 2.54 QPS, 0.28x concurrency, ID 0x93761CC3349B416F at byte 128797736
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.07
# Time range: 2023-03-08T12:58:06 to 2023-03-08T12:58:52
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count          0     117
# Exec time     14     13s    22ms   477ms   109ms   241ms    86ms    91ms
# Lock time      0     5ms    19us   508us    39us    73us    65us    23us
# Rows sent      3   5.60k      49      49      49      49       0      49
# Rows examine  16   5.59M  48.88k  48.92k  48.90k  46.68k       0  46.68k
# Query size     0  24.34k     213     213     213     213       0     213
# String:
# Databases    isucari
# Hosts        localhost
# Users        isucari
# Query_time distribution
#   1us
#  10us
# 100us
#   1ms
#  10ms  ################################################################
# 100ms  ##############################################################
#    1s
#  10s+
# Tables
#    SHOW TABLE STATUS FROM `isucari` LIKE 'items'\G
#    SHOW CREATE TABLE `isucari`.`items`\G
# EXPLAIN /*!50100 PARTITIONS*/
SELECT * FROM `items` WHERE `status` IN ('on_sale','sold_out') AND (`created_at` < '2019-08-12 15:52:00'  OR (`created_at` <= '2019-08-12 15:52:00' AND `id` < 49912)) ORDER BY `created_at` DESC, `id` DESC LIMIT 49\G
# *************************** 1. row ***************************
#            id: 1
#   select_type: SIMPLE
#         table: items
#    partitions: NULL
#          type: ALL
# possible_keys: PRIMARY,items_status_category_id_created_at_id_index,items_status_created_at_id_index
#           key: NULL
#       key_len: NULL
#           ref: NULL
#          rows: 43839
#      filtered: 40.74
#         Extra: Using where; Using filesort

# Query 3: 1.47k QPS, 0.16x concurrency, ID 0xE070DA9421CA8C8D at byte 127843549
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-03-08T12:58:05 to 2023-03-08T12:59:07
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count         29   91089
# Exec time     11     10s    26us    26ms   110us   260us   329us    60us
# Lock time     56      1s     5us    21ms    15us    23us   117us     9us
# Rows sent     47  88.95k       1       1       1       1       0       1
# Rows examine   0  88.95k       1       1       1       1       0       1
# Query size     2   3.37M      36      39   38.74   38.53    0.78   38.53
# String:
# Databases    isucari
# Hosts        localhost
# Users        isucari
# Query_time distribution
#   1us
#  10us  ################################################################
# 100us  ####################
#   1ms  #
#  10ms  #
# 100ms
#    1s
#  10s+
# Tables
#    SHOW TABLE STATUS FROM `isucari` LIKE 'users'\G
#    SHOW CREATE TABLE `isucari`.`users`\G
# EXPLAIN /*!50100 PARTITIONS*/
SELECT * FROM `users` WHERE `id` = 2421\G
# *************************** 1. row ***************************
#            id: 1
#   select_type: SIMPLE
#         table: users
#    partitions: NULL
#          type: const
# possible_keys: PRIMARY
#           key: PRIMARY
#       key_len: 8
#           ref: const
#          rows: 1
#      filtered: 100
#         Extra: NULL

# Query 4: 1.65k QPS, 0.13x concurrency, ID 0x99AA0165670CE848 at byte 128214190
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.01
# Time range: 2023-03-08T12:58:05 to 2023-03-08T12:59:07
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count         33  102444
# Exec time      9      8s    16us   206ms    78us   144us   963us    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     2   2.93M      30      30      30      30       0      30
# String:
# Databases    isucari
# Hosts        localhost
# Users        isucari
# Query_time distribution
#   1us
#  10us  ################################################################
# 100us  ######
#   1ms  #
#  10ms  #
# 100ms  #
#    1s
#  10s+
administrator command: Prepare\G
tetsuzawa commented 1 year ago

3610

COUNT 1XX 2XX 3XX 4XX 5XX METHOD URI MIN MAX SUM AVG P95 MIN(BODY) MAX(BODY) AVG(BODY)
198 0 190 0 8 0 GET /users/transactions.json 0.016 7.268 581.055 2.935 5.628 0.000 30734.000 20469.677
75 0 45 0 30 0 POST /buy 0.004 1.636 78.263 1.044 1.612 0.000 49.000 35.053
64 0 43 0 21 0 POST /ship_done 0.804 0.823 37.091 0.580 0.812 29.000 83.000 39.141
1765 0 1765 0 0 0 GET /new_items/\d+.json 0.004 0.512 36.468 0.021 0.060 22752.000 24031.000 23504.636
59 0 45 0 14 0 POST /ship 0.808 0.896 34.028 0.577 0.812 29.000 61.000 54.356
39 0 36 0 3 0 POST /complete 0.004 0.816 26.956 0.691 0.816 0.000 34.000 31.385
144 0 144 0 0 0 GET /new_items.json 0.020 0.484 11.179 0.078 0.220 23025.000 23723.000 23445.146
62 0 54 0 8 0 POST /login 0.060 0.376 11.080 0.179 0.348 73.000 105.000 94.468
1 0 1 0 0 0 POST /initialize 8.748 8.748 8.748 8.748 8.748 31.000 31.000 31.000
4458 0 4458 0 0 0 GET /items/\d+.json 0.000 0.228 7.140 0.002 0.004 1851.000 4214.000 2177.459
54 0 54 0 0 0 GET /settings 0.004 0.224 1.888 0.035 0.184 2940.000 2954.000 2946.648
70 0 49 0 21 0 POST /sell 0.004 0.288 1.624 0.023 0.120 13.000 106.000 33.200
314 0 314 0 0 0 GET /users/\d+.json 0.004 0.192 1.604 0.005 0.012 94.000 24012.000 14993.723
58 0 58 0 0 0 GET /upload/[0-9a-zA-Z]+.jpg 0.000 0.132 1.000 0.017 0.120 51335.000 141190.000 81327.362
13 0 13 0 0 0 POST /bump 0.004 0.056 0.136 0.010 0.056 90.000 92.000 91.077
1 0 1 0 0 0 GET /static/js/runtime~main.a8a9905a.js 0.064 0.064 0.064 0.064 0.064 1502.000 1502.000 1502.000
1 0 1 0 0 0 GET /static/css/main.19393e92.chunk.css 0.052 0.052 0.052 0.052 0.052 994.000 994.000 994.000
1 0 1 0 0 0 GET /static/js/main.babc3d4d.chunk.js 0.040 0.040 0.040 0.040 0.040 90365.000 90365.000 90365.000
57 0 43 0 14 0 GET /transactions/\d+.png 0.000 0.004 0.036 0.001 0.004 33.000 636.000 476.263
10 0 3 0 7 0 POST /items/edit 0.000 0.008 0.020 0.002 0.008 58.000 93.000 68.300
1 0 1 0 0 0 GET /static/js/2.ff6e1067.chunk.js 0.008 0.008 0.008 0.008 0.008 508459.000 508459.000 508459.000
1 0 1 0 0 0 GET /reports.json 0.000 0.000 0.000 0.000 0.000 162016.000 162016.000 162016.000
# 3.4s user time, 120ms system time, 42.21M rss, 113.77M vsz
# Current date: Wed Mar  8 13:24:35 2023
# Hostname: ip-192-168-0-14
# Files: /var/log/mysql/mysqld-slow.log
# Overall: 57.88k total, 66 unique, 573.11 QPS, 0.61x concurrency ________
# Time range: 2023-03-08T13:22:51 to 2023-03-08T13:24:32
# Attribute          total     min     max     avg     95%  stddev  median
# ============     ======= ======= ======= ======= ======= ======= =======
# Exec time            61s     1us   812ms     1ms     2ms    10ms    44us
# Lock time             1s       0    10ms    21us    21us   272us       0
# Rows sent        117.19k       0      49    2.07    0.99    8.71       0
# Rows examine      36.71M       0  48.92k  665.02    0.99   4.69k       0
# Query size       122.70M       0 913.29k   2.17k  136.99  37.81k   31.70

# Profile
# Rank Query ID           Response time Calls R/Call V/M   Item
# ==== ================== ============= ===== ====== ===== ===============
#    1 0x930FF1E60F9B9ED6 24.6554 40.3%  1570 0.0157  0.04 SELECT items
#    2 0x93761CC3349B416F  8.9077 14.6%   117 0.0761  0.07 SELECT items
#    3 0x9A74397A1FB13CDE  6.0735  9.9%   195 0.0311  0.04 SELECT items
#    4 0x54AA9C3947003532  4.4489  7.3%   100 0.0445  0.15 INSERT items
#    5 0x2C1B6BE83F13FC2B  3.8394  6.3%   125 0.0307  0.03 SELECT items
#    6 0x4C4F0D7D775BE587  2.2016  3.6%    98 0.0225  0.23 INSERT transaction_evidences
#    7 0x4C0C6A2C3174E3A8  2.0665  3.4%    73 0.0283  0.01 SELECT items
#    8 0x99AA0165670CE848  1.9533  3.2% 18729 0.0001  0.02 ADMIN PREPARE
#    9 0x3F18C2F28C3748A2  1.8849  3.1%    27 0.0698  0.10 SELECT items
#   10 0x813031B8BBC3B329  0.8695  1.4%   428 0.0020  0.01 COMMIT
#   11 0xE070DA9421CA8C8D  0.8545  1.4%  6190 0.0001  0.00 SELECT users
#   12 0x064B215924067643  0.8058  1.3%    98 0.0082  0.02 INSERT shippings
# MISC 0xMISC              2.5858  4.2% 30134 0.0001   0.0 <54 ITEMS>

# Query 1: 27.54 QPS, 0.43x concurrency, ID 0x930FF1E60F9B9ED6 at byte 127752203
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.04
# Time range: 2023-03-08T13:23:01 to 2023-03-08T13:23:58
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count          2    1570
# Exec time     40     25s     2ms   433ms    16ms    44ms    27ms     8ms
# Lock time      5    66ms    20us     7ms    41us    44us   199us    27us
# Rows sent     64  75.13k      49      49      49      49       0      49
# Rows examine  47  17.32M   2.48k  48.91k  11.30k  46.68k  13.01k   6.63k
# Query size     0 387.48k     248     257  252.72  246.02       0  246.02
# String:
# Databases    isucari
# Hosts        localhost
# Users        isucari
# Query_time distribution
#   1us
#  10us
# 100us
#   1ms  ################################################################
#  10ms  ################################
# 100ms  #
#    1s
#  10s+
# Tables
#    SHOW TABLE STATUS FROM `isucari` LIKE 'items'\G
#    SHOW CREATE TABLE `isucari`.`items`\G
# EXPLAIN /*!50100 PARTITIONS*/
SELECT * FROM `items` WHERE `status` IN ('on_sale','sold_out') AND category_id IN (21, 23, 22, 24) AND (`created_at` < '2019-08-12 15:49:28'  OR (`created_at` <= '2019-08-12 15:49:28' AND `id` < 49763)) ORDER BY `created_at` DESC, `id` DESC LIMIT 49\G
# *************************** 1. row ***************************
#            id: 1
#   select_type: SIMPLE
#         table: items
#    partitions: NULL
#          type: range
# possible_keys: PRIMARY,idx_category_id,items_status_category_id_created_at_id_index,items_status_created_at_id_index
#           key: items_status_category_id_created_at_id_index
#       key_len: 18
#           ref: NULL
#          rows: 8470
#      filtered: 100
#         Extra: Using index condition; Using filesort

# Query 2: 3.25 QPS, 0.25x concurrency, ID 0x93761CC3349B416F at byte 127495852
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.07
# Time range: 2023-03-08T13:23:01 to 2023-03-08T13:23:37
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count          0     117
# Exec time     14      9s    22ms   477ms    76ms   208ms    75ms    44ms
# Lock time      0     3ms    17us   139us    29us    47us    16us    25us
# Rows sent      4   5.60k      49      49      49      49       0      49
# Rows examine  15   5.59M  48.88k  48.91k  48.90k  46.68k       0  46.68k
# Query size     0  24.34k     213     213     213     213       0     213
# String:
# Databases    isucari
# Hosts        localhost
# Users        isucari
# Query_time distribution
#   1us
#  10us
# 100us
#   1ms
#  10ms  ################################################################
# 100ms  ########################
#    1s
#  10s+
# Tables
#    SHOW TABLE STATUS FROM `isucari` LIKE 'items'\G
#    SHOW CREATE TABLE `isucari`.`items`\G
# EXPLAIN /*!50100 PARTITIONS*/
SELECT * FROM `items` WHERE `status` IN ('on_sale','sold_out') AND (`created_at` < '2019-08-12 15:52:54'  OR (`created_at` <= '2019-08-12 15:52:54' AND `id` < 49965)) ORDER BY `created_at` DESC, `id` DESC LIMIT 49\G
# *************************** 1. row ***************************
#            id: 1
#   select_type: SIMPLE
#         table: items
#    partitions: NULL
#          type: ALL
# possible_keys: PRIMARY,items_status_category_id_created_at_id_index,items_status_created_at_id_index
#           key: NULL
#       key_len: NULL
#           ref: NULL
#          rows: 43847
#      filtered: 40.74
#         Extra: Using where; Using filesort