karamaru-alpha / isucon12-qualify

isucon12予選デモ
0 stars 0 forks source link

計測 #1

Open karamaru-alpha opened 1 year ago

karamaru-alpha commented 1 year ago

Mysql

CREATE TABLE `id_generator` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `stub` char(1) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `stub` (`stub`)
) ENGINE=InnoDB AUTO_INCREMENT=2678408366 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE `tenant` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `display_name` varchar(255) NOT NULL,
  `created_at` bigint NOT NULL,
  `updated_at` bigint NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=108 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE `visit_history` (
  `player_id` varchar(255) NOT NULL,
  `tenant_id` bigint unsigned NOT NULL,
  `competition_id` varchar(255) NOT NULL,
  `created_at` bigint NOT NULL,
  `updated_at` bigint NOT NULL,
  KEY `tenant_id_idx` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

+---------------+--------+------------+----------+---------+----------+
| TABLE_NAME    | ENGINE | TABLE_ROWS | total_mb | data_mb | index_mb |
+---------------+--------+------------+----------+---------+----------+
| visit_history | InnoDB |    3008940 |      270 |     212 |       57 |
| id_generator  | InnoDB |          1 |        0 |       0 |        0 |
| tenant        | InnoDB |        106 |        0 |       0 |        0 |
+---------------+--------+------------+----------+---------+----------+

Sqlite


DROP TABLE IF EXISTS competition;
DROP TABLE IF EXISTS player;
DROP TABLE IF EXISTS player_score;

CREATE TABLE competition (
  id VARCHAR(255) NOT NULL PRIMARY KEY,
  tenant_id BIGINT NOT NULL,
  title TEXT NOT NULL,
  finished_at BIGINT NULL,
  created_at BIGINT NOT NULL,
  updated_at BIGINT NOT NULL
);

CREATE TABLE player (
  id VARCHAR(255) NOT NULL PRIMARY KEY,
  tenant_id BIGINT NOT NULL,
  display_name TEXT NOT NULL,
  is_disqualified BOOLEAN NOT NULL,
  created_at BIGINT NOT NULL,
  updated_at BIGINT NOT NULL
);

CREATE TABLE player_score (
  id VARCHAR(255) NOT NULL PRIMARY KEY,
  tenant_id BIGINT NOT NULL,
  player_id VARCHAR(255) NOT NULL,
  competition_id VARCHAR(255) NOT NULL,
  score BIGINT NOT NULL,
  row_num BIGINT NOT NULL,
  created_at BIGINT NOT NULL,
  updated_at BIGINT NOT NULL
);
``
karamaru-alpha commented 1 year ago

init 3599

kataribe ``` sudo cat /var/log/nginx/access.log | kataribe -f /home/isucon/webapp/kataribe.toml Top 20 Sort By Count Count Total Mean Min Max Request 150 3.471 0.0231 0.001 0.090 GET /api/player/competitions HTTP/2.0 72 0.743 0.0103 0.004 0.035 GET /api/player/competition/9fa52a6c/ranking HTTP/2.0 52 1.302 0.0250 0.006 0.077 GET /api/player/competition/9fa54a9f/ranking HTTP/2.0 49 1.042 0.0213 0.009 0.106 POST /api/organizer/competitions/add HTTP/2.0 37 75.513 2.0409 0.026 4.081 GET /api/player/competition/9fa52a86/ranking HTTP/2.0 36 68.807 1.9113 0.013 4.417 GET /api/player/competition/9fa52ea9/ranking HTTP/2.0 35 44.982 1.2852 0.007 8.710 GET /api/player/competition/9fa5278c/ranking HTTP/2.0 32 0.343 0.0107 0.002 0.040 GET /api/organizer/players HTTP/2.0 32 0.409 0.0128 0.010 0.019 GET /api/player/competition/9fa53561/ranking HTTP/2.0 31 68.485 2.2092 0.025 4.992 GET /api/player/competition/9fa53148/ranking HTTP/2.0 30 58.760 1.9587 0.022 8.353 GET /api/player/competition/9fa52ce7/ranking HTTP/2.0 29 0.471 0.0162 0.010 0.067 GET /api/player/competition/9fa53029/ranking HTTP/2.0 29 0.274 0.0094 0.006 0.026 GET /api/player/competition/9fa53e33/ranking HTTP/2.0 29 7.286 0.2512 0.002 3.152 GET /api/organizer/billing HTTP/2.0 29 73.100 2.5207 0.019 5.402 GET /api/player/competition/9fa53609/ranking HTTP/2.0 28 8.979 0.3207 0.012 0.825 GET /api/player/competition/9fa53027/ranking HTTP/2.0 27 0.484 0.0179 0.007 0.061 GET /api/player/competition/9fa54608/ranking HTTP/2.0 27 104.968 3.8877 0.041 9.858 GET /api/player/competition/9fa531c3/ranking HTTP/2.0 27 55.222 2.0453 0.027 4.511 GET /api/player/competition/9fa53a7a/ranking HTTP/2.0 24 51.777 2.1574 0.021 4.106 GET /api/player/competition/9fa53e9d/ranking HTTP/2.0 Top 20 Sort By Total Count Total Mean Min Max Request 18 111.252 6.1807 0.604 10.702 GET /api/player/competition/9fa54320/ranking HTTP/2.0 19 108.626 5.7172 0.120 10.319 GET /api/player/competition/9fa539e6/ranking HTTP/2.0 27 104.968 3.8877 0.041 9.858 GET /api/player/competition/9fa531c3/ranking HTTP/2.0 37 75.513 2.0409 0.026 4.081 GET /api/player/competition/9fa52a86/ranking HTTP/2.0 29 73.100 2.5207 0.019 5.402 GET /api/player/competition/9fa53609/ranking HTTP/2.0 36 68.807 1.9113 0.013 4.417 GET /api/player/competition/9fa52ea9/ranking HTTP/2.0 31 68.485 2.2092 0.025 4.992 GET /api/player/competition/9fa53148/ranking HTTP/2.0 30 58.760 1.9587 0.022 8.353 GET /api/player/competition/9fa52ce7/ranking HTTP/2.0 18 58.500 3.2500 0.044 5.556 GET /api/player/competition/9fa54a7c/ranking HTTP/2.0 27 55.222 2.0453 0.027 4.511 GET /api/player/competition/9fa53a7a/ranking HTTP/2.0 21 55.090 2.6233 0.022 4.644 GET /api/player/competition/9fa541a2/ranking HTTP/2.0 24 51.777 2.1574 0.021 4.106 GET /api/player/competition/9fa53e9d/ranking HTTP/2.0 35 44.982 1.2852 0.007 8.710 GET /api/player/competition/9fa5278c/ranking HTTP/2.0 20 41.688 2.0844 0.015 3.640 GET /api/player/competition/9fa547ac/ranking HTTP/2.0 8 26.624 3.3280 0.050 9.843 GET /api/player/player/2c23c345f HTTP/2.0 10 24.950 2.4950 1.633 3.813 POST /api/organizer/players/add HTTP/2.0 2 24.597 12.2985 11.406 13.191 GET /api/admin/tenants/billing?before=54 HTTP/2.0 2 24.264 12.1320 9.422 14.842 GET /api/admin/tenants/billing?before=55 HTTP/2.0 10 23.587 2.3587 0.034 10.317 GET /api/player/player/1bb8828d1 HTTP/2.0 1 22.453 22.4530 22.453 22.453 GET /api/admin/tenants/billing?before=80 HTTP/2.0 Top 20 Sort By Mean Count Total Mean Min Max Request 1 22.453 22.4530 22.453 22.453 GET /api/admin/tenants/billing?before=80 HTTP/2.0 1 16.920 16.9200 16.920 16.920 GET /api/admin/tenants/billing?before=70 HTTP/2.0 2 24.597 12.2985 11.406 13.191 GET /api/admin/tenants/billing?before=54 HTTP/2.0 2 24.264 12.1320 9.422 14.842 GET /api/admin/tenants/billing?before=55 HTTP/2.0 1 11.151 11.1510 11.151 11.151 GET /api/admin/tenants/billing?before=100 HTTP/2.0 1 10.696 10.6960 10.696 10.696 GET /api/player/player/9fa52cd2 HTTP/2.0 1 10.388 10.3880 10.388 10.388 GET /api/player/player/9fa53115 HTTP/2.0 1 10.384 10.3840 10.384 10.384 GET /api/player/player/9fa52cbb HTTP/2.0 1 10.332 10.3320 10.332 10.332 GET /api/player/player/9fa53903 HTTP/2.0 1 10.305 10.3050 10.305 10.305 GET /api/player/player/9fa530c0 HTTP/2.0 1 9.957 9.9570 9.957 9.957 POST /api/organizer/competition/9fa54320/score HTTP/2.0 1 8.768 8.7680 8.768 8.768 GET /api/player/competition/ceb728dd/ranking HTTP/2.0 1 8.758 8.7580 8.758 8.758 GET /api/player/player/9fa52bd4 HTTP/2.0 1 8.340 8.3400 8.340 8.340 POST /api/organizer/competition/9fa539e6/score HTTP/2.0 1 7.951 7.9510 7.951 7.951 GET /api/player/player/9fa530ea HTTP/2.0 18 111.252 6.1807 0.604 10.702 GET /api/player/competition/9fa54320/ranking HTTP/2.0 2 12.126 6.0630 1.418 10.708 GET /api/player/competition/5b7f1e5e1/ranking HTTP/2.0 19 108.626 5.7172 0.120 10.319 GET /api/player/competition/9fa539e6/ranking HTTP/2.0 1 5.396 5.3960 5.396 5.396 GET /api/player/player/9fa52819 HTTP/2.0 1 5.332 5.3320 5.332 5.332 GET /api/player/competition/426f1cd1c/ranking HTTP/2.0 Top 20 Sort By Maximum(100 Percentile) Count Total Mean Min Max Request 1 22.453 22.4530 22.453 22.453 GET /api/admin/tenants/billing?before=80 HTTP/2.0 1 16.920 16.9200 16.920 16.920 GET /api/admin/tenants/billing?before=70 HTTP/2.0 2 24.264 12.1320 9.422 14.842 GET /api/admin/tenants/billing?before=55 HTTP/2.0 2 24.597 12.2985 11.406 13.191 GET /api/admin/tenants/billing?before=54 HTTP/2.0 1 11.151 11.1510 11.151 11.151 GET /api/admin/tenants/billing?before=100 HTTP/2.0 3 12.423 4.1410 0.682 10.739 GET /api/player/player/9fa530b9 HTTP/2.0 2 12.126 6.0630 1.418 10.708 GET /api/player/competition/5b7f1e5e1/ranking HTTP/2.0 18 111.252 6.1807 0.604 10.702 GET /api/player/competition/9fa54320/ranking HTTP/2.0 1 10.696 10.6960 10.696 10.696 GET /api/player/player/9fa52cd2 HTTP/2.0 7 17.417 2.4881 0.025 10.695 GET /api/player/player/4370566ca HTTP/2.0 3 11.360 3.7867 0.164 10.460 GET /api/player/player/9fa52bfc HTTP/2.0 5 13.261 2.6522 0.209 10.436 GET /api/player/player/2b319d877 HTTP/2.0 5 19.293 3.8586 0.091 10.412 GET /api/player/player/3b7969192 HTTP/2.0 1 10.388 10.3880 10.388 10.388 GET /api/player/player/9fa53115 HTTP/2.0 1 10.384 10.3840 10.384 10.384 GET /api/player/player/9fa52cbb HTTP/2.0 3 12.217 4.0723 0.577 10.358 GET /api/player/player/9fa52cdc HTTP/2.0 2 10.417 5.2085 0.063 10.354 GET /api/player/player/9fa53136 HTTP/2.0 1 10.332 10.3320 10.332 10.332 GET /api/player/player/9fa53903 HTTP/2.0 19 108.626 5.7172 0.120 10.319 GET /api/player/competition/9fa539e6/ranking HTTP/2.0 10 23.587 2.3587 0.034 10.317 GET /api/player/player/1bb8828d1 HTTP/2.0 TOP 10 Slow Requests 1 22.453 GET /api/admin/tenants/billing?before=80 HTTP/2.0 2 16.920 GET /api/admin/tenants/billing?before=70 HTTP/2.0 3 14.842 GET /api/admin/tenants/billing?before=55 HTTP/2.0 4 13.191 GET /api/admin/tenants/billing?before=54 HTTP/2.0 5 11.406 GET /api/admin/tenants/billing?before=54 HTTP/2.0 6 11.151 GET /api/admin/tenants/billing?before=100 HTTP/2.0 7 10.739 GET /api/player/player/9fa530b9 HTTP/2.0 8 10.708 GET /api/player/competition/5b7f1e5e1/ranking HTTP/2.0 9 10.702 GET /api/player/competition/9fa54320/ranking HTTP/2.0 10 10.696 GET /api/player/player/9fa52cd2 HTTP/2.0 ```
slow-log ``` sudo /home/isucon/webapp/slow.sh /var/log/mysql/slow-query.log # Query 1: 20.78 QPS, 1.58x concurrency, ID 0x676347F321DB8BC7FCB05D4948FC2248 at byte 11261984 # Scores: V/M = 0.06 # Time range: 2023-05-06T07:21:03 to 2023-05-06T07:22:19 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 2 1579 # Exec time 70 120s 160us 474ms 76ms 208ms 70ms 53ms # Lock time 0 4ms 1us 872us 2us 1us 21us 1us # Rows sent 96 115.84k 0 199 75.13 174.84 52.48 59.77 # Rows examine 89 26.03M 0 49.19k 16.88k 44.45k 13.06k 11.91k # Query size 10 220.46k 142 144 142.97 136.99 0.66 136.99 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us ## # 1ms ########## # 10ms ################################################################ # 100ms ################################## # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT player_id, MIN(created_at) AS min_created_at FROM visit_history WHERE tenant_id = 59 AND competition_id = '184b9b3e1' GROUP BY player_id\G # Query 2: 164.12 QPS, 0.55x concurrency, ID 0x94A9E43DFAAFA029A1FC19A5563AD0F5 at byte 8800405 # Scores: V/M = 0.00 # Time range: 2023-05-06T07:21:03 to 2023-05-06T07:22:17 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 22 12145 # Exec time 23 40s 606us 74ms 3ms 8ms 3ms 3ms # Lock time 97 376ms 0 9ms 30us 159us 200us 1us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 0 0 0 0 0 0 0 0 # Query size 25 533.72k 45 45 45 45 0 45 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us ### # 1ms ################################################################ # 10ms ## # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'id_generator'\G # SHOW CREATE TABLE `isuports`.`id_generator`\G REPLACE INTO id_generator (stub) VALUES ('a')\G # Query 3: 12.81 QPS, 0.06x concurrency, ID 0x2E69352DE16B15042A1217500A0400FE at byte 3467238 # Scores: V/M = 0.00 # Time range: 2023-05-06T07:21:06 to 2023-05-06T07:22:13 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 1 858 # Exec time 2 4s 629us 58ms 4ms 10ms 4ms 3ms # Lock time 0 2ms 0 540us 2us 1us 19us 1us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 0 0 0 0 0 0 0 0 # Query size 5 124.74k 148 150 148.87 143.84 0 143.84 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # # 1ms ################################################################ # 10ms #### # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G INSERT INTO visit_history (player_id, tenant_id, competition_id, created_at, updated_at) VALUES ('9fa5292a', 113, '9fa53029', 1683357686, 1683357686)\G # Query 4: 0 QPS, 0x concurrency, ID 0x3289E87E94D5A82E348974B3D332E575 at byte 840 # Scores: V/M = 0.00 # Time range: all events occurred at 2023-05-06T07:21:02 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 1 # Exec time 1 3s 3s 3s 3s 3s 0 3s # Lock time 0 8us 8us 8us 8us 8us 0 8us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 10 3.08M 3.08M 3.08M 3.08M 3.08M 0 3.08M # Query size 0 58 58 58 58 58 0 58 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s ################################################################ # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G DELETE FROM visit_history WHERE created_at >= '1654041600'\G # Converted for EXPLAIN # EXPLAIN /*!50100 PARTITIONS*/ select * from visit_history WHERE created_at >= '1654041600'\G # Query 5: 231.57 QPS, 0.02x concurrency, ID 0xDA556F9115773A1A99AA0165670CE848 at byte 926206 # Scores: V/M = 0.00 # Time range: 2023-05-06T07:21:03 to 2023-05-06T07:22:19 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 33 17599 # Exec time 1 2s 24us 10ms 106us 247us 256us 69us # 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 24 515.60k 30 30 30 30 0 30 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us ################ # 1ms # # 10ms # # 100ms # 1s # 10s+ administrator command: Prepare\G # Query 6: 30.74 QPS, 0.02x concurrency, ID 0x57AC6CF9E75AF6673635BEFFE5F2117E at byte 1968894 # Scores: V/M = 0.00 # Time range: 2023-05-06T07:21:03 to 2023-05-06T07:22:13 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 4 2152 # Exec time 0 1s 53us 11ms 564us 3ms 1ms 103us # Lock time 0 4ms 0 259us 1us 1us 5us 1us # Rows sent 1 2.10k 0 1 1.00 0.99 0.02 0.99 # Rows examine 0 2.10k 0 1 1.00 0.99 0.02 0.99 # Query size 5 108.87k 42 57 51.81 56.92 5.86 54.21 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ####################################################### # 100us ################################################################ # 1ms ############## # 10ms # # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'tenant'\G # SHOW CREATE TABLE `isuports`.`tenant`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT * FROM tenant WHERE name = 'x-cktf-27'\G ```

e19192cfa51cc57ee340682b19e722ff6c8fdecb

karamaru-alpha commented 1 year ago

2 3952

kataribe ``` sudo cat /var/log/nginx/access.log | kataribe -f /home/isucon/webapp/kataribe.toml Top 20 Sort By Count Count Total Mean Min Max Request 899 1027.835 1.1433 0.001 10.405 GET /api/player/competition/*/ranking 163 3.188 0.0196 0.001 0.089 GET /api/player/competitions HTTP/2.0 52 0.934 0.0180 0.005 0.049 POST /api/organizer/competitions/add HTTP/2.0 34 0.362 0.0106 0.003 0.054 GET /api/organizer/players HTTP/2.0 32 6.330 0.1978 0.001 1.645 GET /api/organizer/billing HTTP/2.0 11 0.417 0.0379 0.000 0.101 POST /api/admin/tenants/add HTTP/2.0 11 7.045 0.6405 0.005 2.479 GET /api/player/player/9fa5286d HTTP/2.0 11 12.622 1.1475 0.004 3.027 GET /api/player/player/9fa527e6 HTTP/2.0 10 22.377 2.2377 1.326 3.610 POST /api/organizer/players/add HTTP/2.0 10 3.335 0.3335 0.006 1.576 GET /api/player/player/9fa52a8f HTTP/2.0 9 5.825 0.6472 0.004 3.570 GET /api/player/player/9fa527ed HTTP/2.0 9 14.741 1.6379 0.006 3.040 GET /api/player/player/9fa52a93 HTTP/2.0 9 114.051 12.6723 5.403 24.683 GET /api/admin/tenants/billing?before=* 8 1.169 0.1461 0.003 0.496 GET /api/player/player/9fa52913 HTTP/2.0 8 9.510 1.1887 0.002 3.483 GET /api/player/player/9fa5285d HTTP/2.0 8 0.915 0.1144 0.004 0.525 GET /api/player/player/9fa528bd HTTP/2.0 7 2.775 0.3964 0.003 2.342 GET /api/player/player/9fa52966 HTTP/2.0 7 7.331 1.0473 0.004 2.532 GET /api/player/player/9fa52936 HTTP/2.0 7 2.433 0.3476 0.003 2.336 GET /api/player/player/9fa5281e HTTP/2.0 7 2.711 0.3873 0.003 2.055 GET /api/player/player/9fa52994 HTTP/2.0 Top 20 Sort By Total Count Total Mean Min Max Request 899 1027.835 1.1433 0.001 10.405 GET /api/player/competition/*/ranking 9 114.051 12.6723 5.403 24.683 GET /api/admin/tenants/billing?before=* 10 22.377 2.2377 1.326 3.610 POST /api/organizer/players/add HTTP/2.0 3 15.574 5.1913 0.509 7.583 GET /api/player/player/35d06842d HTTP/2.0 9 14.741 1.6379 0.006 3.040 GET /api/player/player/9fa52a93 HTTP/2.0 7 12.900 1.8429 0.004 3.224 GET /api/player/player/9fa52812 HTTP/2.0 11 12.622 1.1475 0.004 3.027 GET /api/player/player/9fa527e6 HTTP/2.0 2 12.292 6.1460 5.007 7.285 GET /api/player/player/24ddeed74 HTTP/2.0 2 11.021 5.5105 0.807 10.214 GET /api/player/player/ccebde97 HTTP/2.0 2 10.818 5.4090 0.553 10.265 GET /api/player/player/239f01572 HTTP/2.0 2 10.555 5.2775 0.332 10.223 GET /api/player/player/2b5a47ac1 HTTP/2.0 2 10.433 5.2165 0.554 9.879 GET /api/player/player/9fa52d89 HTTP/2.0 1 10.213 10.2130 10.213 10.213 POST /api/organizer/competition/9fa544aa/score HTTP/2.0 2 10.176 5.0880 0.356 9.820 GET /api/player/player/9fa52c76 HTTP/2.0 2 10.126 5.0630 0.321 9.805 GET /api/player/player/9fa52dbd HTTP/2.0 7 10.110 1.4443 0.004 2.898 GET /api/player/player/9fa529b1 HTTP/2.0 3 10.101 3.3670 0.031 9.711 GET /api/player/player/9fa52c80 HTTP/2.0 1 10.022 10.0220 10.022 10.022 GET /api/player/player/9fa52d1f HTTP/2.0 1 9.952 9.9520 9.952 9.952 GET /api/player/player/9fa533b4 HTTP/2.0 2 9.933 4.9665 0.023 9.910 GET /api/player/player/2bcb89d29 HTTP/2.0 Top 20 Sort By Mean Count Total Mean Min Max Request 9 114.051 12.6723 5.403 24.683 GET /api/admin/tenants/billing?before=* 1 10.213 10.2130 10.213 10.213 POST /api/organizer/competition/9fa544aa/score HTTP/2.0 1 10.022 10.0220 10.022 10.022 GET /api/player/player/9fa52d1f HTTP/2.0 1 9.952 9.9520 9.952 9.952 GET /api/player/player/9fa533b4 HTTP/2.0 1 9.898 9.8980 9.898 9.898 GET /api/player/player/9fa52ce9 HTTP/2.0 1 9.806 9.8060 9.806 9.806 GET /api/player/player/9fa53a5e HTTP/2.0 1 9.769 9.7690 9.769 9.769 GET /api/player/player/1462706c4 HTTP/2.0 1 9.398 9.3980 9.398 9.398 GET /api/player/player/56be2ebcd HTTP/2.0 1 9.391 9.3910 9.391 9.391 GET /api/player/player/9fa53a9a HTTP/2.0 1 7.729 7.7290 7.729 7.729 GET /api/player/player/9fa53336 HTTP/2.0 1 7.614 7.6140 7.614 7.614 POST /api/organizer/competition/9fa53b1b/score HTTP/2.0 1 7.302 7.3020 7.302 7.302 GET /api/player/player/9fa52d52 HTTP/2.0 1 7.244 7.2440 7.244 7.244 GET /api/player/player/9fa52e31 HTTP/2.0 1 7.227 7.2270 7.227 7.227 GET /api/player/player/9fa52d38 HTTP/2.0 2 12.292 6.1460 5.007 7.285 GET /api/player/player/24ddeed74 HTTP/2.0 2 11.021 5.5105 0.807 10.214 GET /api/player/player/ccebde97 HTTP/2.0 2 10.818 5.4090 0.553 10.265 GET /api/player/player/239f01572 HTTP/2.0 1 5.346 5.3460 5.346 5.346 POST /api/organizer/competition/9fa5340f/score HTTP/2.0 1 5.335 5.3350 5.335 5.335 GET /api/player/player/9fa52ca4 HTTP/2.0 1 5.283 5.2830 5.283 5.283 GET /api/player/player/6049b4b8e HTTP/2.0 Top 20 Sort By Maximum(100 Percentile) Count Total Mean Min Max Request 9 114.051 12.6723 5.403 24.683 GET /api/admin/tenants/billing?before=* 899 1027.835 1.1433 0.001 10.405 GET /api/player/competition/*/ranking 2 10.818 5.4090 0.553 10.265 GET /api/player/player/239f01572 HTTP/2.0 2 10.555 5.2775 0.332 10.223 GET /api/player/player/2b5a47ac1 HTTP/2.0 2 11.021 5.5105 0.807 10.214 GET /api/player/player/ccebde97 HTTP/2.0 1 10.213 10.2130 10.213 10.213 POST /api/organizer/competition/9fa544aa/score HTTP/2.0 1 10.022 10.0220 10.022 10.022 GET /api/player/player/9fa52d1f HTTP/2.0 1 9.952 9.9520 9.952 9.952 GET /api/player/player/9fa533b4 HTTP/2.0 2 9.933 4.9665 0.023 9.910 GET /api/player/player/2bcb89d29 HTTP/2.0 1 9.898 9.8980 9.898 9.898 GET /api/player/player/9fa52ce9 HTTP/2.0 2 10.433 5.2165 0.554 9.879 GET /api/player/player/9fa52d89 HTTP/2.0 2 10.176 5.0880 0.356 9.820 GET /api/player/player/9fa52c76 HTTP/2.0 1 9.806 9.8060 9.806 9.806 GET /api/player/player/9fa53a5e HTTP/2.0 2 10.126 5.0630 0.321 9.805 GET /api/player/player/9fa52dbd HTTP/2.0 1 9.769 9.7690 9.769 9.769 GET /api/player/player/1462706c4 HTTP/2.0 3 10.101 3.3670 0.031 9.711 GET /api/player/player/9fa52c80 HTTP/2.0 2 9.623 4.8115 0.220 9.403 GET /api/player/player/5abe555af HTTP/2.0 1 9.398 9.3980 9.398 9.398 GET /api/player/player/56be2ebcd HTTP/2.0 1 9.391 9.3910 9.391 9.391 GET /api/player/player/9fa53a9a HTTP/2.0 2 8.121 4.0605 0.374 7.747 GET /api/player/player/33f901913 HTTP/2.0 TOP 10 Slow Requests 1 24.683 GET /api/admin/tenants/billing?before=80 HTTP/2.0 2 17.603 GET /api/admin/tenants/billing?before=70 HTTP/2.0 3 14.079 GET /api/admin/tenants/billing?before=56 HTTP/2.0 4 13.924 GET /api/admin/tenants/billing?before=51 HTTP/2.0 5 12.674 GET /api/admin/tenants/billing?before=51 HTTP/2.0 6 10.828 GET /api/admin/tenants/billing?before=100 HTTP/2.0 7 10.405 GET /api/player/competition/9fa52e51/ranking HTTP/2.0 8 10.403 GET /api/player/competition/9fa544aa/ranking HTTP/2.0 9 10.390 GET /api/player/competition/9fa544aa/ranking HTTP/2.0 10 10.362 GET /api/player/competition/9fa544aa/ranking HTTP/2.0 ```
slow-log ``` sudo /home/isucon/webapp/slow.sh /var/log/mysql/slow-query.log # Query 1: 20.31 QPS, 1.63x concurrency, ID 0x676347F321DB8BC7FCB05D4948FC2248 at byte 8638102 # Scores: V/M = 0.07 # Time range: 2023-05-06T09:02:01 to 2023-05-06T09:03:12 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 2 1442 # Exec time 70 116s 164us 472ms 80ms 230ms 72ms 56ms # Lock time 0 3ms 1us 38us 1us 2us 1us 1us # Rows sent 96 107.30k 0 199 76.20 174.84 51.58 62.76 # Rows examine 88 24.07M 0 49.19k 17.10k 40.32k 12.59k 13.13k # Query size 9 201.32k 141 144 142.97 136.99 0.69 136.99 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us #### # 1ms ############# # 10ms ################################################################ # 100ms ###################################### # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT player_id, MIN(created_at) AS min_created_at FROM visit_history WHERE tenant_id = 71 AND competition_id = '1d98db4b8' GROUP BY player_id\G # Query 2: 177.73 QPS, 0.54x concurrency, ID 0x94A9E43DFAAFA029A1FC19A5563AD0F5 at byte 88870 # Scores: V/M = 0.00 # Time range: 2023-05-06T09:02:01 to 2023-05-06T09:03:12 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 22 12619 # Exec time 23 38s 526us 69ms 3ms 8ms 2ms 2ms # Lock time 97 601ms 0 8ms 47us 247us 259us 1us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 0 0 0 0 0 0 0 0 # Query size 25 554.55k 45 45 45 45 0 45 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us ##### # 1ms ################################################################ # 10ms # # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'id_generator'\G # SHOW CREATE TABLE `isuports`.`id_generator`\G REPLACE INTO id_generator (stub) VALUES ('a')\G # Query 3: 13.25 QPS, 0.05x concurrency, ID 0x2E69352DE16B15042A1217500A0400FE at byte 12215204 # Scores: V/M = 0.00 # Time range: 2023-05-06T09:02:03 to 2023-05-06T09:03:10 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 1 888 # Exec time 2 3s 534us 18ms 4ms 9ms 3ms 3ms # Lock time 0 2ms 1us 426us 2us 1us 17us 1us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 0 0 0 0 0 0 0 0 # Query size 5 129.10k 148 150 148.87 143.84 0 143.84 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # # 1ms ################################################################ # 10ms ## # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G INSERT INTO visit_history (player_id, tenant_id, competition_id, created_at, updated_at) VALUES ('9fa52ded', 23, '528c3d86f', 1683363789, 1683363789)\G # Query 4: 0 QPS, 0x concurrency, ID 0x3289E87E94D5A82E348974B3D332E575 at byte 662 # Scores: V/M = 0.00 # Time range: all events occurred at 2023-05-06T09:02:00 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 1 # Exec time 1 2s 2s 2s 2s 2s 0 2s # Lock time 0 7us 7us 7us 7us 7us 0 7us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 11 3.08M 3.08M 3.08M 3.08M 3.08M 0 3.08M # Query size 0 58 58 58 58 58 0 58 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s ################################################################ # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G DELETE FROM visit_history WHERE created_at >= '1654041600'\G # Converted for EXPLAIN # EXPLAIN /*!50100 PARTITIONS*/ select * from visit_history WHERE created_at >= '1654041600'\G # Query 5: 256.32 QPS, 0.03x concurrency, ID 0xDA556F9115773A1A99AA0165670CE848 at byte 6114766 # Scores: V/M = 0.00 # Time range: 2023-05-06T09:02:01 to 2023-05-06T09:03:12 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 33 18199 # Exec time 1 2s 24us 17ms 117us 247us 357us 73us # 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 24 533.17k 30 30 30 30 0 30 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us ################### # 1ms # # 10ms # # 100ms # 1s # 10s+ administrator command: Prepare\G # Query 6: 34.13 QPS, 0.02x concurrency, ID 0x57AC6CF9E75AF6673635BEFFE5F2117E at byte 7854873 # Scores: V/M = 0.00 # Time range: 2023-05-06T09:02:01 to 2023-05-06T09:03:10 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 4 2355 # Exec time 0 1s 46us 15ms 611us 3ms 1ms 113us # Lock time 0 5ms 0 332us 1us 2us 7us 1us # Rows sent 2 2.30k 0 1 1.00 0.99 0.02 0.99 # Rows examine 0 2.30k 0 1 1.00 0.99 0.02 0.99 # Query size 5 122.41k 42 58 53.23 56.92 5.18 51.63 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ######################################### # 100us ################################################################ # 1ms ############## # 10ms # # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'tenant'\G # SHOW CREATE TABLE `isuports`.`tenant`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT * FROM tenant WHERE name = 'j-p-98'\G ```

7cb5fa0504d4c8be19894a6927d81a4a24f95a19

karamaru-alpha commented 1 year ago

3 5021

kataribe ``` sudo cat /var/log/nginx/access.log | kataribe -f /home/isucon/webapp/kataribe.toml Top 20 Sort By Count Count Total Mean Min Max Request 1266 1832.955 1.4478 0.002 30.001 GET /api/player/competition/*/ranking 227 4.100 0.0181 0.001 0.112 GET /api/player/competitions HTTP/2.0 67 0.999 0.0149 0.006 0.034 POST /api/organizer/competitions/add HTTP/2.0 49 0.475 0.0097 0.001 0.047 GET /api/organizer/players HTTP/2.0 40 16.921 0.4230 0.001 13.472 GET /api/organizer/billing HTTP/2.0 36 74.897 2.0805 0.001 25.271 GET /api/admin/tenants/billing?before=* 12 0.467 0.0389 0.001 0.124 POST /api/admin/tenants/add HTTP/2.0 11 21.360 1.9418 1.085 2.914 POST /api/organizer/players/add HTTP/2.0 10 16.472 1.6472 0.013 8.739 GET /api/player/player/4852bf676 HTTP/2.0 10 10.801 1.0801 0.024 4.817 GET /api/player/player/2c23c345f HTTP/2.0 9 28.854 3.2060 0.014 10.810 GET /api/player/player/24f8d60db HTTP/2.0 8 14.731 1.8414 0.047 4.076 GET /api/player/player/9fa52b0c HTTP/2.0 7 13.001 1.8573 0.046 10.821 GET /api/player/player/27aaa3698 HTTP/2.0 7 5.915 0.8450 0.014 3.555 GET /api/player/player/9fa5299b HTTP/2.0 7 12.173 1.7390 0.042 9.089 GET /api/player/player/ddab48c3 HTTP/2.0 7 5.477 0.7824 0.022 4.073 GET /api/player/player/e389aa47 HTTP/2.0 7 7.071 1.0101 0.035 3.904 GET /api/player/player/520a0690e HTTP/2.0 7 11.519 1.6456 0.264 6.498 GET /api/player/player/16bd26dcc HTTP/2.0 6 7.129 1.1882 0.008 4.063 GET /api/player/player/9fa527dc HTTP/2.0 6 5.885 0.9808 0.006 3.403 GET /api/player/player/9fa52af5 HTTP/2.0 Top 20 Sort By Total Count Total Mean Min Max Request 1266 1832.955 1.4478 0.002 30.001 GET /api/player/competition/*/ranking 36 74.897 2.0805 0.001 25.271 GET /api/admin/tenants/billing?before=* 1 30.001 30.0010 30.001 30.001 GET /api/player/player/60c68847f HTTP/2.0 1 30.001 30.0010 30.001 30.001 GET /api/player/player/39f900e51 HTTP/2.0 1 29.746 29.7460 29.746 29.746 POST /initialize HTTP/2.0 9 28.854 3.2060 0.014 10.810 GET /api/player/player/24f8d60db HTTP/2.0 1 25.860 25.8600 25.860 25.860 GET /api/player/player/5e5f38c04 HTTP/2.0 6 25.286 4.2143 0.019 10.132 GET /api/player/player/15b3e3271 HTTP/2.0 1 21.773 21.7730 21.773 21.773 GET /api/player/player/5f72fc770 HTTP/2.0 11 21.360 1.9418 1.085 2.914 POST /api/organizer/players/add HTTP/2.0 1 19.435 19.4350 19.435 19.435 GET /api/player/player/60894c070 HTTP/2.0 3 17.097 5.6990 0.395 10.752 GET /api/player/player/9fa52d74 HTTP/2.0 40 16.921 0.4230 0.001 13.472 GET /api/organizer/billing HTTP/2.0 10 16.472 1.6472 0.013 8.739 GET /api/player/player/4852bf676 HTTP/2.0 1 15.765 15.7650 15.765 15.765 GET /api/player/player/6173e90d8 HTTP/2.0 5 15.035 3.0070 0.079 8.808 GET /api/player/player/420ffe3d0 HTTP/2.0 8 14.731 1.8414 0.047 4.076 GET /api/player/player/9fa52b0c HTTP/2.0 5 13.487 2.6974 2.227 3.272 GET /api/player/player/9fa528b2 HTTP/2.0 7 13.001 1.8573 0.046 10.821 GET /api/player/player/27aaa3698 HTTP/2.0 5 12.828 2.5656 0.020 3.805 GET /api/player/player/9fa52ac8 HTTP/2.0 Top 20 Sort By Mean Count Total Mean Min Max Request 1 30.001 30.0010 30.001 30.001 GET /api/player/player/60c68847f HTTP/2.0 1 30.001 30.0010 30.001 30.001 GET /api/player/player/39f900e51 HTTP/2.0 1 29.746 29.7460 29.746 29.746 POST /initialize HTTP/2.0 1 25.860 25.8600 25.860 25.860 GET /api/player/player/5e5f38c04 HTTP/2.0 1 21.773 21.7730 21.773 21.773 GET /api/player/player/5f72fc770 HTTP/2.0 1 19.435 19.4350 19.435 19.435 GET /api/player/player/60894c070 HTTP/2.0 1 15.765 15.7650 15.765 15.765 GET /api/player/player/6173e90d8 HTTP/2.0 1 12.636 12.6360 12.636 12.636 GET /api/player/player/61fc1ac6c HTTP/2.0 1 10.975 10.9750 10.975 10.975 GET /api/player/player/61d799135 HTTP/2.0 1 10.947 10.9470 10.947 10.947 GET /api/player/competition/34b2de1fd/ranking HTTP/2.0 1 10.899 10.8990 10.899 10.899 GET /api/player/player/9fa53ce9 HTTP/2.0 1 10.853 10.8530 10.853 10.853 GET /api/player/player/9fa52d9b HTTP/2.0 1 10.824 10.8240 10.824 10.824 POST /api/organizer/competition/9fa54acf/score HTTP/2.0 1 10.480 10.4800 10.480 10.480 GET /api/player/player/9fa52d3c HTTP/2.0 1 9.613 9.6130 9.613 9.613 GET /api/player/player/9fa531df HTTP/2.0 1 9.506 9.5060 9.506 9.506 GET /api/player/competition/3cb2f0c1d/ranking HTTP/2.0 1 8.944 8.9440 8.944 8.944 GET /api/player/player/9fa5322a HTTP/2.0 1 8.884 8.8840 8.884 8.884 GET /api/player/player/9fa531d0 HTTP/2.0 1 8.688 8.6880 8.688 8.688 GET /api/player/player/9fa52d7e HTTP/2.0 1 8.375 8.3750 8.375 8.375 GET /api/player/player/9fa52cef HTTP/2.0 Top 20 Sort By Maximum(100 Percentile) Count Total Mean Min Max Request 1 30.001 30.0010 30.001 30.001 GET /api/player/player/39f900e51 HTTP/2.0 1 30.001 30.0010 30.001 30.001 GET /api/player/player/60c68847f HTTP/2.0 1266 1832.955 1.4478 0.002 30.001 GET /api/player/competition/*/ranking 1 29.746 29.7460 29.746 29.746 POST /initialize HTTP/2.0 1 25.860 25.8600 25.860 25.860 GET /api/player/player/5e5f38c04 HTTP/2.0 36 74.897 2.0805 0.001 25.271 GET /api/admin/tenants/billing?before=* 1 21.773 21.7730 21.773 21.773 GET /api/player/player/5f72fc770 HTTP/2.0 1 19.435 19.4350 19.435 19.435 GET /api/player/player/60894c070 HTTP/2.0 1 15.765 15.7650 15.765 15.765 GET /api/player/player/6173e90d8 HTTP/2.0 40 16.921 0.4230 0.001 13.472 GET /api/organizer/billing HTTP/2.0 1 12.636 12.6360 12.636 12.636 GET /api/player/player/61fc1ac6c HTTP/2.0 1 10.975 10.9750 10.975 10.975 GET /api/player/player/61d799135 HTTP/2.0 1 10.947 10.9470 10.947 10.947 GET /api/player/competition/34b2de1fd/ranking HTTP/2.0 1 10.899 10.8990 10.899 10.899 GET /api/player/player/9fa53ce9 HTTP/2.0 1 10.853 10.8530 10.853 10.853 GET /api/player/player/9fa52d9b HTTP/2.0 1 10.824 10.8240 10.824 10.824 POST /api/organizer/competition/9fa54acf/score HTTP/2.0 7 13.001 1.8573 0.046 10.821 GET /api/player/player/27aaa3698 HTTP/2.0 9 28.854 3.2060 0.014 10.810 GET /api/player/player/24f8d60db HTTP/2.0 3 17.097 5.6990 0.395 10.752 GET /api/player/player/9fa52d74 HTTP/2.0 1 10.480 10.4800 10.480 10.480 GET /api/player/player/9fa52d3c HTTP/2.0 TOP 10 Slow Requests 1 30.001 GET /api/player/player/60c68847f HTTP/2.0 2 30.001 GET /api/player/player/39f900e51 HTTP/2.0 3 30.001 GET /api/player/competition/9fa5366d/ranking?rank_after=69 HTTP/2.0 4 29.746 POST /initialize HTTP/2.0 5 25.860 GET /api/player/player/5e5f38c04 HTTP/2.0 6 25.271 GET /api/admin/tenants/billing?before=8 HTTP/2.0 7 21.872 GET /api/player/competition/9fa5366d/ranking HTTP/2.0 8 21.773 GET /api/player/player/5f72fc770 HTTP/2.0 9 21.670 GET /api/player/competition/9fa5366d/ranking HTTP/2.0 10 21.414 GET /api/player/competition/9fa5366d/ranking HTTP/2.0 ```
slow-log ``` sudo /home/isucon/webapp/slow.sh /var/log/mysql/slow-query.log # Query 1: 249.10 QPS, 0.51x concurrency, ID 0x94A9E43DFAAFA029A1FC19A5563AD0F5 at byte 11828 # Scores: V/M = 0.00 # Time range: 2023-05-06T11:47:08 to 2023-05-06T11:48:15 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 20 16690 # Exec time 48 34s 540us 32ms 2ms 4ms 1ms 2ms # Lock time 76 53ms 0 6ms 3us 1us 49us 1us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 0 0 0 0 0 0 0 0 # Query size 21 733.45k 45 45 45 45 0 45 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us ############## # 1ms ################################################################ # 10ms # # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'id_generator'\G # SHOW CREATE TABLE `isuports`.`id_generator`\G REPLACE INTO id_generator (stub) VALUES ('a')\G # Query 2: 0 QPS, 0x concurrency, ID 0x85A1E0277FB850F363193D628CE05650 at byte 1933 # Scores: V/M = 0.00 # Time range: all events occurred at 2023-05-06T11:47:08 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 1 # Exec time 38 27s 27s 27s 27s 27s 0 27s # Lock time 0 2us 2us 2us 2us 2us 0 2us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 45 3.08M 3.08M 3.08M 3.08M 3.08M 0 3.08M # Query size 0 174 174 174 174 174 0 174 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s # 10s+ ################################################################ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G INSERT INTO `latest_visit_history` SELECT tenant_id, competition_id, player_id, MIN(created_at) AS created_at FROM visit_history GROUP BY player_id, tenant_id, competition_id\G # Query 3: 19.18 QPS, 0.04x concurrency, ID 0x717868DB0FF4601C650032A81060D41E at byte 9487462 # Scores: V/M = 0.00 # Time range: 2023-05-06T11:47:10 to 2023-05-06T11:48:16 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 1 1266 # Exec time 4 3s 92us 22ms 2ms 4ms 2ms 2ms # Lock time 2 2ms 0 20us 1us 1us 1us 1us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 0 0 0 0 0 0 0 0 # Query size 6 224.89k 181 183 181.90 174.84 0 174.84 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # # 100us ####### # 1ms ################################################################ # 10ms # # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G INSERT INTO latest_visit_history (player_id, tenant_id, competition_id, created_at) VALUES ('9fa5387f', 214, '9fa54238', 1683373658) ON DUPLICATE KEY UPDATE `created_at` = 1683373658\G # Query 4: 0 QPS, 0x concurrency, ID 0x3289E87E94D5A82E348974B3D332E575 at byte 662 # Scores: V/M = 0.00 # Time range: all events occurred at 2023-05-06T11:46:41 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 1 # Exec time 3 2s 2s 2s 2s 2s 0 2s # Lock time 0 6us 6us 6us 6us 6us 0 6us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 45 3.08M 3.08M 3.08M 3.08M 3.08M 0 3.08M # Query size 0 58 58 58 58 58 0 58 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s ################################################################ # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G DELETE FROM visit_history WHERE created_at >= '1654041600'\G # Converted for EXPLAIN # EXPLAIN /*!50100 PARTITIONS*/ select * from visit_history WHERE created_at >= '1654041600'\G # Query 5: 324.59 QPS, 0.02x concurrency, ID 0xDA556F9115773A1A99AA0165670CE848 at byte 11667019 # Scores: V/M = 0.00 # Time range: 2023-05-06T11:47:08 to 2023-05-06T11:48:31 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 32 26941 # Exec time 2 2s 20us 9ms 58us 84us 61us 49us # 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 23 789.29k 30 30 30 30 0 30 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us ## # 1ms # # 10ms # 100ms # 1s # 10s+ administrator command: Prepare\G # Query 6: 54.95 QPS, 0.02x concurrency, ID 0x731A1F4786F770DE31CE879DB79AA27F at byte 20107197 # Scores: V/M = 0.00 # Time range: 2023-05-06T11:47:08 to 2023-05-06T11:48:31 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 5 4561 # Exec time 2 1s 117us 9ms 320us 403us 531us 236us # Lock time 9 7ms 0 109us 1us 1us 2us 1us # Rows sent 98 640.07k 0 4.88k 143.70 183.58 495.82 76.28 # Rows examine 9 640.07k 0 4.88k 143.70 183.58 495.82 76.28 # Query size 16 560.86k 124 127 125.92 124.25 0.58 124.25 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us ################################################################ # 1ms # # 10ms # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT player_id, created_at AS min_created_at FROM latest_visit_history WHERE tenant_id = 1 AND competition_id = '547f03113'\G ```

ce9cea7af4a3a3da2b9dd13df23358f35bc139db

karamaru-alpha commented 1 year ago

4 6790

kataribe ``` sudo cat /var/log/nginx/access.log | kataribe -f /home/isucon/webapp/kataribe.toml Top 20 Sort By Count Count Total Mean Min Max Request 2357 310.392 0.1317 0.001 5.400 GET /api/player/competition/*/ranking 639 35.814 0.0560 0.001 2.244 GET /api/player/competitions HTTP/2.0 54 2.337 0.0433 0.007 0.280 POST /api/organizer/competitions/add HTTP/2.0 40 1.662 0.0415 0.003 0.207 GET /api/organizer/players HTTP/2.0 33 29.618 0.8975 0.002 25.341 GET /api/organizer/billing HTTP/2.0 28 90.412 3.2290 0.010 9.605 GET /api/admin/tenants/billing?before=* 18 1.454 0.0808 0.005 0.299 GET /api/player/player/9fa52ad6 HTTP/2.0 16 1.607 0.1004 0.002 0.291 GET /api/player/player/9fa52967 HTTP/2.0 15 1.899 0.1266 0.007 0.472 GET /api/player/player/9fa52942 HTTP/2.0 15 1.217 0.0811 0.005 0.246 GET /api/player/player/9fa52a0d HTTP/2.0 15 1.498 0.0999 0.002 0.231 GET /api/player/player/9fa52b08 HTTP/2.0 13 1.686 0.1297 0.010 0.391 GET /api/player/player/9fa5287e HTTP/2.0 13 1.591 0.1224 0.007 0.433 GET /api/player/player/9fa529ed HTTP/2.0 13 1.037 0.0798 0.002 0.274 GET /api/player/player/9fa52a6b HTTP/2.0 13 1.660 0.1277 0.005 0.496 GET /api/player/player/9fa529c5 HTTP/2.0 13 0.985 0.0758 0.002 0.328 GET /api/player/player/9fa52982 HTTP/2.0 13 0.838 0.0645 0.018 0.175 GET /api/player/player/9fa52b1f HTTP/2.0 13 0.487 0.0375 0.001 0.111 GET /api/player/player/9fa52aec HTTP/2.0 12 0.897 0.0747 0.005 0.167 GET /api/player/player/9fa5294c HTTP/2.0 12 0.567 0.0473 0.000 0.139 POST /api/admin/tenants/add HTTP/2.0 Top 20 Sort By Total Count Total Mean Min Max Request 2357 310.392 0.1317 0.001 5.400 GET /api/player/competition/*/ranking 28 90.412 3.2290 0.010 9.605 GET /api/admin/tenants/billing?before=* 2 60.002 30.0010 30.001 30.001 GET /api/player/player/613877c54 HTTP/2.0 10 46.452 4.6452 1.180 20.334 POST /api/organizer/players/add HTTP/2.0 639 35.814 0.0560 0.001 2.244 GET /api/player/competitions HTTP/2.0 1 30.001 30.0010 30.001 30.001 GET /api/player/player/60fea5853 HTTP/2.0 1 30.001 30.0010 30.001 30.001 GET /api/player/player/630057df8 HTTP/2.0 1 30.000 30.0000 30.000 30.000 GET /api/player/player/14a0be22f HTTP/2.0 33 29.618 0.8975 0.002 25.341 GET /api/organizer/billing HTTP/2.0 1 29.121 29.1210 29.121 29.121 POST /initialize HTTP/2.0 1 10.215 10.2150 10.215 10.215 POST /api/organizer/competition/9fa541e1/score HTTP/2.0 7 7.776 1.1109 0.219 2.469 GET /api/player/player/4b9e917a8 HTTP/2.0 5 7.088 1.4176 0.879 1.836 GET /api/player/player/9fa52dda HTTP/2.0 4 6.471 1.6178 1.408 1.870 GET /api/player/player/9fa52c6e HTTP/2.0 1 6.244 6.2440 6.244 6.244 POST /api/organizer/competition/9fa55280/score HTTP/2.0 1 6.028 6.0280 6.028 6.028 POST /api/organizer/competition/9fa539e5/score HTTP/2.0 1 6.018 6.0180 6.018 6.018 GET /api/player/competition/547f03113/ranking HTTP/2.0 5 5.735 1.1470 0.217 2.518 GET /api/player/player/f6de172e HTTP/2.0 1 5.385 5.3850 5.385 5.385 POST /api/organizer/competition/9fa54317/score HTTP/2.0 5 5.150 1.0300 0.191 1.708 GET /api/player/player/46d243ac0 HTTP/2.0 Top 20 Sort By Mean Count Total Mean Min Max Request 1 30.001 30.0010 30.001 30.001 GET /api/player/player/630057df8 HTTP/2.0 2 60.002 30.0010 30.001 30.001 GET /api/player/player/613877c54 HTTP/2.0 1 30.001 30.0010 30.001 30.001 GET /api/player/player/60fea5853 HTTP/2.0 1 30.000 30.0000 30.000 30.000 GET /api/player/player/14a0be22f HTTP/2.0 1 29.121 29.1210 29.121 29.121 POST /initialize HTTP/2.0 1 10.215 10.2150 10.215 10.215 POST /api/organizer/competition/9fa541e1/score HTTP/2.0 1 6.244 6.2440 6.244 6.244 POST /api/organizer/competition/9fa55280/score HTTP/2.0 1 6.028 6.0280 6.028 6.028 POST /api/organizer/competition/9fa539e5/score HTTP/2.0 1 6.018 6.0180 6.018 6.018 GET /api/player/competition/547f03113/ranking HTTP/2.0 1 5.385 5.3850 5.385 5.385 POST /api/organizer/competition/9fa54317/score HTTP/2.0 1 4.992 4.9920 4.992 4.992 POST /api/organizer/competition/9fa554a0/score HTTP/2.0 10 46.452 4.6452 1.180 20.334 POST /api/organizer/players/add HTTP/2.0 1 4.512 4.5120 4.512 4.512 POST /api/organizer/competition/9fa548f8/score HTTP/2.0 1 4.432 4.4320 4.432 4.432 POST /api/organizer/competition/9fa55083/score HTTP/2.0 1 4.193 4.1930 4.193 4.193 POST /api/organizer/competition/9fa54271/score HTTP/2.0 1 4.008 4.0080 4.008 4.008 POST /api/organizer/competition/9fa54735/score HTTP/2.0 1 3.663 3.6630 3.663 3.663 POST /api/organizer/competition/9fa54cbc/score HTTP/2.0 1 3.493 3.4930 3.493 3.493 POST /api/organizer/competition/9fa53ebe/score HTTP/2.0 1 3.483 3.4830 3.483 3.483 POST /api/organizer/competition/9fa53eb6/score HTTP/2.0 28 90.412 3.2290 0.010 9.605 GET /api/admin/tenants/billing?before=* Top 20 Sort By Maximum(100 Percentile) Count Total Mean Min Max Request 2 60.002 30.0010 30.001 30.001 GET /api/player/player/613877c54 HTTP/2.0 1 30.001 30.0010 30.001 30.001 GET /api/player/player/60fea5853 HTTP/2.0 1 30.001 30.0010 30.001 30.001 GET /api/player/player/630057df8 HTTP/2.0 1 30.000 30.0000 30.000 30.000 GET /api/player/player/14a0be22f HTTP/2.0 1 29.121 29.1210 29.121 29.121 POST /initialize HTTP/2.0 33 29.618 0.8975 0.002 25.341 GET /api/organizer/billing HTTP/2.0 10 46.452 4.6452 1.180 20.334 POST /api/organizer/players/add HTTP/2.0 1 10.215 10.2150 10.215 10.215 POST /api/organizer/competition/9fa541e1/score HTTP/2.0 28 90.412 3.2290 0.010 9.605 GET /api/admin/tenants/billing?before=* 1 6.244 6.2440 6.244 6.244 POST /api/organizer/competition/9fa55280/score HTTP/2.0 1 6.028 6.0280 6.028 6.028 POST /api/organizer/competition/9fa539e5/score HTTP/2.0 1 6.018 6.0180 6.018 6.018 GET /api/player/competition/547f03113/ranking HTTP/2.0 2357 310.392 0.1317 0.001 5.400 GET /api/player/competition/*/ranking 1 5.385 5.3850 5.385 5.385 POST /api/organizer/competition/9fa54317/score HTTP/2.0 1 4.992 4.9920 4.992 4.992 POST /api/organizer/competition/9fa554a0/score HTTP/2.0 1 4.512 4.5120 4.512 4.512 POST /api/organizer/competition/9fa548f8/score HTTP/2.0 1 4.432 4.4320 4.432 4.432 POST /api/organizer/competition/9fa55083/score HTTP/2.0 1 4.193 4.1930 4.193 4.193 POST /api/organizer/competition/9fa54271/score HTTP/2.0 1 4.008 4.0080 4.008 4.008 POST /api/organizer/competition/9fa54735/score HTTP/2.0 1 3.663 3.6630 3.663 3.663 POST /api/organizer/competition/9fa54cbc/score HTTP/2.0 TOP 10 Slow Requests 1 30.001 GET /api/player/player/613877c54 HTTP/2.0 2 30.001 GET /api/player/player/60fea5853 HTTP/2.0 3 30.001 GET /api/player/player/630057df8 HTTP/2.0 4 30.001 GET /api/player/player/613877c54 HTTP/2.0 5 30.000 GET /api/player/player/14a0be22f HTTP/2.0 6 29.121 POST /initialize HTTP/2.0 7 25.341 GET /api/organizer/billing HTTP/2.0 8 20.334 POST /api/organizer/players/add HTTP/2.0 9 10.215 POST /api/organizer/competition/9fa541e1/score HTTP/2.0 10 9.605 GET /api/admin/tenants/billing?before=10 HTTP/2.0 ```
slow-log ``` sudo /home/isucon/webapp/slow.sh /var/log/mysql/slow-query.log # Query 1: 208.40 QPS, 0.45x concurrency, ID 0x94A9E43DFAAFA029A1FC19A5563AD0F5 at byte 8922167 # Scores: V/M = 0.00 # Time range: 2023-05-06T12:52:34 to 2023-05-06T12:53:42 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 16 14171 # Exec time 45 31s 537us 31ms 2ms 4ms 1ms 2ms # Lock time 73 68ms 0 6ms 4us 2us 52us 1us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 0 0 0 0 0 0 0 0 # Query size 17 622.75k 45 45 45 45 0 45 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us ######### # 1ms ################################################################ # 10ms # # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'id_generator'\G # SHOW CREATE TABLE `isuports`.`id_generator`\G REPLACE INTO id_generator (stub) VALUES ('a')\G # Query 2: 0 QPS, 0x concurrency, ID 0x85A1E0277FB850F363193D628CE05650 at byte 1933 # Scores: V/M = 0.00 # Time range: all events occurred at 2023-05-06T12:52:33 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 1 # Exec time 38 26s 26s 26s 26s 26s 0 26s # Lock time 0 5us 5us 5us 5us 5us 0 5us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 46 3.08M 3.08M 3.08M 3.08M 3.08M 0 3.08M # Query size 0 174 174 174 174 174 0 174 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s # 10s+ ################################################################ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G INSERT INTO `latest_visit_history` SELECT tenant_id, competition_id, player_id, MIN(created_at) AS created_at FROM visit_history GROUP BY player_id, tenant_id, competition_id\G # Query 3: 37 QPS, 0.07x concurrency, ID 0x717868DB0FF4601C650032A81060D41E at byte 6767102 # Scores: V/M = 0.00 # Time range: 2023-05-06T12:52:35 to 2023-05-06T12:53:39 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 2 2368 # Exec time 6 4s 75us 14ms 2ms 3ms 1ms 2ms # Lock time 4 4ms 0 34us 1us 1us 1us 1us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 0 0 0 0 0 0 0 0 # Query size 11 420.60k 181 183 181.88 174.84 0 174.84 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # # 100us ################## # 1ms ################################################################ # 10ms # # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G INSERT INTO latest_visit_history (player_id, tenant_id, competition_id, created_at) VALUES ('9fa5349c', 21, '161b13288', 1683377572) ON DUPLICATE KEY UPDATE `created_at` = 1683377572\G # Query 4: 0 QPS, 0x concurrency, ID 0x3289E87E94D5A82E348974B3D332E575 at byte 662 # Scores: V/M = 0.00 # Time range: all events occurred at 2023-05-06T12:52:07 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 1 # Exec time 3 2s 2s 2s 2s 2s 0 2s # Lock time 0 6us 6us 6us 6us 6us 0 6us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 46 3.08M 3.08M 3.08M 3.08M 3.08M 0 3.08M # Query size 0 58 58 58 58 58 0 58 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s ################################################################ # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G DELETE FROM visit_history WHERE created_at >= '1654041600'\G # Converted for EXPLAIN # EXPLAIN /*!50100 PARTITIONS*/ select * from visit_history WHERE created_at >= '1654041600'\G # Query 5: 380.19 QPS, 0.03x concurrency, ID 0xDA556F9115773A1A99AA0165670CE848 at byte 9858244 # Scores: V/M = 0.00 # Time range: 2023-05-06T12:52:34 to 2023-05-06T12:53:48 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 32 28134 # Exec time 2 2s 22us 4ms 65us 108us 64us 54us # 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 22 824.24k 30 30 30 30 0 30 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us #### # 1ms # # 10ms # 100ms # 1s # 10s+ administrator command: Prepare\G # Query 6: 47.65 QPS, 0.02x concurrency, ID 0x731A1F4786F770DE31CE879DB79AA27F at byte 17010971 # Scores: V/M = 0.00 # Time range: 2023-05-06T12:52:34 to 2023-05-06T12:53:48 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 4 3526 # Exec time 1 1s 127us 6ms 339us 445us 491us 260us # Lock time 6 6ms 0 252us 1us 2us 4us 1us # Rows sent 97 470.60k 0 4.88k 136.67 183.58 461.04 80.10 # Rows examine 6 470.60k 0 4.88k 136.67 183.58 461.04 80.10 # Query size 11 433.66k 124 127 125.94 124.25 0.51 124.25 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us ################################################################ # 1ms # # 10ms # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT player_id, created_at AS min_created_at FROM latest_visit_history WHERE tenant_id = 1 AND competition_id = '597488a14'\G ```

572e6c1cdd52d578a562e2c0e296618db357ad64

karamaru-alpha commented 1 year ago

5 8365

kataribe ``` sudo cat /var/log/nginx/access.log | kataribe -f /home/isucon/webapp/kataribe.toml Top 20 Sort By Count Count Total Mean Min Max Request 427 40.522 0.0949 0.001 0.977 GET /api/player/competitions HTTP/2.0 87 6.870 0.0790 0.007 0.213 GET /api/player/competition/01GZRK1PW8XF3DFY8NNTDT8Q0D/ranking HTTP/2.0 73 15.801 0.2165 0.006 1.759 GET /api/player/competition/01GZRK13VE50XKK1H7AF2R4BF2/ranking HTTP/2.0 69 16.953 0.2457 0.005 1.503 GET /api/player/competition/01GZRK15QR9SQ19XEN0DYPAA7Z/ranking HTTP/2.0 65 15.574 0.2396 0.006 1.230 GET /api/player/competition/01GZRK17S6R9E1K6TEHS0Z5X04/ranking HTTP/2.0 64 8.269 0.1292 0.005 2.197 POST /api/organizer/competitions/add HTTP/2.0 62 18.432 0.2973 0.007 1.315 GET /api/player/competition/01GZRK1EVDBEABD6EQCANQNPXC/ranking HTTP/2.0 57 17.240 0.3025 0.006 1.801 GET /api/player/competition/01GZRK19T3CYYVGJJ31E2N6RM6/ranking HTTP/2.0 55 17.646 0.3208 0.013 2.492 GET /api/player/competition/01GZRK1GK4RCHS7337J2A4ZRKA/ranking HTTP/2.0 54 16.397 0.3036 0.014 1.241 GET /api/player/competition/01GZRK18F0MJ3X9945AHCRR9EY/ranking HTTP/2.0 53 6.470 0.1221 0.002 1.170 GET /api/organizer/players HTTP/2.0 53 17.590 0.3319 0.008 2.848 GET /api/player/competition/01GZRK1E06WF49RWY787AK89CN/ranking HTTP/2.0 52 14.173 0.2726 0.006 1.731 GET /api/player/competition/01GZRK1BRTB22R2R5D0GJWV659/ranking HTTP/2.0 52 18.237 0.3507 0.012 3.634 GET /api/player/competition/01GZRK1G398WCAVZS8S7Z3S4H0/ranking HTTP/2.0 50 0.536 0.0107 0.004 0.038 GET /api/player/competition/01GZRK19X5FDH09CEP0QT2XTXX/ranking HTTP/2.0 49 16.082 0.3282 0.015 1.249 GET /api/player/competition/01GZRK1JV44DCT1HN0HVC5BTH6/ranking HTTP/2.0 49 17.629 0.3598 0.009 2.052 GET /api/player/competition/01GZRK1BHZE25K38X7RRAHD06R/ranking HTTP/2.0 48 16.522 0.3442 0.006 2.583 GET /api/player/competition/01GZRK11ZFA0D6FWYB8HHB7BYH/ranking HTTP/2.0 48 14.292 0.2978 0.024 1.372 GET /api/player/competition/01GZRK1N5397FTEQ9JHEKCPTSH/ranking HTTP/2.0 46 15.130 0.3289 0.009 1.559 GET /api/player/competition/01GZRK157FHNHHD51T28N7PF9A/ranking HTTP/2.0 Top 20 Sort By Total Count Total Mean Min Max Request 23 102.690 4.4648 0.001 25.757 GET /api/admin/tenants/billing?before=* 22 60.831 2.7650 1.762 3.607 GET /api/player/competition/01GZRK1D2CQ03WHNN29Q57M5G7/ranking HTTP/2.0 45 59.012 1.3114 0.002 30.000 GET /api/organizer/billing HTTP/2.0 13 44.410 3.4162 0.830 19.986 POST /api/organizer/players/add HTTP/2.0 427 40.522 0.0949 0.001 0.977 GET /api/player/competitions HTTP/2.0 1 30.001 30.0010 30.001 30.001 GET /api/player/player/617a0119e HTTP/2.0 1 30.001 30.0010 30.001 30.001 GET /api/player/player/5e9efc01f HTTP/2.0 1 30.001 30.0010 30.001 30.001 GET /api/player/player/6275ba089 HTTP/2.0 1 30.000 30.0000 30.000 30.000 GET /api/player/player/62dd704f0 HTTP/2.0 1 29.213 29.2130 29.213 29.213 POST /initialize HTTP/2.0 39 26.774 0.6865 0.203 1.691 GET /api/player/competition/01GZRK20TRESEN40VZMPFNHQWM/ranking HTTP/2.0 36 24.110 0.6697 0.212 2.737 GET /api/player/competition/01GZRK21GVHTX7MAC1BHHREF06/ranking HTTP/2.0 30 21.835 0.7278 0.202 2.048 GET /api/player/competition/01GZRK2757C5AGA3N4Z6G8KMEE/ranking HTTP/2.0 37 21.524 0.5817 0.069 3.599 GET /api/player/competition/01GZRK1ZMR0QFEDQXM6PFC2BX6/ranking HTTP/2.0 11 19.179 1.7435 1.186 1.981 GET /api/player/competition/01GZRK2S0MDDB9WF1KHM602R42/ranking HTTP/2.0 62 18.432 0.2973 0.007 1.315 GET /api/player/competition/01GZRK1EVDBEABD6EQCANQNPXC/ranking HTTP/2.0 43 18.336 0.4264 0.028 2.982 GET /api/player/competition/01GZRK1W9C1VQ7J8Y8MC7152BH/ranking HTTP/2.0 52 18.237 0.3507 0.012 3.634 GET /api/player/competition/01GZRK1G398WCAVZS8S7Z3S4H0/ranking HTTP/2.0 44 18.205 0.4137 0.037 1.887 GET /api/player/competition/01GZRK1QNX2VG6B7FTGPJHCA3Z/ranking HTTP/2.0 44 17.907 0.4070 0.028 1.322 GET /api/player/competition/01GZRK1SWMQD52450S7ZVS4M0V/ranking HTTP/2.0 Top 20 Sort By Mean Count Total Mean Min Max Request 1 30.001 30.0010 30.001 30.001 GET /api/player/player/5e9efc01f HTTP/2.0 1 30.001 30.0010 30.001 30.001 GET /api/player/player/6275ba089 HTTP/2.0 1 30.001 30.0010 30.001 30.001 GET /api/player/player/617a0119e HTTP/2.0 1 30.000 30.0000 30.000 30.000 GET /api/player/player/62dd704f0 HTTP/2.0 1 29.213 29.2130 29.213 29.213 POST /initialize HTTP/2.0 1 8.831 8.8310 8.831 8.831 GET /api/player/competition/59cb9aad2/ranking HTTP/2.0 23 102.690 4.4648 0.001 25.757 GET /api/admin/tenants/billing?before=* 13 44.410 3.4162 0.830 19.986 POST /api/organizer/players/add HTTP/2.0 1 2.970 2.9700 2.970 2.970 POST /api/organizer/competition/01GZRK1D2CQ03WHNN29Q57M5G7/score HTTP/2.0 22 60.831 2.7650 1.762 3.607 GET /api/player/competition/01GZRK1D2CQ03WHNN29Q57M5G7/ranking HTTP/2.0 1 2.750 2.7500 2.750 2.750 GET /api/player/competition/01GZRK2ANMAAFPNZJ3KYC1VW4Y/ranking?rank_after=94 HTTP/2.0 1 2.404 2.4040 2.404 2.404 GET /api/player/competition/01GZRK1G398WCAVZS8S7Z3S4H0/ranking?rank_after=60 HTTP/2.0 1 2.376 2.3760 2.376 2.376 GET /api/player/player/01GZRK17GJQ6X9TY388388TW8J HTTP/2.0 1 2.355 2.3550 2.355 2.355 GET /api/player/player/01GZRK1BBJNJ5PBR3V8BQF7S72 HTTP/2.0 1 2.202 2.2020 2.202 2.202 POST /api/organizer/competition/01GZRK1D2CQ03WHNN29Q57M5G7/finish HTTP/2.0 1 2.163 2.1630 2.163 2.163 POST /api/organizer/competition/01GZRK20TRESEN40VZMPFNHQWM/score HTTP/2.0 1 2.107 2.1070 2.107 2.107 GET /api/player/player/01GZRK17JC4ZKWT9T5NR54V6BM HTTP/2.0 1 2.084 2.0840 2.084 2.084 GET /api/player/competition/01GZRK1D2CQ03WHNN29Q57M5G7/ranking?rank_after=89 HTTP/2.0 2 4.158 2.0790 1.488 2.670 GET /api/player/player/01GZRK1BG7ZQDNKKFFMGT8D5EH HTTP/2.0 1 1.991 1.9910 1.991 1.991 POST /api/organizer/competition/01GZRK2S0MDDB9WF1KHM602R42/score HTTP/2.0 Top 20 Sort By Maximum(100 Percentile) Count Total Mean Min Max Request 1 30.001 30.0010 30.001 30.001 GET /api/player/player/5e9efc01f HTTP/2.0 1 30.001 30.0010 30.001 30.001 GET /api/player/player/6275ba089 HTTP/2.0 1 30.001 30.0010 30.001 30.001 GET /api/player/player/617a0119e HTTP/2.0 1 30.000 30.0000 30.000 30.000 GET /api/player/player/62dd704f0 HTTP/2.0 45 59.012 1.3114 0.002 30.000 GET /api/organizer/billing HTTP/2.0 1 29.213 29.2130 29.213 29.213 POST /initialize HTTP/2.0 23 102.690 4.4648 0.001 25.757 GET /api/admin/tenants/billing?before=* 13 44.410 3.4162 0.830 19.986 POST /api/organizer/players/add HTTP/2.0 1 8.831 8.8310 8.831 8.831 GET /api/player/competition/59cb9aad2/ranking HTTP/2.0 52 18.237 0.3507 0.012 3.634 GET /api/player/competition/01GZRK1G398WCAVZS8S7Z3S4H0/ranking HTTP/2.0 22 60.831 2.7650 1.762 3.607 GET /api/player/competition/01GZRK1D2CQ03WHNN29Q57M5G7/ranking HTTP/2.0 37 21.524 0.5817 0.069 3.599 GET /api/player/competition/01GZRK1ZMR0QFEDQXM6PFC2BX6/ranking HTTP/2.0 3 5.337 1.7790 0.664 3.308 GET /api/player/player/01GZRK17XQDC87E28AHKK2X508 HTTP/2.0 5 6.218 1.2436 0.489 3.120 GET /api/player/player/3afd0360f HTTP/2.0 4 7.711 1.9278 0.569 3.104 GET /api/player/player/01GZRK17H2H7MZZSCVE1XE1DND HTTP/2.0 2 3.300 1.6500 0.249 3.051 GET /api/player/player/01GZRK1F8TJ0Q39B06SFH4Q39R HTTP/2.0 5 5.446 1.0892 0.016 3.000 GET /api/player/player/29d0f735a HTTP/2.0 43 18.336 0.4264 0.028 2.982 GET /api/player/competition/01GZRK1W9C1VQ7J8Y8MC7152BH/ranking HTTP/2.0 1 2.970 2.9700 2.970 2.970 POST /api/organizer/competition/01GZRK1D2CQ03WHNN29Q57M5G7/score HTTP/2.0 36 16.768 0.4658 0.037 2.873 GET /api/player/competition/01GZRK1YCWGYSCJ5YMXJAW0RWF/ranking HTTP/2.0 TOP 10 Slow Requests 1 30.001 GET /api/player/player/6275ba089 HTTP/2.0 2 30.001 GET /api/player/player/617a0119e HTTP/2.0 3 30.001 GET /api/player/player/5e9efc01f HTTP/2.0 4 30.000 GET /api/organizer/billing HTTP/2.0 5 30.000 GET /api/player/player/62dd704f0 HTTP/2.0 6 29.213 POST /initialize HTTP/2.0 7 25.757 GET /api/admin/tenants/billing?before=57 HTTP/2.0 8 19.986 POST /api/organizer/players/add HTTP/2.0 9 17.914 GET /api/admin/tenants/billing?before=68 HTTP/2.0 10 15.412 GET /api/admin/tenants/billing?before=78 HTTP/2.0 ```
slow-log ``` sudo /home/isucon/webapp/slow.sh /var/log/mysql/slow-query.log # Query 1: 0 QPS, 0x concurrency, ID 0x85A1E0277FB850F363193D628CE05650 at byte 1933 # Scores: V/M = 0.00 # Time range: all events occurred at 2023-05-06T13:11:37 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 1 # Exec time 70 26s 26s 26s 26s 26s 0 26s # Lock time 0 8us 8us 8us 8us 8us 0 8us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 46 3.08M 3.08M 3.08M 3.08M 3.08M 0 3.08M # Query size 0 174 174 174 174 174 0 174 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s # 10s+ ################################################################ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G INSERT INTO `latest_visit_history` SELECT tenant_id, competition_id, player_id, MIN(created_at) AS created_at FROM visit_history GROUP BY player_id, tenant_id, competition_id\G # Query 2: 33.34 QPS, 0.08x concurrency, ID 0x717868DB0FF4601C650032A81060D41E at byte 542318 # Scores: V/M = 0.00 # Time range: 2023-05-06T13:11:38 to 2023-05-06T13:12:43 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 4 2167 # Exec time 13 5s 94us 42ms 2ms 4ms 3ms 2ms # Lock time 13 3ms 0 34us 1us 1us 1us 1us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 0 0 0 0 0 0 0 0 # Query size 20 456.94k 182 218 215.92 212.52 6.25 212.52 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # # 100us ###### # 1ms ################################################################ # 10ms # # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G INSERT INTO latest_visit_history (player_id, tenant_id, competition_id, created_at) VALUES ('2cc2d109c', 53, '01GZRK12V59MQBBSG4PJ7DM00F', 1683378703) ON DUPLICATE KEY UPDATE `created_at` = 1683378703\G # Query 3: 0 QPS, 0x concurrency, ID 0x3289E87E94D5A82E348974B3D332E575 at byte 662 # Scores: V/M = 0.00 # Time range: all events occurred at 2023-05-06T13:11:10 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 1 # Exec time 6 2s 2s 2s 2s 2s 0 2s # Lock time 0 10us 10us 10us 10us 10us 0 10us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 46 3.08M 3.08M 3.08M 3.08M 3.08M 0 3.08M # Query size 0 58 58 58 58 58 0 58 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s ################################################################ # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G DELETE FROM visit_history WHERE created_at >= '1654041600'\G # Converted for EXPLAIN # EXPLAIN /*!50100 PARTITIONS*/ select * from visit_history WHERE created_at >= '1654041600'\G # Query 4: 202.01 QPS, 0.01x concurrency, ID 0xDA556F9115773A1A99AA0165670CE848 at byte 4920543 # Scores: V/M = 0.00 # Time range: 2023-05-06T13:11:37 to 2023-05-06T13:12:48 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 32 14343 # Exec time 2 1s 27us 2ms 70us 93us 43us 60us # 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 420.21k 30 30 30 30 0 30 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us ### # 1ms # # 10ms # 100ms # 1s # 10s+ administrator command: Prepare\G # Query 5: 43.86 QPS, 0.01x concurrency, ID 0x731A1F4786F770DE31CE879DB79AA27F at byte 6149030 # Scores: V/M = 0.00 # Time range: 2023-05-06T13:11:37 to 2023-05-06T13:12:48 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 7 3114 # Exec time 2 970ms 116us 6ms 311us 403us 495us 236us # Lock time 18 5ms 1us 22us 1us 1us 0 1us # Rows sent 97 429.48k 0 4.88k 141.23 183.58 490.12 76.28 # Rows examine 6 429.48k 0 4.88k 141.23 183.58 490.12 76.28 # Query size 17 388.30k 124 144 127.69 143.84 5.58 124.25 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us ################################################################ # 1ms # # 10ms # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT player_id, created_at AS min_created_at FROM latest_visit_history WHERE tenant_id = 1 AND competition_id = '5d5e808a3'\G # Query 6: 104.35 QPS, 0.01x concurrency, ID 0x57AC6CF9E75AF6673635BEFFE5F2117E at byte 3074880 # Scores: V/M = 0.00 # Time range: 2023-05-06T13:11:37 to 2023-05-06T13:12:43 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 15 6887 # Exec time 1 718ms 54us 3ms 104us 144us 65us 93us # Lock time 50 12ms 1us 151us 1us 1us 3us 1us # Rows sent 1 6.72k 0 1 1.00 0.99 0.01 0.99 # Rows examine 0 6.72k 0 1 1.00 0.99 0.01 0.99 # Query size 16 366.96k 42 58 54.56 56.92 4.28 54.21 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us ###################################### # 1ms # # 10ms # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'tenant'\G # SHOW CREATE TABLE `isuports`.`tenant`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT * FROM tenant WHERE name = 'bawvk-tppxi-1683378702'\G ```

fc8b017317883ea63a595c6cfe51258b1172742c

karamaru-alpha commented 1 year ago

6 6443

kataribe ``` sudo cat /var/log/nginx/access.log | kataribe -f /home/isucon/webapp/kataribe.toml Top 20 Sort By Count Count Total Mean Min Max Request 1753 771.926 0.4403 0.001 15.302 GET /api/player/competition/*/ranking 355 59.256 0.1669 0.001 4.563 GET /api/player/competitions HTTP/2.0 62 6.124 0.0988 0.004 1.941 POST /api/organizer/competitions/add HTTP/2.0 48 6.176 0.1287 0.002 2.005 GET /api/organizer/players HTTP/2.0 40 17.584 0.4396 0.002 3.799 GET /api/organizer/billing HTTP/2.0 25 4.697 0.1879 0.003 1.337 GET /api/player/player/01GZRS0SDQ1M1SVWR4WN9QCTYV HTTP/2.0 22 91.548 4.1613 0.018 25.338 GET /api/admin/tenants/billing?before=* 22 5.851 0.2660 0.019 1.287 GET /api/player/player/01GZRS0SDHFRSMZSECT2K8YDPN HTTP/2.0 21 3.811 0.1815 0.002 0.519 GET /api/player/player/01GZRS0RH7VR7TQTHB2QHKCPBX HTTP/2.0 21 4.342 0.2068 0.001 0.630 GET /api/player/player/01GZRS0RR8QDG22FXVSPN5D6X8 HTTP/2.0 20 4.899 0.2450 0.003 1.150 GET /api/player/player/01GZRS0REVZ09GR86HEGM35MGJ HTTP/2.0 20 2.343 0.1172 0.001 0.282 GET /api/player/player/01GZRS0RSDADJNN61HN06ZRDQJ HTTP/2.0 20 3.585 0.1792 0.002 1.419 GET /api/player/player/01GZRS0S0P35TX48QQSCGZWDGK HTTP/2.0 20 3.478 0.1739 0.002 0.893 GET /api/player/player/01GZRS0RXB1FPJ654F21XSPRK5 HTTP/2.0 20 3.626 0.1813 0.003 0.567 GET /api/player/player/01GZRS0SF8P0C1CASC2G3XBHD3 HTTP/2.0 20 5.632 0.2816 0.003 1.330 GET /api/player/player/01GZRS0SKAVNY5240MMFBJP2NC HTTP/2.0 20 3.171 0.1586 0.006 0.689 GET /api/player/player/01GZRS0SKHBY948XXPCFXWN589 HTTP/2.0 19 4.765 0.2508 0.008 0.816 GET /api/player/player/01GZRS0RTH7EFA32ZHDP6XN6EK HTTP/2.0 19 2.990 0.1574 0.002 0.604 GET /api/player/player/01GZRS0SHHSHR944NQWQQE17W8 HTTP/2.0 19 1.661 0.0874 0.009 0.403 GET /api/player/player/01GZRS0RR19ZGK7544XPFWW0SQ HTTP/2.0 Top 20 Sort By Total Count Total Mean Min Max Request 1753 771.926 0.4403 0.001 15.302 GET /api/player/competition/*/ranking 22 91.548 4.1613 0.018 25.338 GET /api/admin/tenants/billing?before=* 2 59.307 29.6535 29.323 29.984 POST /initialize HTTP/2.0 355 59.256 0.1669 0.001 4.563 GET /api/player/competitions HTTP/2.0 12 39.023 3.2519 0.864 20.879 POST /api/organizer/players/add HTTP/2.0 5 19.358 3.8716 0.803 7.941 GET /api/player/player/8e31371f HTTP/2.0 40 17.584 0.4396 0.002 3.799 GET /api/organizer/billing HTTP/2.0 4 14.677 3.6692 1.645 7.346 GET /api/player/player/4947848c3 HTTP/2.0 4 13.841 3.4602 1.079 5.951 GET /api/player/player/39b5b16f6 HTTP/2.0 3 13.356 4.4520 2.714 5.621 GET /api/player/player/01GZRS1700AX26P64V5RXN5JZA HTTP/2.0 4 12.717 3.1793 1.054 7.565 GET /api/player/player/3eba34e26 HTTP/2.0 3 12.602 4.2007 3.227 5.256 GET /api/player/player/01GZRS0VAZYW6XKRVQZZPD815S HTTP/2.0 4 12.336 3.0840 2.004 5.784 GET /api/player/player/38bc6bf61 HTTP/2.0 2 12.043 6.0215 5.210 6.833 GET /api/player/player/01GZRS126GEQWPGHHCKKY9NP2Z HTTP/2.0 3 12.026 4.0087 1.419 7.049 GET /api/player/player/01GZRS0TGA8DSKASFPGPQXAYGZ HTTP/2.0 2 11.230 5.6150 4.052 7.178 GET /api/player/player/01GZRS0YJRQXHSK9ETEKK8MKQ3 HTTP/2.0 3 10.788 3.5960 0.293 5.346 GET /api/player/player/01GZRS0V9Q3QRX7VWY4CDX0A1V HTTP/2.0 1 10.716 10.7160 10.716 10.716 GET /api/player/player/4058ac68c HTTP/2.0 3 10.362 3.4540 2.609 4.950 GET /api/player/player/01GZRS1224B5GYTJEWRGPXSM0P HTTP/2.0 3 10.324 3.4413 1.510 5.123 GET /api/player/player/6172c8f5f HTTP/2.0 Top 20 Sort By Mean Count Total Mean Min Max Request 2 59.307 29.6535 29.323 29.984 POST /initialize HTTP/2.0 1 10.716 10.7160 10.716 10.716 GET /api/player/player/4058ac68c HTTP/2.0 1 10.259 10.2590 10.259 10.259 POST /api/organizer/competition/01GZRS1TCXEP0RZG7AWTKCAB72/score HTTP/2.0 1 9.877 9.8770 9.877 9.877 GET /api/player/player/bac5dfb6 HTTP/2.0 1 9.542 9.5420 9.542 9.542 GET /api/player/player/4c40c9cc2 HTTP/2.0 1 7.866 7.8660 7.866 7.866 GET /api/player/player/01GZRS16X3Y5MEAE8PTPXTMHA6 HTTP/2.0 1 7.463 7.4630 7.463 7.463 GET /api/player/player/01GZRS0YEF2SFZQTBAS1GHYCAJ HTTP/2.0 1 7.071 7.0710 7.071 7.071 GET /api/player/player/8467e006 HTTP/2.0 1 6.872 6.8720 6.872 6.872 GET /api/player/player/4a1824be5 HTTP/2.0 1 6.845 6.8450 6.845 6.845 GET /api/player/player/01GZRS0V5YRB4FT7HP4YSJ6SNV HTTP/2.0 1 6.844 6.8440 6.844 6.844 GET /api/player/player/01GZRS0TXA0XRYPMQGFPBG8RPP HTTP/2.0 1 6.766 6.7660 6.766 6.766 GET /api/player/player/01GZRS0XYA8K63ZHN5XWTXZCDY HTTP/2.0 1 6.715 6.7150 6.715 6.715 GET /api/player/player/01GZRS0YN5TKBDM1WQ6JB7T4VB HTTP/2.0 1 6.580 6.5800 6.580 6.580 GET /api/player/player/60b22be15 HTTP/2.0 1 6.477 6.4770 6.477 6.477 GET /api/player/player/01GZRS0TNTYTRT4PAW773ZG7NQ HTTP/2.0 1 6.329 6.3290 6.329 6.329 GET /api/player/player/01GZRS0TG19DBX41BC77FJGXTB HTTP/2.0 1 6.160 6.1600 6.160 6.160 GET /api/player/player/01GZRS0Y8MYKW6457NDKCHJZSW HTTP/2.0 1 6.098 6.0980 6.098 6.098 GET /api/player/player/50e0d2974 HTTP/2.0 2 12.043 6.0215 5.210 6.833 GET /api/player/player/01GZRS126GEQWPGHHCKKY9NP2Z HTTP/2.0 1 5.991 5.9910 5.991 5.991 GET /api/player/player/01GZRS1FAFBH9JNJZYMDM3HK86 HTTP/2.0 Top 20 Sort By Maximum(100 Percentile) Count Total Mean Min Max Request 2 59.307 29.6535 29.323 29.984 POST /initialize HTTP/2.0 22 91.548 4.1613 0.018 25.338 GET /api/admin/tenants/billing?before=* 12 39.023 3.2519 0.864 20.879 POST /api/organizer/players/add HTTP/2.0 1753 771.926 0.4403 0.001 15.302 GET /api/player/competition/*/ranking 1 10.716 10.7160 10.716 10.716 GET /api/player/player/4058ac68c HTTP/2.0 1 10.259 10.2590 10.259 10.259 POST /api/organizer/competition/01GZRS1TCXEP0RZG7AWTKCAB72/score HTTP/2.0 1 9.877 9.8770 9.877 9.877 GET /api/player/player/bac5dfb6 HTTP/2.0 1 9.542 9.5420 9.542 9.542 GET /api/player/player/4c40c9cc2 HTTP/2.0 5 19.358 3.8716 0.803 7.941 GET /api/player/player/8e31371f HTTP/2.0 1 7.866 7.8660 7.866 7.866 GET /api/player/player/01GZRS16X3Y5MEAE8PTPXTMHA6 HTTP/2.0 4 12.717 3.1793 1.054 7.565 GET /api/player/player/3eba34e26 HTTP/2.0 2 8.244 4.1220 0.683 7.561 GET /api/player/player/01GZRS0TMY6EJXY8KNB7KMYXWR HTTP/2.0 1 7.463 7.4630 7.463 7.463 GET /api/player/player/01GZRS0YEF2SFZQTBAS1GHYCAJ HTTP/2.0 4 14.677 3.6692 1.645 7.346 GET /api/player/player/4947848c3 HTTP/2.0 2 11.230 5.6150 4.052 7.178 GET /api/player/player/01GZRS0YJRQXHSK9ETEKK8MKQ3 HTTP/2.0 1 7.071 7.0710 7.071 7.071 GET /api/player/player/8467e006 HTTP/2.0 3 12.026 4.0087 1.419 7.049 GET /api/player/player/01GZRS0TGA8DSKASFPGPQXAYGZ HTTP/2.0 2 8.823 4.4115 1.873 6.950 GET /api/player/player/01GZRS0TRE6X2P1KFWQHETCF87 HTTP/2.0 2 9.330 4.6650 2.420 6.910 GET /api/player/player/17d1eae9a HTTP/2.0 1 6.872 6.8720 6.872 6.872 GET /api/player/player/4a1824be5 HTTP/2.0 TOP 10 Slow Requests 1 29.984 POST /initialize HTTP/2.0 2 29.323 POST /initialize HTTP/2.0 3 25.338 GET /api/admin/tenants/billing?before=10 HTTP/2.0 4 20.879 POST /api/organizer/players/add HTTP/2.0 5 19.225 GET /api/admin/tenants/billing?before=98 HTTP/2.0 6 19.159 GET /api/admin/tenants/billing?before=70 HTTP/2.0 7 15.302 GET /api/player/competition/59cb9aad2/ranking HTTP/2.0 8 14.969 GET /api/player/competition/e018c687/ranking HTTP/2.0 9 14.140 GET /api/player/competition/597488a14/ranking HTTP/2.0 10 10.716 GET /api/player/player/4058ac68c HTTP/2.0 ```
slow-log ``` sudo /home/isucon/webapp/slow.sh /var/log/mysql/slow-query.log # Query 1: 0.01 QPS, 0.40x concurrency, ID 0x85A1E0277FB850F363193D628CE05650 at byte 1933 # Scores: V/M = 0.01 # Time range: 2023-05-06T14:54:03 to 2023-05-06T14:56:18 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 2 # Exec time 82 54s 27s 27s 27s 27s 475ms 27s # Lock time 0 9us 4us 5us 4us 5us 0 4us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 48 6.15M 3.08M 3.08M 3.08M 3.08M 0 3.08M # Query size 0 348 174 174 174 174 0 174 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s # 10s+ ################################################################ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G INSERT INTO `latest_visit_history` SELECT tenant_id, competition_id, player_id, MIN(created_at) AS created_at FROM visit_history GROUP BY player_id, tenant_id, competition_id\G # Query 2: 0.01 QPS, 0.04x concurrency, ID 0x3289E87E94D5A82E348974B3D332E575 at byte 662 # Scores: V/M = 0.00 # Time range: 2023-05-06T14:53:35 to 2023-05-06T14:55:52 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 2 # Exec time 7 5s 2s 2s 2s 2s 27ms 2s # Lock time 0 6us 1us 5us 3us 5us 2us 3us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 48 6.15M 3.08M 3.08M 3.08M 3.08M 0 3.08M # Query size 0 116 58 58 58 58 0 58 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s ################################################################ # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G DELETE FROM visit_history WHERE created_at >= '1654041600'\G # Converted for EXPLAIN # EXPLAIN /*!50100 PARTITIONS*/ select * from visit_history WHERE created_at >= '1654041600'\G # Query 3: 27.22 QPS, 0.07x concurrency, ID 0x717868DB0FF4601C650032A81060D41E at byte 453084 # Scores: V/M = 0.00 # Time range: 2023-05-06T14:56:20 to 2023-05-06T14:57:24 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 4 1742 # Exec time 6 4s 85us 31ms 2ms 4ms 2ms 2ms # Lock time 12 3ms 0 21us 1us 1us 1us 1us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 0 0 0 0 0 0 0 0 # Query size 19 366.35k 181 218 215.35 212.52 7.15 212.52 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # # 100us ###### # 1ms ################################################################ # 10ms # # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G INSERT INTO latest_visit_history (player_id, tenant_id, competition_id, created_at) VALUES ('60b536b2e', 15, '01GZRS0R99Q8HK902BX40HDK49', 1683384984) ON DUPLICATE KEY UPDATE `created_at` = 1683384984\G # Query 4: 45.64 QPS, 0.01x concurrency, ID 0x731A1F4786F770DE31CE879DB79AA27F at byte 3529057 # Scores: V/M = 0.00 # Time range: 2023-05-06T14:56:19 to 2023-05-06T14:57:26 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 8 3058 # Exec time 1 863ms 119us 18ms 282us 384us 491us 224us # Lock time 21 5ms 0 29us 1us 1us 1us 1us # Rows sent 97 328.91k 0 4.88k 110.14 174.84 352.99 72.65 # Rows examine 2 328.91k 0 4.88k 110.14 174.84 352.99 72.65 # Query size 20 381.45k 124 144 127.73 143.84 5.68 124.25 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us ################################################################ # 1ms # # 10ms # # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT player_id, created_at AS min_created_at FROM latest_visit_history WHERE tenant_id = 1 AND competition_id = '45c0c2910'\G # Query 5: 177.39 QPS, 0.01x concurrency, ID 0xDA556F9115773A1A99AA0165670CE848 at byte 3342414 # Scores: V/M = 0.00 # Time range: 2023-05-06T14:56:19 to 2023-05-06T14:57:26 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 32 11885 # Exec time 1 851ms 30us 3ms 71us 98us 64us 63us # 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 18 348.19k 30 30 30 30 0 30 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us ### # 1ms # # 10ms # 100ms # 1s # 10s+ administrator command: Prepare\G # Query 6: 82.08 QPS, 0.01x concurrency, ID 0x57AC6CF9E75AF6673635BEFFE5F2117E at byte 8616953 # Scores: V/M = 0.00 # Time range: 2023-05-06T14:56:19 to 2023-05-06T14:57:24 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 14 5335 # Exec time 0 561ms 55us 4ms 105us 152us 72us 93us # Lock time 50 11ms 0 749us 1us 2us 10us 1us # Rows sent 1 5.21k 0 1 1.00 0.99 0.01 0.99 # Rows examine 0 5.21k 0 1 1.00 0.99 0.01 0.99 # Query size 15 292.47k 42 59 56.14 56.92 4.18 56.92 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us ####################################### # 1ms # # 10ms # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'tenant'\G # SHOW CREATE TABLE `isuports`.`tenant`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT * FROM tenant WHERE name = 'y-koxhe-1683385018'\G ```

726c845536e89098055ca22da437440e951b9d7d

karamaru-alpha commented 1 year ago

7 5814

kataribe ``` sudo cat /var/log/nginx/access.log | kataribe -f /home/isucon/webapp/kataribe.toml Top 20 Sort By Count Count Total Mean Min Max Request 2539 1778.181 0.7003 0.001 9.741 GET /api/player/player/* 1665 893.863 0.5369 0.001 18.611 GET /api/player/competition/*/ranking 319 57.025 0.1788 0.001 4.963 GET /api/player/competitions HTTP/2.0 70 27.143 0.3878 0.001 9.011 POST /api/organizer/competition/*/score 56 6.844 0.1222 0.002 2.861 POST /api/organizer/competitions/add HTTP/2.0 49 8.377 0.1710 0.002 3.923 POST /api/organizer/competition/*/finish 45 4.397 0.0977 0.002 0.860 GET /api/organizer/players HTTP/2.0 35 27.321 0.7806 0.002 8.916 GET /api/organizer/billing HTTP/2.0 21 94.846 4.5165 0.002 21.402 GET /api/admin/tenants/billing?before=* 12 0.885 0.0737 0.001 0.311 POST /api/organizer/player/*/disqualified 12 0.771 0.0643 0.000 0.165 POST /api/admin/tenants/add HTTP/2.0 11 28.740 2.6127 1.056 7.357 POST /api/organizer/players/add HTTP/2.0 2 4.725 2.3625 0.251 4.474 GET /api/admin/tenants/billing HTTP/2.0 2 59.688 29.8440 29.680 30.008 POST /initialize HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 Top 20 Sort By Total Count Total Mean Min Max Request 2539 1778.181 0.7003 0.001 9.741 GET /api/player/player/* 1665 893.863 0.5369 0.001 18.611 GET /api/player/competition/*/ranking 21 94.846 4.5165 0.002 21.402 GET /api/admin/tenants/billing?before=* 2 59.688 29.8440 29.680 30.008 POST /initialize HTTP/2.0 319 57.025 0.1788 0.001 4.963 GET /api/player/competitions HTTP/2.0 11 28.740 2.6127 1.056 7.357 POST /api/organizer/players/add HTTP/2.0 35 27.321 0.7806 0.002 8.916 GET /api/organizer/billing HTTP/2.0 70 27.143 0.3878 0.001 9.011 POST /api/organizer/competition/*/score 49 8.377 0.1710 0.002 3.923 POST /api/organizer/competition/*/finish 56 6.844 0.1222 0.002 2.861 POST /api/organizer/competitions/add HTTP/2.0 2 4.725 2.3625 0.251 4.474 GET /api/admin/tenants/billing HTTP/2.0 45 4.397 0.0977 0.002 0.860 GET /api/organizer/players HTTP/2.0 12 0.885 0.0737 0.001 0.311 POST /api/organizer/player/*/disqualified 12 0.771 0.0643 0.000 0.165 POST /api/admin/tenants/add HTTP/2.0 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 Top 20 Sort By Mean Count Total Mean Min Max Request 2 59.688 29.8440 29.680 30.008 POST /initialize HTTP/2.0 21 94.846 4.5165 0.002 21.402 GET /api/admin/tenants/billing?before=* 11 28.740 2.6127 1.056 7.357 POST /api/organizer/players/add HTTP/2.0 2 4.725 2.3625 0.251 4.474 GET /api/admin/tenants/billing HTTP/2.0 35 27.321 0.7806 0.002 8.916 GET /api/organizer/billing HTTP/2.0 2539 1778.181 0.7003 0.001 9.741 GET /api/player/player/* 1665 893.863 0.5369 0.001 18.611 GET /api/player/competition/*/ranking 70 27.143 0.3878 0.001 9.011 POST /api/organizer/competition/*/score 319 57.025 0.1788 0.001 4.963 GET /api/player/competitions HTTP/2.0 49 8.377 0.1710 0.002 3.923 POST /api/organizer/competition/*/finish 56 6.844 0.1222 0.002 2.861 POST /api/organizer/competitions/add HTTP/2.0 45 4.397 0.0977 0.002 0.860 GET /api/organizer/players HTTP/2.0 12 0.885 0.0737 0.001 0.311 POST /api/organizer/player/*/disqualified 12 0.771 0.0643 0.000 0.165 POST /api/admin/tenants/add HTTP/2.0 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 Top 20 Sort By Maximum(100 Percentile) Count Total Mean Min Max Request 2 59.688 29.8440 29.680 30.008 POST /initialize HTTP/2.0 21 94.846 4.5165 0.002 21.402 GET /api/admin/tenants/billing?before=* 1665 893.863 0.5369 0.001 18.611 GET /api/player/competition/*/ranking 2539 1778.181 0.7003 0.001 9.741 GET /api/player/player/* 70 27.143 0.3878 0.001 9.011 POST /api/organizer/competition/*/score 35 27.321 0.7806 0.002 8.916 GET /api/organizer/billing HTTP/2.0 11 28.740 2.6127 1.056 7.357 POST /api/organizer/players/add HTTP/2.0 319 57.025 0.1788 0.001 4.963 GET /api/player/competitions HTTP/2.0 2 4.725 2.3625 0.251 4.474 GET /api/admin/tenants/billing HTTP/2.0 49 8.377 0.1710 0.002 3.923 POST /api/organizer/competition/*/finish 56 6.844 0.1222 0.002 2.861 POST /api/organizer/competitions/add HTTP/2.0 45 4.397 0.0977 0.002 0.860 GET /api/organizer/players HTTP/2.0 12 0.885 0.0737 0.001 0.311 POST /api/organizer/player/*/disqualified 12 0.771 0.0643 0.000 0.165 POST /api/admin/tenants/add HTTP/2.0 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 TOP 10 Slow Requests 1 30.008 POST /initialize HTTP/2.0 2 29.680 POST /initialize HTTP/2.0 3 21.402 GET /api/admin/tenants/billing?before=10 HTTP/2.0 4 20.872 GET /api/admin/tenants/billing?before=98 HTTP/2.0 5 18.611 GET /api/player/competition/1a0205203/ranking HTTP/2.0 6 17.559 GET /api/admin/tenants/billing?before=68 HTTP/2.0 7 16.201 GET /api/player/competition/1a0205203/ranking HTTP/2.0 8 9.741 GET /api/player/player/01GZT9CDPFH4R5Q1PYMGQRWB01 HTTP/2.0 9 9.592 GET /api/player/competition/01GZT9DC3V55R0JJAAY93XTH5P/ranking HTTP/2.0 10 9.406 GET /api/player/player/8aa26b2c HTTP/2.0 ```
slow-log ``` sudo /home/isucon/webapp/slow.sh /var/log/mysql/slow-query.log # Query 1: 0.06 QPS, 1.66x concurrency, ID 0x85A1E0277FB850F363193D628CE05650 at byte 1933 # Scores: V/M = 0.00 # Time range: 2023-05-07T05:00:57 to 2023-05-07T05:01:29 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 2 # Exec time 78 53s 27s 27s 27s 27s 12ms 27s # Lock time 0 11us 4us 7us 5us 7us 2us 5us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 48 6.15M 3.08M 3.08M 3.08M 3.08M 0 3.08M # Query size 0 348 174 174 174 174 0 174 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s # 10s+ ################################################################ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G INSERT INTO `latest_visit_history` SELECT tenant_id, competition_id, player_id, MIN(created_at) AS created_at FROM visit_history GROUP BY player_id, tenant_id, competition_id\G # Query 2: 0.06 QPS, 0.20x concurrency, ID 0x3289E87E94D5A82E348974B3D332E575 at byte 662 # Scores: V/M = 0.36 # Time range: 2023-05-07T05:00:30 to 2023-05-07T05:01:02 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 2 # Exec time 9 6s 2s 4s 3s 4s 1s 3s # Lock time 0 11us 1us 10us 5us 10us 6us 5us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 48 6.15M 3.08M 3.08M 3.08M 3.08M 0 3.08M # Query size 0 116 58 58 58 58 0 58 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s ################################################################ # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G DELETE FROM visit_history WHERE created_at >= '1654041600'\G # Converted for EXPLAIN # EXPLAIN /*!50100 PARTITIONS*/ select * from visit_history WHERE created_at >= '1654041600'\G # Query 3: 25.45 QPS, 0.09x concurrency, ID 0x717868DB0FF4601C650032A81060D41E at byte 1520915 # Scores: V/M = 0.01 # Time range: 2023-05-07T05:01:30 to 2023-05-07T05:02:35 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 4 1654 # Exec time 8 6s 99us 166ms 3ms 6ms 6ms 3ms # Lock time 13 3ms 1us 155us 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 20 347.87k 182 218 215.37 212.52 7.07 212.52 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us ### # 1ms ################################################################ # 10ms # # 100ms # # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G INSERT INTO latest_visit_history (player_id, tenant_id, competition_id, created_at) VALUES ('01GZT9CB6SR3CBG6B9R1TJ9RE6', 284, '01GZT9CG547S7ANPXNP4TKBPEN', 1683435700) ON DUPLICATE KEY UPDATE `created_at` = 1683435700\G # Query 4: 40.90 QPS, 0.01x concurrency, ID 0x731A1F4786F770DE31CE879DB79AA27F at byte 8194148 # Scores: V/M = 0.00 # Time range: 2023-05-07T05:01:29 to 2023-05-07T05:02:37 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 8 2781 # Exec time 1 865ms 118us 6ms 310us 445us 404us 247us # Lock time 22 4ms 1us 20us 1us 2us 0 1us # Rows sent 97 340.24k 0 4.88k 125.28 174.84 369.01 92.72 # Rows examine 2 340.24k 0 4.88k 125.28 174.84 369.01 92.72 # Query size 20 346.47k 124 144 127.57 143.84 5.43 124.25 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us ################################################################ # 1ms # # 10ms # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT player_id, created_at AS min_created_at FROM latest_visit_history WHERE tenant_id = 65 AND competition_id = '445c41edb'\G # Query 5: 160.28 QPS, 0.01x concurrency, ID 0xDA556F9115773A1A99AA0165670CE848 at byte 8234556 # Scores: V/M = 0.00 # Time range: 2023-05-07T05:01:29 to 2023-05-07T05:02:37 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 32 10899 # Exec time 1 823ms 31us 2ms 75us 119us 47us 63us # 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 18 319.31k 30 30 30 30 0 30 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us ######## # 1ms # # 10ms # 100ms # 1s # 10s+ administrator command: Prepare\G # Query 6: 73.88 QPS, 0.01x concurrency, ID 0x57AC6CF9E75AF6673635BEFFE5F2117E at byte 4623677 # Scores: V/M = 0.00 # Time range: 2023-05-07T05:01:29 to 2023-05-07T05:02:34 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 14 4802 # Exec time 0 524ms 55us 1ms 109us 167us 52us 93us # Lock time 49 10ms 0 286us 2us 2us 5us 1us # Rows sent 1 4.69k 0 1 1.00 0.99 0.01 0.99 # Rows examine 0 4.69k 0 1 1.00 0.99 0.01 0.99 # Query size 14 246.08k 42 58 52.48 51.63 2.30 51.63 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us #################################################### # 1ms # # 10ms # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'tenant'\G # SHOW CREATE TABLE `isuports`.`tenant`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT * FROM tenant WHERE name = 'xf-osxe-1683435694'\G ```

a0457eadb62bb3786a94829bb486805d79bb0dc2

karamaru-alpha commented 1 year ago

10 8338

kataribe ``` sudo cat /var/log/nginx/access.log | kataribe -f /home/isucon/webapp/kataribe.toml Top 20 Sort By Count Count Total Mean Min Max Request 3772 1746.751 0.4631 0.001 30.001 GET /api/player/player/* 2180 787.596 0.3613 0.002 7.356 GET /api/player/competition/*/ranking 419 47.037 0.1123 0.001 2.089 GET /api/player/competitions HTTP/2.0 87 27.136 0.3119 0.001 3.445 POST /api/organizer/competition/*/score 70 7.504 0.1072 0.005 2.654 POST /api/organizer/competitions/add HTTP/2.0 66 6.766 0.1025 0.001 1.696 POST /api/organizer/competition/*/finish 56 5.040 0.0900 0.002 0.942 GET /api/organizer/players HTTP/2.0 51 63.653 1.2481 0.002 30.001 GET /api/organizer/billing HTTP/2.0 24 101.629 4.2345 0.002 18.404 GET /api/admin/tenants/billing?before=* 15 0.895 0.0597 0.002 0.176 POST /api/organizer/player/*/disqualified 12 1.129 0.0941 0.001 0.509 POST /api/admin/tenants/add HTTP/2.0 12 39.279 3.2732 1.121 14.192 POST /api/organizer/players/add HTTP/2.0 2 3.885 1.9425 0.001 3.884 POST /initialize HTTP/2.0 2 3.220 1.6100 0.254 2.966 GET /api/admin/tenants/billing HTTP/2.0 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 Top 20 Sort By Total Count Total Mean Min Max Request 3772 1746.751 0.4631 0.001 30.001 GET /api/player/player/* 2180 787.596 0.3613 0.002 7.356 GET /api/player/competition/*/ranking 24 101.629 4.2345 0.002 18.404 GET /api/admin/tenants/billing?before=* 51 63.653 1.2481 0.002 30.001 GET /api/organizer/billing HTTP/2.0 419 47.037 0.1123 0.001 2.089 GET /api/player/competitions HTTP/2.0 12 39.279 3.2732 1.121 14.192 POST /api/organizer/players/add HTTP/2.0 87 27.136 0.3119 0.001 3.445 POST /api/organizer/competition/*/score 70 7.504 0.1072 0.005 2.654 POST /api/organizer/competitions/add HTTP/2.0 66 6.766 0.1025 0.001 1.696 POST /api/organizer/competition/*/finish 56 5.040 0.0900 0.002 0.942 GET /api/organizer/players HTTP/2.0 2 3.885 1.9425 0.001 3.884 POST /initialize HTTP/2.0 2 3.220 1.6100 0.254 2.966 GET /api/admin/tenants/billing HTTP/2.0 12 1.129 0.0941 0.001 0.509 POST /api/admin/tenants/add HTTP/2.0 15 0.895 0.0597 0.002 0.176 POST /api/organizer/player/*/disqualified 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 Top 20 Sort By Mean Count Total Mean Min Max Request 24 101.629 4.2345 0.002 18.404 GET /api/admin/tenants/billing?before=* 12 39.279 3.2732 1.121 14.192 POST /api/organizer/players/add HTTP/2.0 2 3.885 1.9425 0.001 3.884 POST /initialize HTTP/2.0 2 3.220 1.6100 0.254 2.966 GET /api/admin/tenants/billing HTTP/2.0 51 63.653 1.2481 0.002 30.001 GET /api/organizer/billing HTTP/2.0 3772 1746.751 0.4631 0.001 30.001 GET /api/player/player/* 2180 787.596 0.3613 0.002 7.356 GET /api/player/competition/*/ranking 87 27.136 0.3119 0.001 3.445 POST /api/organizer/competition/*/score 419 47.037 0.1123 0.001 2.089 GET /api/player/competitions HTTP/2.0 70 7.504 0.1072 0.005 2.654 POST /api/organizer/competitions/add HTTP/2.0 66 6.766 0.1025 0.001 1.696 POST /api/organizer/competition/*/finish 12 1.129 0.0941 0.001 0.509 POST /api/admin/tenants/add HTTP/2.0 56 5.040 0.0900 0.002 0.942 GET /api/organizer/players HTTP/2.0 15 0.895 0.0597 0.002 0.176 POST /api/organizer/player/*/disqualified 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 Top 20 Sort By Maximum(100 Percentile) Count Total Mean Min Max Request 51 63.653 1.2481 0.002 30.001 GET /api/organizer/billing HTTP/2.0 3772 1746.751 0.4631 0.001 30.001 GET /api/player/player/* 24 101.629 4.2345 0.002 18.404 GET /api/admin/tenants/billing?before=* 12 39.279 3.2732 1.121 14.192 POST /api/organizer/players/add HTTP/2.0 2180 787.596 0.3613 0.002 7.356 GET /api/player/competition/*/ranking 2 3.885 1.9425 0.001 3.884 POST /initialize HTTP/2.0 87 27.136 0.3119 0.001 3.445 POST /api/organizer/competition/*/score 2 3.220 1.6100 0.254 2.966 GET /api/admin/tenants/billing HTTP/2.0 70 7.504 0.1072 0.005 2.654 POST /api/organizer/competitions/add HTTP/2.0 419 47.037 0.1123 0.001 2.089 GET /api/player/competitions HTTP/2.0 66 6.766 0.1025 0.001 1.696 POST /api/organizer/competition/*/finish 56 5.040 0.0900 0.002 0.942 GET /api/organizer/players HTTP/2.0 12 1.129 0.0941 0.001 0.509 POST /api/admin/tenants/add HTTP/2.0 15 0.895 0.0597 0.002 0.176 POST /api/organizer/player/*/disqualified 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 TOP 10 Slow Requests 1 30.001 GET /api/player/player/6150bd23f HTTP/2.0 2 30.001 GET /api/player/player/61528a901 HTTP/2.0 3 30.001 GET /api/organizer/billing HTTP/2.0 4 30.001 GET /api/player/player/5fd3782c7 HTTP/2.0 5 30.001 GET /api/player/player/601ad2c1d HTTP/2.0 6 30.001 GET /api/player/player/601ad2c1d HTTP/2.0 7 30.001 GET /api/player/player/60fea5853 HTTP/2.0 8 18.404 GET /api/admin/tenants/billing?before=53 HTTP/2.0 9 14.192 POST /api/organizer/players/add HTTP/2.0 10 13.750 GET /api/admin/tenants/billing?before=68 HTTP/2.0 ```
slow-log ``` sudo /home/isucon/webapp/slow.sh /var/log/mysql/slow-query.log # Query 1: 34.40 QPS, 0.11x concurrency, ID 0x717868DB0FF4601C650032A81060D41E at byte 360341 # Scores: V/M = 0.00 # Time range: 2023-05-07T09:58:04 to 2023-05-07T09:59:07 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 4 2167 # Exec time 49 7s 96us 121ms 3ms 5ms 4ms 3ms # Lock time 13 3ms 1us 97us 1us 1us 2us 1us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 0 0 0 0 0 0 0 0 # Query size 20 457.10k 183 218 216.00 212.52 6.27 212.52 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # # 100us ### # 1ms ################################################################ # 10ms # # 100ms # # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G INSERT INTO latest_visit_history (player_id, tenant_id, competition_id, created_at) VALUES ('61bddbb9b', 78, '01GZTTBAKHMA2WVFF0348REA9A', 1683453488) ON DUPLICATE KEY UPDATE `created_at` = 1683453488\G # Query 2: 0 QPS, 0x concurrency, ID 0x3289E87E94D5A82E348974B3D332E575 at byte 662 # Scores: V/M = 0.00 # Time range: all events occurred at 2023-05-07T09:58:01 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 1 # Exec time 18 2s 2s 2s 2s 2s 0 2s # Lock time 0 8us 8us 8us 8us 8us 0 8us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 82 3.08M 3.08M 3.08M 3.08M 3.08M 0 3.08M # Query size 0 58 58 58 58 58 0 58 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s ################################################################ # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G DELETE FROM visit_history WHERE created_at >= '1654041600'\G # Converted for EXPLAIN # EXPLAIN /*!50100 PARTITIONS*/ select * from visit_history WHERE created_at >= '1654041600'\G # Query 3: 45.48 QPS, 0.02x concurrency, ID 0x731A1F4786F770DE31CE879DB79AA27F at byte 343087 # Scores: V/M = 0.00 # Time range: 2023-05-07T09:58:03 to 2023-05-07T09:59:16 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 7 3320 # Exec time 8 1s 110us 44ms 343us 424us 1ms 236us # Lock time 20 5ms 0 38us 1us 2us 1us 1us # Rows sent 97 438.30k 0 4.88k 135.19 174.84 475.38 72.65 # Rows examine 11 438.30k 0 4.88k 135.19 174.84 475.38 72.65 # Query size 18 414.91k 124 144 127.97 143.84 6.02 124.25 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us ################################################################ # 1ms # # 10ms # # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT player_id, created_at AS min_created_at FROM latest_visit_history WHERE tenant_id = 39 AND competition_id = '3c97fae7d'\G # Query 4: 0 QPS, 0x concurrency, ID 0xD8D99DA87D548EEB1C1FF31A4382E239 at byte 1932 # Scores: V/M = 0.00 # Time range: all events occurred at 2023-05-07T09:58:02 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 1 # Exec time 8 1s 1s 1s 1s 1s 0 1s # Lock time 0 9us 9us 9us 9us 9us 0 9us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 5 195.78k 195.78k 195.78k 195.78k 195.78k 0 195.78k # Query size 0 121 121 121 121 121 0 121 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s ################################################################ # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G # SHOW TABLE STATUS FROM `isuports` LIKE 'init_latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`init_latest_visit_history`\G INSERT INTO `latest_visit_history` SELECT tenant_id, competition_id, player_id, created_at FROM init_latest_visit_history\G # Query 5: 194.47 QPS, 0.01x concurrency, ID 0xDA556F9115773A1A99AA0165670CE848 at byte 7833087 # Scores: V/M = 0.00 # Time range: 2023-05-07T09:58:02 to 2023-05-07T09:59:16 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 32 14391 # Exec time 7 1s 28us 9ms 73us 113us 86us 63us # 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 421.61k 30 30 30 30 0 30 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us ##### # 1ms # # 10ms # 100ms # 1s # 10s+ administrator command: Prepare\G # Query 6: 105.14 QPS, 0.01x concurrency, ID 0x57AC6CF9E75AF6673635BEFFE5F2117E at byte 268734 # Scores: V/M = 0.00 # Time range: 2023-05-07T09:58:03 to 2023-05-07T09:59:07 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 15 6729 # Exec time 5 716ms 55us 4ms 106us 159us 73us 93us # Lock time 50 13ms 0 486us 1us 2us 6us 1us # Rows sent 1 6.57k 0 1 1.00 0.99 0.01 0.99 # Rows examine 0 6.57k 0 1 1.00 0.99 0.01 0.99 # Query size 15 353.09k 42 57 53.73 56.92 4.29 54.21 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us ########################################### # 1ms # # 10ms # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'tenant'\G # SHOW CREATE TABLE `isuports`.`tenant`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT * FROM tenant WHERE name = 'hgp-yqb-25'\G ```

3ef51382b5e488783ed2d5f77494ff8cd114683d

karamaru-alpha commented 1 year ago

11 7287

kataribe ``` sudo cat /var/log/nginx/access.log | kataribe -f /home/isucon/webapp/kataribe.toml Top 20 Sort By Count Count Total Mean Min Max Request 4268 1515.534 0.3551 0.001 30.001 GET /api/player/player/* 2328 689.982 0.2964 0.001 13.835 GET /api/player/competition/*/ranking 461 41.612 0.0903 0.001 1.589 GET /api/player/competitions HTTP/2.0 89 23.927 0.2688 0.001 3.116 POST /api/organizer/competition/*/score 72 7.622 0.1059 0.005 2.550 POST /api/organizer/competitions/add HTTP/2.0 66 8.490 0.1286 0.001 3.051 POST /api/organizer/competition/*/finish 58 4.505 0.0777 0.003 0.649 GET /api/organizer/players HTTP/2.0 49 53.877 1.0995 0.002 30.000 GET /api/organizer/billing HTTP/2.0 24 98.674 4.1114 0.001 15.247 GET /api/admin/tenants/billing?before=* 15 46.600 3.1067 0.813 8.568 POST /api/organizer/players/add HTTP/2.0 14 1.105 0.0789 0.002 0.414 POST /api/organizer/player/*/disqualified 14 2.258 0.1613 0.000 0.507 POST /api/admin/tenants/add HTTP/2.0 2 2.250 1.1250 0.267 1.983 GET /api/admin/tenants/billing HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /ecp/Current/exporttool/microsoft.exchange.ediscovery.exporttool.application HTTP/1.1 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 1 3.814 3.8140 3.814 3.814 POST /initialize HTTP/2.0 Top 20 Sort By Total Count Total Mean Min Max Request 4268 1515.534 0.3551 0.001 30.001 GET /api/player/player/* 2328 689.982 0.2964 0.001 13.835 GET /api/player/competition/*/ranking 24 98.674 4.1114 0.001 15.247 GET /api/admin/tenants/billing?before=* 49 53.877 1.0995 0.002 30.000 GET /api/organizer/billing HTTP/2.0 15 46.600 3.1067 0.813 8.568 POST /api/organizer/players/add HTTP/2.0 461 41.612 0.0903 0.001 1.589 GET /api/player/competitions HTTP/2.0 89 23.927 0.2688 0.001 3.116 POST /api/organizer/competition/*/score 66 8.490 0.1286 0.001 3.051 POST /api/organizer/competition/*/finish 72 7.622 0.1059 0.005 2.550 POST /api/organizer/competitions/add HTTP/2.0 58 4.505 0.0777 0.003 0.649 GET /api/organizer/players HTTP/2.0 1 3.814 3.8140 3.814 3.814 POST /initialize HTTP/2.0 14 2.258 0.1613 0.000 0.507 POST /api/admin/tenants/add HTTP/2.0 2 2.250 1.1250 0.267 1.983 GET /api/admin/tenants/billing HTTP/2.0 14 1.105 0.0789 0.002 0.414 POST /api/organizer/player/*/disqualified 1 0.000 0.0000 0.000 0.000 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /ecp/Current/exporttool/microsoft.exchange.ediscovery.exporttool.application HTTP/1.1 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 Top 20 Sort By Mean Count Total Mean Min Max Request 24 98.674 4.1114 0.001 15.247 GET /api/admin/tenants/billing?before=* 1 3.814 3.8140 3.814 3.814 POST /initialize HTTP/2.0 15 46.600 3.1067 0.813 8.568 POST /api/organizer/players/add HTTP/2.0 2 2.250 1.1250 0.267 1.983 GET /api/admin/tenants/billing HTTP/2.0 49 53.877 1.0995 0.002 30.000 GET /api/organizer/billing HTTP/2.0 4268 1515.534 0.3551 0.001 30.001 GET /api/player/player/* 2328 689.982 0.2964 0.001 13.835 GET /api/player/competition/*/ranking 89 23.927 0.2688 0.001 3.116 POST /api/organizer/competition/*/score 14 2.258 0.1613 0.000 0.507 POST /api/admin/tenants/add HTTP/2.0 66 8.490 0.1286 0.001 3.051 POST /api/organizer/competition/*/finish 72 7.622 0.1059 0.005 2.550 POST /api/organizer/competitions/add HTTP/2.0 461 41.612 0.0903 0.001 1.589 GET /api/player/competitions HTTP/2.0 14 1.105 0.0789 0.002 0.414 POST /api/organizer/player/*/disqualified 58 4.505 0.0777 0.003 0.649 GET /api/organizer/players HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /ecp/Current/exporttool/microsoft.exchange.ediscovery.exporttool.application HTTP/1.1 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 Top 20 Sort By Maximum(100 Percentile) Count Total Mean Min Max Request 4268 1515.534 0.3551 0.001 30.001 GET /api/player/player/* 49 53.877 1.0995 0.002 30.000 GET /api/organizer/billing HTTP/2.0 24 98.674 4.1114 0.001 15.247 GET /api/admin/tenants/billing?before=* 2328 689.982 0.2964 0.001 13.835 GET /api/player/competition/*/ranking 15 46.600 3.1067 0.813 8.568 POST /api/organizer/players/add HTTP/2.0 1 3.814 3.8140 3.814 3.814 POST /initialize HTTP/2.0 89 23.927 0.2688 0.001 3.116 POST /api/organizer/competition/*/score 66 8.490 0.1286 0.001 3.051 POST /api/organizer/competition/*/finish 72 7.622 0.1059 0.005 2.550 POST /api/organizer/competitions/add HTTP/2.0 2 2.250 1.1250 0.267 1.983 GET /api/admin/tenants/billing HTTP/2.0 461 41.612 0.0903 0.001 1.589 GET /api/player/competitions HTTP/2.0 58 4.505 0.0777 0.003 0.649 GET /api/organizer/players HTTP/2.0 14 2.258 0.1613 0.000 0.507 POST /api/admin/tenants/add HTTP/2.0 14 1.105 0.0789 0.002 0.414 POST /api/organizer/player/*/disqualified 1 0.000 0.0000 0.000 0.000 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /ecp/Current/exporttool/microsoft.exchange.ediscovery.exporttool.application HTTP/1.1 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 TOP 10 Slow Requests 1 30.001 GET /api/player/player/6025e7add HTTP/2.0 2 30.001 GET /api/player/player/623354f5d HTTP/2.0 3 30.001 GET /api/player/player/61c05b5d4 HTTP/2.0 4 30.001 GET /api/player/player/5f71190cc HTTP/2.0 5 30.000 GET /api/organizer/billing HTTP/2.0 6 15.247 GET /api/admin/tenants/billing?before=68 HTTP/2.0 7 14.940 GET /api/admin/tenants/billing?before=55 HTTP/2.0 8 13.835 GET /api/player/competition/547f03113/ranking?rank_after=19 HTTP/2.0 9 11.513 GET /api/admin/tenants/billing?before=78 HTTP/2.0 10 10.292 GET /api/admin/tenants/billing?before=50 HTTP/2.0 ```
slow-log ``` sudo /home/isucon/webapp/slow.sh /var/log/mysql/slow-query.log # Query 1: 36.19 QPS, 0.13x concurrency, ID 0x717868DB0FF4601C650032A81060D41E at byte 559279 # Scores: V/M = 0.01 # Time range: 2023-05-07T10:13:42 to 2023-05-07T10:14:46 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 4 2316 # Exec time 53 8s 97us 122ms 3ms 6ms 6ms 3ms # Lock time 13 4ms 0 87us 1us 1us 2us 1us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 0 0 0 0 0 0 0 0 # Query size 20 488.32k 182 218 215.91 212.52 6.47 212.52 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # # 100us ###### # 1ms ################################################################ # 10ms # # 100ms # # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G INSERT INTO latest_visit_history (player_id, tenant_id, competition_id, created_at) VALUES ('2255322e1', 55, '01GZTV7ZXEVJ2JCKWPTNTNEZ5A', 1683454427) ON DUPLICATE KEY UPDATE `created_at` = 1683454427\G # Query 2: 0 QPS, 0x concurrency, ID 0x3289E87E94D5A82E348974B3D332E575 at byte 662 # Scores: V/M = 0.00 # Time range: all events occurred at 2023-05-07T10:13:39 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 1 # Exec time 16 2s 2s 2s 2s 2s 0 2s # Lock time 0 7us 7us 7us 7us 7us 0 7us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 82 3.08M 3.08M 3.08M 3.08M 3.08M 0 3.08M # Query size 0 58 58 58 58 58 0 58 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s ################################################################ # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G DELETE FROM visit_history WHERE created_at >= '1654041600'\G # Converted for EXPLAIN # EXPLAIN /*!50100 PARTITIONS*/ select * from visit_history WHERE created_at >= '1654041600'\G # Query 3: 210.85 QPS, 0.02x concurrency, ID 0xDA556F9115773A1A99AA0165670CE848 at byte 10044096 # Scores: V/M = 0.00 # Time range: 2023-05-07T10:13:40 to 2023-05-07T10:14:53 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 32 15392 # Exec time 7 1s 30us 5ms 74us 119us 64us 63us # 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 450.94k 30 30 30 30 0 30 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us ###### # 1ms # # 10ms # 100ms # 1s # 10s+ administrator command: Prepare\G # Query 4: 46.24 QPS, 0.02x concurrency, ID 0x731A1F4786F770DE31CE879DB79AA27F at byte 553249 # Scores: V/M = 0.00 # Time range: 2023-05-07T10:13:41 to 2023-05-07T10:14:53 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 7 3329 # Exec time 7 1s 108us 30ms 337us 445us 738us 247us # Lock time 20 6ms 0 266us 1us 2us 4us 1us # Rows sent 97 446.29k 0 4.88k 137.28 174.84 474.45 76.28 # Rows examine 11 446.29k 0 4.88k 137.28 174.84 474.45 76.28 # Query size 17 415.45k 124 144 127.79 143.84 5.78 124.25 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us ################################################################ # 1ms # # 10ms # # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT player_id, created_at AS min_created_at FROM latest_visit_history WHERE tenant_id = 83 AND competition_id = '437566cdc'\G # Query 5: 0 QPS, 0x concurrency, ID 0xD8D99DA87D548EEB1C1FF31A4382E239 at byte 1932 # Scores: V/M = 0.00 # Time range: all events occurred at 2023-05-07T10:13:40 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 1 # Exec time 6 1s 1s 1s 1s 1s 0 1s # Lock time 0 12us 12us 12us 12us 12us 0 12us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 5 195.78k 195.78k 195.78k 195.78k 195.78k 0 195.78k # Query size 0 121 121 121 121 121 0 121 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s ################################################################ # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G # SHOW TABLE STATUS FROM `isuports` LIKE 'init_latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`init_latest_visit_history`\G INSERT INTO `latest_visit_history` SELECT tenant_id, competition_id, player_id, created_at FROM init_latest_visit_history\G # Query 6: 115.95 QPS, 0.01x concurrency, ID 0x57AC6CF9E75AF6673635BEFFE5F2117E at byte 8008837 # Scores: V/M = 0.00 # Time range: 2023-05-07T10:13:41 to 2023-05-07T10:14:45 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 15 7421 # Exec time 5 815ms 49us 6ms 109us 167us 91us 93us # Lock time 51 15ms 0 344us 1us 2us 5us 1us # Rows sent 1 7.25k 0 1 1.00 0.99 0.01 0.99 # Rows examine 0 7.25k 0 1 1.00 0.99 0.01 0.99 # Query size 15 372.20k 42 57 51.36 51.63 2.43 51.63 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us ################################################### # 1ms # # 10ms # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'tenant'\G # SHOW CREATE TABLE `isuports`.`tenant`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT * FROM tenant WHERE name = 'p-yied-1683454439'\G ```

7072a0fb95c5d256510f03c0228619df2c7756f6

karamaru-alpha commented 1 year ago

13 18359

kataribe ``` sudo cat /var/log/nginx/access.log | kataribe -f /home/isucon/webapp/kataribe.toml Top 20 Sort By Count Count Total Mean Min Max Request 10074 1941.986 0.1928 0.001 4.909 GET /api/player/player/* 4708 1787.347 0.3796 0.001 5.308 GET /api/player/competition/*/ranking 724 76.023 0.1050 0.001 1.765 GET /api/player/competitions HTTP/2.0 146 25.980 0.1779 0.001 2.393 POST /api/organizer/competition/*/score 126 9.581 0.0760 0.002 1.141 POST /api/organizer/competitions/add HTTP/2.0 120 15.121 0.1260 0.002 2.268 POST /api/organizer/competition/*/finish 113 7.887 0.0698 0.002 0.968 GET /api/organizer/players HTTP/2.0 101 83.204 0.8238 0.002 6.561 GET /api/organizer/billing HTTP/2.0 69 86.559 1.2545 0.001 20.011 GET /api/admin/tenants/billing?before=* 25 67.837 2.7135 0.848 5.223 POST /api/organizer/players/add HTTP/2.0 17 3.112 0.1831 0.001 0.565 POST /api/admin/tenants/add HTTP/2.0 17 2.263 0.1331 0.001 1.462 POST /api/organizer/player/*/disqualified 6 6.529 1.0882 0.065 2.344 GET /api/admin/tenants/billing HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 3.949 3.9490 3.949 3.949 POST /initialize HTTP/2.0 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 Top 20 Sort By Total Count Total Mean Min Max Request 10074 1941.986 0.1928 0.001 4.909 GET /api/player/player/* 4708 1787.347 0.3796 0.001 5.308 GET /api/player/competition/*/ranking 69 86.559 1.2545 0.001 20.011 GET /api/admin/tenants/billing?before=* 101 83.204 0.8238 0.002 6.561 GET /api/organizer/billing HTTP/2.0 724 76.023 0.1050 0.001 1.765 GET /api/player/competitions HTTP/2.0 25 67.837 2.7135 0.848 5.223 POST /api/organizer/players/add HTTP/2.0 146 25.980 0.1779 0.001 2.393 POST /api/organizer/competition/*/score 120 15.121 0.1260 0.002 2.268 POST /api/organizer/competition/*/finish 126 9.581 0.0760 0.002 1.141 POST /api/organizer/competitions/add HTTP/2.0 113 7.887 0.0698 0.002 0.968 GET /api/organizer/players HTTP/2.0 6 6.529 1.0882 0.065 2.344 GET /api/admin/tenants/billing HTTP/2.0 1 3.949 3.9490 3.949 3.949 POST /initialize HTTP/2.0 17 3.112 0.1831 0.001 0.565 POST /api/admin/tenants/add HTTP/2.0 17 2.263 0.1331 0.001 1.462 POST /api/organizer/player/*/disqualified 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 Top 20 Sort By Mean Count Total Mean Min Max Request 1 3.949 3.9490 3.949 3.949 POST /initialize HTTP/2.0 25 67.837 2.7135 0.848 5.223 POST /api/organizer/players/add HTTP/2.0 69 86.559 1.2545 0.001 20.011 GET /api/admin/tenants/billing?before=* 6 6.529 1.0882 0.065 2.344 GET /api/admin/tenants/billing HTTP/2.0 101 83.204 0.8238 0.002 6.561 GET /api/organizer/billing HTTP/2.0 4708 1787.347 0.3796 0.001 5.308 GET /api/player/competition/*/ranking 10074 1941.986 0.1928 0.001 4.909 GET /api/player/player/* 17 3.112 0.1831 0.001 0.565 POST /api/admin/tenants/add HTTP/2.0 146 25.980 0.1779 0.001 2.393 POST /api/organizer/competition/*/score 17 2.263 0.1331 0.001 1.462 POST /api/organizer/player/*/disqualified 120 15.121 0.1260 0.002 2.268 POST /api/organizer/competition/*/finish 724 76.023 0.1050 0.001 1.765 GET /api/player/competitions HTTP/2.0 126 9.581 0.0760 0.002 1.141 POST /api/organizer/competitions/add HTTP/2.0 113 7.887 0.0698 0.002 0.968 GET /api/organizer/players HTTP/2.0 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 Top 20 Sort By Maximum(100 Percentile) Count Total Mean Min Max Request 69 86.559 1.2545 0.001 20.011 GET /api/admin/tenants/billing?before=* 101 83.204 0.8238 0.002 6.561 GET /api/organizer/billing HTTP/2.0 4708 1787.347 0.3796 0.001 5.308 GET /api/player/competition/*/ranking 25 67.837 2.7135 0.848 5.223 POST /api/organizer/players/add HTTP/2.0 10074 1941.986 0.1928 0.001 4.909 GET /api/player/player/* 1 3.949 3.9490 3.949 3.949 POST /initialize HTTP/2.0 146 25.980 0.1779 0.001 2.393 POST /api/organizer/competition/*/score 6 6.529 1.0882 0.065 2.344 GET /api/admin/tenants/billing HTTP/2.0 120 15.121 0.1260 0.002 2.268 POST /api/organizer/competition/*/finish 724 76.023 0.1050 0.001 1.765 GET /api/player/competitions HTTP/2.0 17 2.263 0.1331 0.001 1.462 POST /api/organizer/player/*/disqualified 126 9.581 0.0760 0.002 1.141 POST /api/organizer/competitions/add HTTP/2.0 113 7.887 0.0698 0.002 0.968 GET /api/organizer/players HTTP/2.0 17 3.112 0.1831 0.001 0.565 POST /api/admin/tenants/add HTTP/2.0 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 TOP 10 Slow Requests 1 20.011 GET /api/admin/tenants/billing?before=69 HTTP/2.0 2 12.026 GET /api/admin/tenants/billing?before=92 HTTP/2.0 3 10.734 GET /api/admin/tenants/billing?before=82 HTTP/2.0 4 8.370 GET /api/admin/tenants/billing?before=11 HTTP/2.0 5 8.181 GET /api/admin/tenants/billing?before=69 HTTP/2.0 6 6.561 GET /api/organizer/billing HTTP/2.0 7 6.314 GET /api/organizer/billing HTTP/2.0 8 5.900 GET /api/organizer/billing HTTP/2.0 9 5.308 GET /api/player/competition/01GZV6H6R03F4E0ZWDV6KP8NVJ/ranking HTTP/2.0 10 5.223 POST /api/organizer/players/add HTTP/2.0 ```
slow-log ``` sudo /home/isucon/webapp/slow.sh /var/log/mysql/slow-query.log # Query 1: 73.33 QPS, 0.26x concurrency, ID 0x717868DB0FF4601C650032A81060D41E at byte 566139 # Scores: V/M = 0.03 # Time range: 2023-05-07T13:30:10 to 2023-05-07T13:31:14 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 4 4693 # Exec time 58 16s 87us 219ms 3ms 6ms 10ms 3ms # Lock time 13 8ms 0 393us 1us 1us 5us 1us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 0 0 0 0 0 0 0 0 # Query size 19 991.34k 182 218 216.31 212.52 5.77 212.52 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # # 100us #### # 1ms ################################################################ # 10ms # # 100ms # # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G INSERT INTO latest_visit_history (player_id, tenant_id, competition_id, created_at) VALUES ('519ba5b93', 45, '01GZV6FPRC9DSEGD3GXDR1SZZK', 1683466214) ON DUPLICATE KEY UPDATE `created_at` = 1683466214\G # Query 2: 134.75 QPS, 0.05x concurrency, ID 0x731A1F4786F770DE31CE879DB79AA27F at byte 7539674 # Scores: V/M = 0.00 # Time range: 2023-05-07T13:30:09 to 2023-05-07T13:31:14 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 8 8759 # Exec time 11 3s 110us 32ms 370us 467us 900us 204us # Lock time 21 12ms 0 124us 1us 1us 1us 1us # Rows sent 98 1.63M 0 4.88k 195.14 183.58 679.40 76.28 # Rows examine 33 1.63M 0 4.88k 195.14 183.58 679.40 76.28 # Query size 21 1.07M 124 144 127.68 143.84 5.65 124.25 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us ################################################################ # 1ms # # 10ms # # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT player_id, created_at AS min_created_at FROM latest_visit_history WHERE tenant_id = 1 AND competition_id = '585aacdf5'\G # Query 3: 0 QPS, 0x concurrency, ID 0x3289E87E94D5A82E348974B3D332E575 at byte 662 # Scores: V/M = 0.00 # Time range: all events occurred at 2023-05-07T13:30:07 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 1 # Exec time 8 2s 2s 2s 2s 2s 0 2s # Lock time 0 8us 8us 8us 8us 8us 0 8us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 62 3.08M 3.08M 3.08M 3.08M 3.08M 0 3.08M # Query size 0 58 58 58 58 58 0 58 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s ################################################################ # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G DELETE FROM visit_history WHERE created_at >= '1654041600'\G # Converted for EXPLAIN # EXPLAIN /*!50100 PARTITIONS*/ select * from visit_history WHERE created_at >= '1654041600'\G # Query 4: 519.89 QPS, 0.04x concurrency, ID 0xDA556F9115773A1A99AA0165670CE848 at byte 23123979 # Scores: V/M = 0.00 # Time range: 2023-05-07T13:30:08 to 2023-05-07T13:31:14 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 33 34313 # Exec time 8 2s 25us 12ms 70us 98us 110us 60us # 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 1005.26k 30 30 30 30 0 30 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us ### # 1ms # # 10ms # # 100ms # 1s # 10s+ administrator command: Prepare\G # Query 5: 248.54 QPS, 0.03x concurrency, ID 0x57AC6CF9E75AF6673635BEFFE5F2117E at byte 17092538 # Scores: V/M = 0.00 # Time range: 2023-05-07T13:30:09 to 2023-05-07T13:31:14 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 15 16155 # Exec time 6 2s 51us 15ms 106us 159us 165us 89us # Lock time 50 29ms 0 256us 1us 1us 5us 1us # Rows sent 0 15.78k 0 1 1.00 0.99 0.01 0.99 # Rows examine 0 15.78k 0 1 1.00 0.99 0.01 0.99 # Query size 15 816.22k 42 58 51.74 54.21 4.85 51.63 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us ############################### # 1ms # # 10ms # # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'tenant'\G # SHOW CREATE TABLE `isuports`.`tenant`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT * FROM tenant WHERE name = 'fic-k-1683466216'\G # Query 6: 0 QPS, 0x concurrency, ID 0xD8D99DA87D548EEB1C1FF31A4382E239 at byte 1932 # Scores: V/M = 0.00 # Time range: all events occurred at 2023-05-07T13:30:08 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 1 # Exec time 3 1s 1s 1s 1s 1s 0 1s # Lock time 0 8us 8us 8us 8us 8us 0 8us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 3 195.78k 195.78k 195.78k 195.78k 195.78k 0 195.78k # Query size 0 121 121 121 121 121 0 121 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s ################################################################ # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G # SHOW TABLE STATUS FROM `isuports` LIKE 'init_latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`init_latest_visit_history`\G INSERT INTO `latest_visit_history` SELECT tenant_id, competition_id, player_id, created_at FROM init_latest_visit_history\G ```

f6461272dfcf39e5a69c3d05933afca3b97b6904

karamaru-alpha commented 1 year ago

14 23731

予選突破ライン。本番でいけた人すごい。

kataribe ``` sudo cat /var/log/nginx/access.log | kataribe -f /home/isucon/webapp/kataribe.toml Top 20 Sort By Count Count Total Mean Min Max Request 11763 1935.090 0.1645 0.001 6.211 GET /api/player/player/* 5529 1727.438 0.3124 0.000 5.895 GET /api/player/competition/*/ranking 866 73.861 0.0853 0.001 2.188 GET /api/player/competitions HTTP/2.0 162 24.990 0.1543 0.001 0.817 POST /api/organizer/competition/*/score 141 7.807 0.0554 0.004 0.476 POST /api/organizer/competitions/add HTTP/2.0 135 8.250 0.0611 0.001 0.487 POST /api/organizer/competition/*/finish 128 7.478 0.0584 0.001 0.927 GET /api/organizer/players HTTP/2.0 112 75.866 0.6774 0.002 7.022 GET /api/organizer/billing HTTP/2.0 75 82.912 1.1055 0.001 14.289 GET /api/admin/tenants/billing?before=* 25 80.163 3.2065 0.911 11.060 POST /api/organizer/players/add HTTP/2.0 18 1.095 0.0608 0.002 0.384 POST /api/organizer/player/*/disqualified 16 1.845 0.1153 0.000 0.717 POST /api/admin/tenants/add HTTP/2.0 6 2.477 0.4128 0.029 1.264 GET /api/admin/tenants/billing HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 1 4.048 4.0480 4.048 4.048 POST /initialize HTTP/2.0 Top 20 Sort By Total Count Total Mean Min Max Request 11763 1935.090 0.1645 0.001 6.211 GET /api/player/player/* 5529 1727.438 0.3124 0.000 5.895 GET /api/player/competition/*/ranking 75 82.912 1.1055 0.001 14.289 GET /api/admin/tenants/billing?before=* 25 80.163 3.2065 0.911 11.060 POST /api/organizer/players/add HTTP/2.0 112 75.866 0.6774 0.002 7.022 GET /api/organizer/billing HTTP/2.0 866 73.861 0.0853 0.001 2.188 GET /api/player/competitions HTTP/2.0 162 24.990 0.1543 0.001 0.817 POST /api/organizer/competition/*/score 135 8.250 0.0611 0.001 0.487 POST /api/organizer/competition/*/finish 141 7.807 0.0554 0.004 0.476 POST /api/organizer/competitions/add HTTP/2.0 128 7.478 0.0584 0.001 0.927 GET /api/organizer/players HTTP/2.0 1 4.048 4.0480 4.048 4.048 POST /initialize HTTP/2.0 6 2.477 0.4128 0.029 1.264 GET /api/admin/tenants/billing HTTP/2.0 16 1.845 0.1153 0.000 0.717 POST /api/admin/tenants/add HTTP/2.0 18 1.095 0.0608 0.002 0.384 POST /api/organizer/player/*/disqualified 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 Top 20 Sort By Mean Count Total Mean Min Max Request 1 4.048 4.0480 4.048 4.048 POST /initialize HTTP/2.0 25 80.163 3.2065 0.911 11.060 POST /api/organizer/players/add HTTP/2.0 75 82.912 1.1055 0.001 14.289 GET /api/admin/tenants/billing?before=* 112 75.866 0.6774 0.002 7.022 GET /api/organizer/billing HTTP/2.0 6 2.477 0.4128 0.029 1.264 GET /api/admin/tenants/billing HTTP/2.0 5529 1727.438 0.3124 0.000 5.895 GET /api/player/competition/*/ranking 11763 1935.090 0.1645 0.001 6.211 GET /api/player/player/* 162 24.990 0.1543 0.001 0.817 POST /api/organizer/competition/*/score 16 1.845 0.1153 0.000 0.717 POST /api/admin/tenants/add HTTP/2.0 866 73.861 0.0853 0.001 2.188 GET /api/player/competitions HTTP/2.0 135 8.250 0.0611 0.001 0.487 POST /api/organizer/competition/*/finish 18 1.095 0.0608 0.002 0.384 POST /api/organizer/player/*/disqualified 128 7.478 0.0584 0.001 0.927 GET /api/organizer/players HTTP/2.0 141 7.807 0.0554 0.004 0.476 POST /api/organizer/competitions/add HTTP/2.0 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 Top 20 Sort By Maximum(100 Percentile) Count Total Mean Min Max Request 75 82.912 1.1055 0.001 14.289 GET /api/admin/tenants/billing?before=* 25 80.163 3.2065 0.911 11.060 POST /api/organizer/players/add HTTP/2.0 112 75.866 0.6774 0.002 7.022 GET /api/organizer/billing HTTP/2.0 11763 1935.090 0.1645 0.001 6.211 GET /api/player/player/* 5529 1727.438 0.3124 0.000 5.895 GET /api/player/competition/*/ranking 1 4.048 4.0480 4.048 4.048 POST /initialize HTTP/2.0 866 73.861 0.0853 0.001 2.188 GET /api/player/competitions HTTP/2.0 6 2.477 0.4128 0.029 1.264 GET /api/admin/tenants/billing HTTP/2.0 128 7.478 0.0584 0.001 0.927 GET /api/organizer/players HTTP/2.0 162 24.990 0.1543 0.001 0.817 POST /api/organizer/competition/*/score 16 1.845 0.1153 0.000 0.717 POST /api/admin/tenants/add HTTP/2.0 135 8.250 0.0611 0.001 0.487 POST /api/organizer/competition/*/finish 141 7.807 0.0554 0.004 0.476 POST /api/organizer/competitions/add HTTP/2.0 18 1.095 0.0608 0.002 0.384 POST /api/organizer/player/*/disqualified 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 TOP 10 Slow Requests 1 14.289 GET /api/admin/tenants/billing?before=52 HTTP/2.0 2 12.699 GET /api/admin/tenants/billing?before=48 HTTP/2.0 3 11.060 POST /api/organizer/players/add HTTP/2.0 4 10.413 GET /api/admin/tenants/billing?before=42 HTTP/2.0 5 9.647 POST /api/organizer/players/add HTTP/2.0 6 7.022 GET /api/organizer/billing HTTP/2.0 7 6.211 GET /api/player/player/6151b6296 HTTP/2.0 8 6.175 GET /api/player/player/01GZV91JKC2WW6G1SKD1W6WX2K HTTP/2.0 9 5.952 GET /api/player/player/01GZV918SGQA392HF9BXAG2SMS HTTP/2.0 10 5.895 GET /api/player/competition/01GZV91HKSZZ2TD2Q0DJ7PH4HC/ranking HTTP/2.0 ```
slow-log ``` sudo /home/isucon/webapp/slow.sh /var/log/mysql/slow-query.log # Query 1: 87.49 QPS, 0.28x concurrency, ID 0x717868DB0FF4601C650032A81060D41E at byte 1324296 # Scores: V/M = 0.00 # Time range: 2023-05-07T14:14:41 to 2023-05-07T14:15:44 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 4 5512 # Exec time 57 18s 85us 54ms 3ms 6ms 2ms 3ms # Lock time 18 13ms 0 5ms 2us 1us 62us 1us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 0 0 0 0 0 0 0 0 # Query size 19 1.14M 182 218 216.34 212.52 5.34 212.52 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # # 100us #### # 1ms ################################################################ # 10ms # # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G INSERT INTO latest_visit_history (player_id, tenant_id, competition_id, created_at) VALUES ('1e434e8db', 54, '01GZV916Q4JSGX8BAFF3N4S4Q3', 1683468886) ON DUPLICATE KEY UPDATE `created_at` = 1683468886\G # Query 2: 150.38 QPS, 0.06x concurrency, ID 0x731A1F4786F770DE31CE879DB79AA27F at byte 8771018 # Scores: V/M = 0.00 # Time range: 2023-05-07T14:14:40 to 2023-05-07T14:15:44 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 8 9624 # Exec time 11 4s 115us 35ms 366us 467us 836us 224us # Lock time 19 14ms 0 135us 1us 1us 2us 1us # Rows sent 98 1.70M 0 4.88k 184.87 183.58 649.15 76.28 # Rows examine 33 1.70M 0 4.88k 184.87 183.58 649.15 76.28 # Query size 20 1.17M 124 144 127.73 143.84 5.77 124.25 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us ################################################################ # 1ms # # 10ms # # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT player_id, created_at AS min_created_at FROM latest_visit_history WHERE tenant_id = 1 AND competition_id = '4447b4e1'\G # Query 3: 608.29 QPS, 0.04x concurrency, ID 0xDA556F9115773A1A99AA0165670CE848 at byte 18250887 # Scores: V/M = 0.00 # Time range: 2023-05-07T14:14:39 to 2023-05-07T14:15:44 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 32 39539 # Exec time 9 3s 24us 17ms 70us 98us 155us 57us # 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.13M 30 30 30 30 0 30 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us ### # 1ms # # 10ms # # 100ms # 1s # 10s+ administrator command: Prepare\G # Query 4: 0 QPS, 0x concurrency, ID 0x3289E87E94D5A82E348974B3D332E575 at byte 662 # Scores: V/M = 0.00 # Time range: all events occurred at 2023-05-07T14:14:37 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 1 # Exec time 8 2s 2s 2s 2s 2s 0 2s # Lock time 0 7us 7us 7us 7us 7us 0 7us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 61 3.08M 3.08M 3.08M 3.08M 3.08M 0 3.08M # Query size 0 58 58 58 58 58 0 58 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s ################################################################ # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G DELETE FROM visit_history WHERE created_at >= '1654041600'\G # Converted for EXPLAIN # EXPLAIN /*!50100 PARTITIONS*/ select * from visit_history WHERE created_at >= '1654041600'\G # Query 5: 294.98 QPS, 0.03x concurrency, ID 0x57AC6CF9E75AF6673635BEFFE5F2117E at byte 18254976 # Scores: V/M = 0.00 # Time range: 2023-05-07T14:14:40 to 2023-05-07T14:15:44 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 15 18879 # Exec time 6 2s 48us 9ms 106us 152us 155us 89us # Lock time 47 33ms 0 291us 1us 1us 5us 1us # Rows sent 1 18.44k 0 1 1.00 0.99 0.01 0.99 # Rows examine 0 18.44k 0 1 1.00 0.99 0.01 0.99 # Query size 16 968.19k 42 57 52.51 56.92 4.98 51.63 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us ########################### # 1ms # # 10ms # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'tenant'\G # SHOW CREATE TABLE `isuports`.`tenant`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT * FROM tenant WHERE name = 'uqvn-ye-1683468894'\G # Query 6: 0 QPS, 0x concurrency, ID 0xD8D99DA87D548EEB1C1FF31A4382E239 at byte 1932 # Scores: V/M = 0.00 # Time range: all events occurred at 2023-05-07T14:14:39 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 1 # Exec time 3 1s 1s 1s 1s 1s 0 1s # Lock time 0 7us 7us 7us 7us 7us 0 7us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 3 195.78k 195.78k 195.78k 195.78k 195.78k 0 195.78k # Query size 0 121 121 121 121 121 0 121 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s ################################################################ # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G # SHOW TABLE STATUS FROM `isuports` LIKE 'init_latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`init_latest_visit_history`\G INSERT INTO `latest_visit_history` SELECT tenant_id, competition_id, player_id, created_at FROM init_latest_visit_history\G ```

563ed616750a1efc1dddd7f821d32865c26202fa

karamaru-alpha commented 1 year ago

ranking 23846

kataribe ``` sudo cat /var/log/nginx/access.log | kataribe -f /home/isucon/webapp/kataribe.toml Top 20 Sort By Count Count Total Mean Min Max Request 11870 1779.559 0.1499 0.001 6.287 GET /api/player/player/* 5469 1523.348 0.2785 0.001 5.986 GET /api/player/competition/*/ranking 852 60.291 0.0708 0.000 1.400 GET /api/player/competitions HTTP/2.0 162 23.240 0.1435 0.001 0.672 POST /api/organizer/competition/*/score 142 9.991 0.0704 0.001 1.179 POST /api/organizer/competitions/add HTTP/2.0 136 28.232 0.2076 0.001 2.836 POST /api/organizer/competition/*/finish 127 7.786 0.0613 0.001 0.742 GET /api/organizer/players HTTP/2.0 115 58.767 0.5110 0.002 3.980 GET /api/organizer/billing HTTP/2.0 73 92.441 1.2663 0.001 20.837 GET /api/admin/tenants/billing?before=* 26 74.625 2.8702 0.952 9.706 POST /api/organizer/players/add HTTP/2.0 17 0.887 0.0522 0.001 0.351 POST /api/organizer/player/*/disqualified 16 2.227 0.1392 0.001 0.910 POST /api/admin/tenants/add HTTP/2.0 6 1.413 0.2355 0.041 1.004 GET /api/admin/tenants/billing HTTP/2.0 2 4.003 2.0015 0.000 4.003 POST /initialize HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 Top 20 Sort By Total Count Total Mean Min Max Request 11870 1779.559 0.1499 0.001 6.287 GET /api/player/player/* 5469 1523.348 0.2785 0.001 5.986 GET /api/player/competition/*/ranking 73 92.441 1.2663 0.001 20.837 GET /api/admin/tenants/billing?before=* 26 74.625 2.8702 0.952 9.706 POST /api/organizer/players/add HTTP/2.0 852 60.291 0.0708 0.000 1.400 GET /api/player/competitions HTTP/2.0 115 58.767 0.5110 0.002 3.980 GET /api/organizer/billing HTTP/2.0 136 28.232 0.2076 0.001 2.836 POST /api/organizer/competition/*/finish 162 23.240 0.1435 0.001 0.672 POST /api/organizer/competition/*/score 142 9.991 0.0704 0.001 1.179 POST /api/organizer/competitions/add HTTP/2.0 127 7.786 0.0613 0.001 0.742 GET /api/organizer/players HTTP/2.0 2 4.003 2.0015 0.000 4.003 POST /initialize HTTP/2.0 16 2.227 0.1392 0.001 0.910 POST /api/admin/tenants/add HTTP/2.0 6 1.413 0.2355 0.041 1.004 GET /api/admin/tenants/billing HTTP/2.0 17 0.887 0.0522 0.001 0.351 POST /api/organizer/player/*/disqualified 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 Top 20 Sort By Mean Count Total Mean Min Max Request 26 74.625 2.8702 0.952 9.706 POST /api/organizer/players/add HTTP/2.0 2 4.003 2.0015 0.000 4.003 POST /initialize HTTP/2.0 73 92.441 1.2663 0.001 20.837 GET /api/admin/tenants/billing?before=* 115 58.767 0.5110 0.002 3.980 GET /api/organizer/billing HTTP/2.0 5469 1523.348 0.2785 0.001 5.986 GET /api/player/competition/*/ranking 6 1.413 0.2355 0.041 1.004 GET /api/admin/tenants/billing HTTP/2.0 136 28.232 0.2076 0.001 2.836 POST /api/organizer/competition/*/finish 11870 1779.559 0.1499 0.001 6.287 GET /api/player/player/* 162 23.240 0.1435 0.001 0.672 POST /api/organizer/competition/*/score 16 2.227 0.1392 0.001 0.910 POST /api/admin/tenants/add HTTP/2.0 852 60.291 0.0708 0.000 1.400 GET /api/player/competitions HTTP/2.0 142 9.991 0.0704 0.001 1.179 POST /api/organizer/competitions/add HTTP/2.0 127 7.786 0.0613 0.001 0.742 GET /api/organizer/players HTTP/2.0 17 0.887 0.0522 0.001 0.351 POST /api/organizer/player/*/disqualified 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 Top 20 Sort By Maximum(100 Percentile) Count Total Mean Min Max Request 73 92.441 1.2663 0.001 20.837 GET /api/admin/tenants/billing?before=* 26 74.625 2.8702 0.952 9.706 POST /api/organizer/players/add HTTP/2.0 11870 1779.559 0.1499 0.001 6.287 GET /api/player/player/* 5469 1523.348 0.2785 0.001 5.986 GET /api/player/competition/*/ranking 2 4.003 2.0015 0.000 4.003 POST /initialize HTTP/2.0 115 58.767 0.5110 0.002 3.980 GET /api/organizer/billing HTTP/2.0 136 28.232 0.2076 0.001 2.836 POST /api/organizer/competition/*/finish 852 60.291 0.0708 0.000 1.400 GET /api/player/competitions HTTP/2.0 142 9.991 0.0704 0.001 1.179 POST /api/organizer/competitions/add HTTP/2.0 6 1.413 0.2355 0.041 1.004 GET /api/admin/tenants/billing HTTP/2.0 16 2.227 0.1392 0.001 0.910 POST /api/admin/tenants/add HTTP/2.0 127 7.786 0.0613 0.001 0.742 GET /api/organizer/players HTTP/2.0 162 23.240 0.1435 0.001 0.672 POST /api/organizer/competition/*/score 17 0.887 0.0522 0.001 0.351 POST /api/organizer/player/*/disqualified 1 0.001 0.0010 0.001 0.001 GET /api/organizer/competitions HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /js/app.3a4ec98c.js HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /css/app.83b4c321.css HTTP/2.0 1 0.000 0.0000 0.000 0.000 GET /index.html HTTP/2.0 TOP 10 Slow Requests 1 20.837 GET /api/admin/tenants/billing?before=62 HTTP/2.0 2 16.943 GET /api/admin/tenants/billing?before=49 HTTP/2.0 3 10.268 GET /api/admin/tenants/billing?before=49 HTTP/2.0 4 9.706 POST /api/organizer/players/add HTTP/2.0 5 7.651 POST /api/organizer/players/add HTTP/2.0 6 6.287 GET /api/player/player/5edecb738 HTTP/2.0 7 5.986 GET /api/player/competition/01H0DHJWFV76FH323RAQ2PXRX0/ranking HTTP/2.0 8 5.575 GET /api/admin/tenants/billing?before=52 HTTP/2.0 9 5.512 GET /api/player/player/623354f5d HTTP/2.0 10 5.369 GET /api/player/competition/01H0DHKRWZQQZGDQTS4NF2SVKQ/ranking HTTP/2.0 ```
slow-log ``` sudo /home/isucon/webapp/slow.sh /var/log/mysql/slow-query.log # Query 1: 83.89 QPS, 0.26x concurrency, ID 0x717868DB0FF4601C650032A81060D41E at byte 17888537 # Scores: V/M = 0.00 # Time range: 2023-05-14T16:30:26 to 2023-05-14T16:31:31 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 3 5453 # Exec time 53 17s 80us 50ms 3ms 6ms 3ms 3ms # Lock time 9 8ms 0 33us 1us 1us 1us 1us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 0 0 0 0 0 0 0 0 # Query size 15 1.13M 182 218 216.43 212.52 5.50 212.52 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # # 100us ##### # 1ms ################################################################ # 10ms # # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G INSERT INTO latest_visit_history (player_id, tenant_id, competition_id, created_at) VALUES ('01H0DHK247VP8SFVZNPGMV174E', 569, '01H0DHKB3H3GDWDX1T273K2AST', 1684081855) ON DUPLICATE KEY UPDATE `created_at` = 1684081855\G # Query 2: 718.75 QPS, 0.05x concurrency, ID 0xDA556F9115773A1A99AA0165670CE848 at byte 27046777 # Scores: V/M = 0.00 # Time range: 2023-05-14T16:30:24 to 2023-05-14T16:31:31 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 33 48156 # Exec time 10 3s 26us 9ms 65us 89us 91us 57us # 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.38M 30 30 30 30 0 30 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us ## # 1ms # # 10ms # 100ms # 1s # 10s+ administrator command: Prepare\G # Query 3: 132.14 QPS, 0.05x concurrency, ID 0x731A1F4786F770DE31CE879DB79AA27F at byte 8212498 # Scores: V/M = 0.00 # Time range: 2023-05-14T16:30:25 to 2023-05-14T16:31:30 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 5 8589 # Exec time 10 3s 104us 20ms 367us 424us 828us 204us # Lock time 15 12ms 0 420us 1us 1us 4us 1us # Rows sent 98 1.75M 0 4.89k 213.23 183.58 714.34 84.10 # Rows examine 34 1.75M 0 4.89k 213.23 183.58 714.34 84.10 # Query size 14 1.03M 124 144 126.23 124.25 2.58 124.25 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us ################################################################ # 1ms ## # 10ms # # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'latest_visit_history'\G # SHOW CREATE TABLE `isuports`.`latest_visit_history`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT player_id, created_at AS min_created_at FROM latest_visit_history WHERE tenant_id = 1 AND competition_id = '547f03113'\G # Query 4: 0 QPS, 0x concurrency, ID 0x3289E87E94D5A82E348974B3D332E575 at byte 662 # Scores: V/M = 0.00 # Time range: all events occurred at 2023-05-14T16:30:23 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 1 # Exec time 7 2s 2s 2s 2s 2s 0 2s # Lock time 0 8us 8us 8us 8us 8us 0 8us # Rows sent 0 0 0 0 0 0 0 0 # Rows examine 60 3.08M 3.08M 3.08M 3.08M 3.08M 0 3.08M # Query size 0 58 58 58 58 58 0 58 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us # 100us # 1ms # 10ms # 100ms # 1s ################################################################ # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'visit_history'\G # SHOW CREATE TABLE `isuports`.`visit_history`\G DELETE FROM visit_history WHERE created_at >= '1654041600'\G # Converted for EXPLAIN # EXPLAIN /*!50100 PARTITIONS*/ select * from visit_history WHERE created_at >= '1654041600'\G # Query 5: 291.03 QPS, 0.03x concurrency, ID 0x57AC6CF9E75AF6673635BEFFE5F2117E at byte 22839287 # Scores: V/M = 0.00 # Time range: 2023-05-14T16:30:25 to 2023-05-14T16:31:30 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 12 18917 # Exec time 6 2s 49us 9ms 100us 144us 131us 84us # Lock time 46 36ms 0 4ms 1us 1us 30us 1us # Rows sent 1 18.47k 0 1 1.00 0.99 0.01 0.99 # Rows examine 0 18.47k 0 1 1.00 0.99 0.01 0.99 # Query size 13 975.54k 42 58 52.81 56.92 4.30 51.63 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################################################ # 100us ################### # 1ms # # 10ms # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'tenant'\G # SHOW CREATE TABLE `isuports`.`tenant`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT * FROM tenant WHERE name = 'kwpbq-awnl-1684081832'\G # Query 6: 147.65 QPS, 0.02x concurrency, ID 0x6490BDC2BF440C55D94FF35EE9D3FF80 at byte 4409038 # Scores: V/M = 0.00 # Time range: 2023-05-14T16:30:25 to 2023-05-14T16:31:30 # Attribute pct total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 6 9597 # Exec time 3 1s 71us 8ms 117us 159us 112us 103us # Lock time 17 13ms 0 210us 1us 1us 2us 1us # Rows sent 0 1008 0 1 0.11 0.99 0.30 0 # Rows examine 0 1008 0 1 0.11 0.99 0.30 0 # Query size 11 862.98k 88 108 92.08 107.34 6.02 88.31 # String: # Databases isuports # Hosts localhost # Users isucon # Query_time distribution # 1us # 10us ################################ # 100us ################################################################ # 1ms # # 10ms # 100ms # 1s # 10s+ # Tables # SHOW TABLE STATUS FROM `isuports` LIKE 'billing_report'\G # SHOW CREATE TABLE `isuports`.`billing_report`\G # EXPLAIN /*!50100 PARTITIONS*/ SELECT * FROM billing_report WHERE tenant_id = 15 AND competition_id = '4c1d8a5a8' LIMIT 1\G ```

560bb997634feb1f8673f121ec104673877095cd