Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Score log #1

Open
zono opened this issue Sep 26, 2021 · 9 comments
Open

Score log #1

zono opened this issue Sep 26, 2021 · 9 comments

Comments

@zono
Copy link
Owner

zono commented Sep 26, 2021

Initial score. 8c2d100

score

score: 1402(1438 - 36) : pass
deduction: 0 / timeout: 364

top

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
 190249 mysql     20   0 1713420 126116  11744 S  73.4   3.3   1:26.76 mysqld
 212863 isucon    20   0 1372068 144984  11548 S  43.9   3.8   0:16.23 bench
 212664 isucon    20   0 1526580  29908   7632 S  40.5   0.8   0:27.59 isucondition
    162 root      19  -1  303276 123968 122668 S  13.3   3.3   0:07.85 systemd-journal
 188178 www-data  20   0   16616   9200   4116 S  12.6   0.2   0:09.35 nginx
 188179 www-data  20   0   14728   7276   4116 S   7.0   0.2   0:03.13 nginx
    520 syslog    20   0  224500   4860   3416 S   5.6   0.1   0:03.58 rsyslogd
@zono
Copy link
Owner Author

zono commented Sep 26, 2021

Add alp config. edec253

score

10:51:00.631516 score: 1491(1528 - 37) : pass
10:51:00.631577 deduction: 0 / timeout: 372

top

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
 190249 mysql     20   0 1713420 165292  12020 S  75.1   4.3   4:05.81 mysqld
 213250 isucon    20   0 1445800 156004  11440 S  44.2   4.1   0:16.84 bench
 213202 isucon    20   0 1599352  25612   7828 S  39.2   0.7   0:03.86 isucondition
 213243 www-data  20   0   12504   9352   4968 S  13.6   0.2   0:01.36 nginx
    162 root      19  -1  319932 173948 172632 S  13.3   4.6   0:20.67 systemd-journal
 213244 www-data  20   0   11140   7656   4968 S   6.0   0.2   0:00.62 nginx
    520 syslog    20   0  224500   5076   3416 S   5.6   0.1   0:10.02 rsyslogd

alp

+-------+--------+------------------------------+-------+-------+---------+-------+-------+
| COUNT | METHOD |             URI              |  MIN  |  MAX  |   SUM   |  AVG  |  P99  |
+-------+--------+------------------------------+-------+-------+---------+-------+-------+
| 69454 | POST   | /api/condition/[-a-z0-9]+    | 0.020 | 0.232 | 706.684 | 0.010 | 0.104 |
|   403 | GET    | /api/isu                     | 0.004 | 3.000 | 342.580 | 0.850 | 1.012 |
|   530 | GET    | /api/isu/.+/icon             | 0.004 | 1.812 |  93.848 | 0.177 | 1.008 |
|   156 | GET    | /api/condition/[-a-z0-9]+    | 1.000 | 1.004 |  28.992 | 0.186 | 1.004 |
|    35 | GET    | /api/trend                   | 0.028 | 1.020 |  27.828 | 0.795 | 1.020 |
|   126 | POST   | /api/auth                    | 0.004 | 3.004 |  25.176 | 0.200 | 3.000 |
|    80 | GET    | /api/isu/.+/graph            | 1.000 | 1.004 |  14.092 | 0.176 | 1.004 |
|   130 | GET    | /api/isu/[-a-z0-9]+          | 3.004 | 3.004 |  13.328 | 0.103 | 1.000 |
|    55 | POST   | /api/isu                     | 0.004 | 0.116 |   4.208 | 0.077 | 0.116 |
|    39 | GET    | /api/user/me                 | 0.000 | 0.632 |   0.920 | 0.024 | 0.632 |
|    23 | POST   | /api/signout                 | 0.004 | 0.088 |   0.312 | 0.014 | 0.088 |
|    81 | GET    | /assets/favicon.d0f5f504.svg | 0.004 | 0.020 |   0.256 | 0.003 | 0.020 |
|    81 | GET    | /assets/vendor.ee7444dd.js   | 0.004 | 0.020 |   0.240 | 0.003 | 0.020 |
|    81 | GET    | /assets/index.23dac98b.js    | 0.004 | 0.012 |   0.196 | 0.002 | 0.012 |
|     1 | POST   | /initialize                  | 0.164 | 0.164 |   0.164 | 0.164 | 0.164 |
|    81 | GET    | /assets/index.144d8ca8.css   | 0.004 | 0.012 |   0.148 | 0.002 | 0.012 |
|    48 | GET    | /                            | 0.004 | 0.012 |   0.124 | 0.003 | 0.012 |
|    81 | GET    | /assets/logo_white.svg       | 0.000 | 0.008 |   0.104 | 0.001 | 0.008 |
|    37 | GET    | /assets/logo_orange.svg      | 0.000 | 0.008 |   0.096 | 0.003 | 0.008 |
|    21 | GET    | /?jwt=                       | 0.000 | 0.012 |   0.056 | 0.003 | 0.012 |
|    30 | GET    | /isu/........-....-.+        | 0.000 | 0.004 |   0.004 | 0.000 | 0.004 |
|     3 | GET    | /register                    | 0.000 | 0.004 |   0.004 | 0.001 | 0.004 |
+-------+--------+------------------------------+-------+-------+---------+-------+-------+

@zono
Copy link
Owner Author

zono commented Sep 26, 2021

Add slow query log config. 9baa333

score

10:58:08.865705 score: 1458(1494 - 36) : pass
10:58:08.865788 deduction: 0 / timeout: 361

top

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
 213512 mysql     20   0 1716196 113664  18628 S  72.1   3.0   0:04.98 mysqld
 213593 isucon    20   0 1371748 145284  11552 S  41.2   3.8   0:16.17 bench
 213425 isucon    20   0 1451888  23304   7828 S  40.5   0.6   0:03.40 isucondition
    162 root      19  -1  438656 280428 279108 S  15.6   7.4   0:26.35 systemd-journal
 213584 www-data  20   0   12852   9464   4964 S  12.0   0.2   0:01.13 nginx
 213585 www-data  20   0   10712   7228   4964 S   8.3   0.2   0:00.61 nginx
    520 syslog    20   0  224500   5080   3416 S   6.0   0.1   0:13.06 rsyslogd

alp

+-------+--------+------------------------------+-------+-------+---------+-------+-------+
| COUNT | METHOD |             URI              |  MIN  |  MAX  |   SUM   |  AVG  |  P99  |
+-------+--------+------------------------------+-------+-------+---------+-------+-------+
| 69391 | POST   | /api/condition/[-a-z0-9]+    | 0.000 | 0.244 | 724.093 | 0.010 | 0.104 |
|   402 | GET    | /api/isu                     | 0.132 | 3.004 | 338.503 | 0.842 | 1.016 |
|   630 | GET    | /api/isu/.+/icon             | 3.000 | 3.000 | 110.799 | 0.176 | 1.004 |
|   196 | GET    | /api/condition/[-a-z0-9]+    | 1.004 | 1.564 |  38.600 | 0.197 | 1.004 |
|    32 | GET    | /api/trend                   | 0.020 | 1.016 |  24.928 | 0.779 | 1.016 |
|   130 | POST   | /api/auth                    | 0.004 | 3.020 |  14.645 | 0.113 | 2.992 |
|   149 | GET    | /api/isu/[-a-z0-9]+          | 1.396 | 1.396 |  14.084 | 0.095 | 1.004 |
|    88 | GET    | /api/isu/.+/graph            | 1.000 | 1.009 |  13.165 | 0.150 | 1.009 |
|    55 | POST   | /api/isu                     | 0.056 | 0.148 |   4.084 | 0.074 | 0.148 |
|    37 | GET    | /api/user/me                 | 0.004 | 1.000 |   2.452 | 0.066 | 1.000 |
|   100 | GET    | /assets/logo_white.svg       | 0.000 | 1.001 |   1.109 | 0.011 | 0.012 |
|    22 | POST   | /api/signout                 | 0.000 | 0.276 |   0.464 | 0.021 | 0.276 |
|   100 | GET    | /assets/vendor.ee7444dd.js   | 0.000 | 0.024 |   0.216 | 0.002 | 0.016 |
|   100 | GET    | /assets/favicon.d0f5f504.svg | 0.000 | 0.020 |   0.200 | 0.002 | 0.020 |
|     1 | POST   | /initialize                  | 0.200 | 0.200 |   0.200 | 0.200 | 0.200 |
|   100 | GET    | /assets/index.23dac98b.js    | 0.000 | 0.020 |   0.156 | 0.002 | 0.008 |
|   100 | GET    | /assets/index.144d8ca8.css   | 0.000 | 0.020 |   0.152 | 0.002 | 0.016 |
|    47 | GET    | /                            | 0.000 | 0.008 |   0.080 | 0.002 | 0.008 |
|    35 | GET    | /assets/logo_orange.svg      | 0.000 | 0.016 |   0.068 | 0.002 | 0.016 |
|    20 | GET    | /?jwt=                       | 0.000 | 0.012 |   0.064 | 0.003 | 0.012 |
|    50 | GET    | /isu/........-....-.+        | 0.000 | 0.004 |   0.012 | 0.000 | 0.004 |
|     3 | GET    | /register                    | 0.000 | 0.000 |   0.000 | 0.000 | 0.000 |
+-------+--------+------------------------------+-------+-------+---------+-------+-------+

mysqldumpslow

Count: 2504  Time=0.16s (405s)  Lock=0.00s (0s)  Rows_sent=1.0 (2483), Rows_examined=40767.5 (102081883), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY `timestamp` DESC LIMIT N

Count: 1721  Time=0.08s (129s)  Lock=0.00s (0s)  Rows_sent=246.2 (423744), Rows_examined=18328.1 (31542676), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY timestamp DESC

Count: 7035  Time=0.01s (38s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=0.0 (0), isucon[isucon]@localhost
  COMMIT

Count: 4016  Time=0.00s (11s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=0.0 (0), isucon[isucon]@localhost
  #

Count: 2304  Time=0.00s (10s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=1.0 (2304), isucon[isucon]@localhost
  INSERT INTO `isu_condition`	(`jia_isu_uuid`, `timestamp`, `is_sitting`, `condition`, `message`)	VALUES ('S', 'S', N, 'S', 'S')

Count: 102  Time=0.04s (4s)  Lock=0.00s (0s)  Rows_sent=91.0 (9282), Rows_examined=7201.6 (734561), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S'	AND `timestamp` < 'S'	ORDER BY `timestamp` DESC

Count: 29  Time=0.04s (1s)  Lock=0.00s (0s)  Rows_sent=142.6 (4135), Rows_examined=7799.1 (226174), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY `timestamp` ASC

@zono
Copy link
Owner Author

zono commented Sep 26, 2021

Add pprof configs. 4366fda

score

11:06:16.017119 score: 1386(1422 - 36) : pass
11:06:16.017138 deduction: 0 / timeout: 365

top

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
 214962 mysql     20   0 1716196 115380  18644 S  79.3   3.0   0:07.15 mysqld
 215045 isucon    20   0 1371876 142760  11380 S  44.3   3.7   0:17.41 bench
 214862 isucon    20   0 1231196  27900   8144 S  38.0   0.7   0:04.27 isucondition
 215038 www-data  20   0   13188   9780   4968 S  13.0   0.3   0:01.52 nginx
    162 root      19  -1  303864 160416 159064 S  12.3   4.2   0:33.22 systemd-journal
 215037 www-data  20   0   10532   7404   4968 S   5.7   0.2   0:00.69 nginx
    520 syslog    20   0  224500   5080   3416 S   5.0   0.1   0:16.38 rsyslogd

alp

+-------+--------+------------------------------+-------+-------+---------+-------+-------+
| COUNT | METHOD |             URI              |  MIN  |  MAX  |   SUM   |  AVG  |  P99  |
+-------+--------+------------------------------+-------+-------+---------+-------+-------+
| 69306 | POST   | /api/condition/[-a-z0-9]+    | 0.004 | 0.236 | 728.288 | 0.011 | 0.104 |
|   397 | GET    | /api/isu                     | 0.316 | 3.004 | 336.069 | 0.847 | 1.024 |
|   561 | GET    | /api/isu/.+/icon             | 3.000 | 3.000 | 114.686 | 0.204 | 1.004 |
|   175 | GET    | /api/condition/[-a-z0-9]+    | 1.000 | 1.008 |  40.532 | 0.232 | 1.004 |
|    35 | GET    | /api/trend                   | 0.024 | 1.021 |  27.921 | 0.798 | 1.021 |
|   139 | GET    | /api/isu/[-a-z0-9]+          | 1.864 | 3.000 |  20.248 | 0.146 | 3.000 |
|   136 | POST   | /api/auth                    | 0.004 | 2.996 |  13.797 | 0.101 | 1.520 |
|    75 | GET    | /api/isu/.+/graph            | 1.000 | 1.004 |  10.701 | 0.143 | 1.004 |
|    55 | POST   | /api/isu                     | 0.056 | 0.160 |   4.024 | 0.073 | 0.160 |
|    28 | POST   | /api/signout                 | 0.000 | 1.000 |   1.968 | 0.070 | 1.000 |
|    46 | GET    | /api/user/me                 | 0.000 | 0.252 |   0.784 | 0.017 | 0.252 |
|     1 | POST   | /initialize                  | 0.220 | 0.220 |   0.220 | 0.220 | 0.220 |
|    82 | GET    | /assets/favicon.d0f5f504.svg | 0.004 | 0.016 |   0.184 | 0.002 | 0.016 |
|    82 | GET    | /assets/vendor.ee7444dd.js   | 0.000 | 0.016 |   0.172 | 0.002 | 0.016 |
|    82 | GET    | /assets/logo_white.svg       | 0.000 | 0.016 |   0.148 | 0.002 | 0.016 |
|    82 | GET    | /assets/index.144d8ca8.css   | 0.004 | 0.016 |   0.144 | 0.002 | 0.016 |
|    82 | GET    | /assets/index.23dac98b.js    | 0.004 | 0.016 |   0.120 | 0.001 | 0.016 |
|    49 | GET    | /                            | 0.000 | 0.016 |   0.108 | 0.002 | 0.016 |
|    37 | GET    | /assets/logo_orange.svg      | 0.000 | 0.016 |   0.104 | 0.003 | 0.016 |
|    24 | GET    | /?jwt=                       | 0.000 | 0.008 |   0.012 | 0.001 | 0.008 |
|    30 | GET    | /isu/........-....-.+        | 0.000 | 0.004 |   0.004 | 0.000 | 0.004 |
|     3 | GET    | /register                    | 0.000 | 0.000 |   0.000 | 0.000 | 0.000 |
+-------+--------+------------------------------+-------+-------+---------+-------+-------+

mysqldumpslow

Count: 2503  Time=0.16s (397s)  Lock=0.00s (0s)  Rows_sent=1.0 (2484), Rows_examined=40465.2 (101284315), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY `timestamp` DESC LIMIT N

Count: 1877  Time=0.08s (144s)  Lock=0.00s (0s)  Rows_sent=251.8 (472671), Rows_examined=18193.5 (34149146), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY timestamp DESC

Count: 7001  Time=0.01s (37s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=0.0 (0), isucon[isucon]@localhost
  COMMIT

Count: 4152  Time=0.00s (11s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=0.0 (0), isucon[isucon]@localhost
  #

Count: 2048  Time=0.00s (9s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=1.0 (2048), isucon[isucon]@localhost
  INSERT INTO `isu_condition`	(`jia_isu_uuid`, `timestamp`, `is_sitting`, `condition`, `message`)	VALUES ('S', 'S', N, 'S', 'S')

Count: 84  Time=0.04s (3s)  Lock=0.00s (0s)  Rows_sent=83.3 (6995), Rows_examined=8261.5 (693966), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S'	AND `timestamp` < 'S'	ORDER BY `timestamp` DESC

Count: 25  Time=0.04s (0s)  Lock=0.00s (0s)  Rows_sent=116.6 (2916), Rows_examined=6862.1 (171553), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY `timestamp` ASC

pprof

スクリーンショット 2021-09-26 20 12 57

スクリーンショット 2021-09-26 20 17 28

@zono
Copy link
Owner Author

zono commented Sep 26, 2021

Change primary key. f774677

score

11:23:07.713185 score: 17340(17342 - 2) : pass
11:23:07.713191 deduction: 0 / timeout: 21

top

215310 isucon    20   0 1673844  24988   8208 S  56.8   0.7   0:06.20 isucondition
215396 mysql     20   0 1716200 117328  18840 S  50.5   3.1   0:05.83 mysqld
215480 isucon    20   0 1593200 181404  11736 S  42.5   4.8   0:17.70 bench
215474 www-data  20   0   13352   9868   4980 S  15.3   0.3   0:01.85 nginx
   162 root      19  -1  304204 158200 156848 S  12.0   4.1   0:39.79 systemd-journal
215473 www-data  20   0   11360   7964   4980 S  10.0   0.2   0:01.07 nginx
   520 syslog    20   0  224500   5084   3416 S   7.6   0.1   0:19.74 rsyslogd

alp

+-------+--------+------------------------------+-------+-------+---------+-------+-------+
| COUNT | METHOD |             URI              |  MIN  |  MAX  |   SUM   |  AVG  |  P99  |
+-------+--------+------------------------------+-------+-------+---------+-------+-------+
| 72879 | POST   | /api/condition/[-a-z0-9]+    | 0.004 | 0.232 | 996.943 | 0.014 | 0.100 |
|  3127 | GET    | /api/condition/[-a-z0-9]+    | 0.024 | 0.412 | 213.181 | 0.068 | 0.224 |
|  3947 | GET    | /api/isu/.+/icon             | 0.004 | 0.408 | 203.224 | 0.051 | 0.188 |
|   130 | GET    | /api/trend                   | 0.016 | 1.068 | 122.061 | 0.939 | 1.012 |
|   963 | GET    | /api/isu/.+/graph            | 0.004 | 0.480 |  56.437 | 0.059 | 0.212 |
|   591 | GET    | /api/isu                     | 0.004 | 0.368 |  39.720 | 0.067 | 0.212 |
|   687 | GET    | /api/isu/[-a-z0-9]+          | 0.008 | 0.304 |  27.058 | 0.039 | 0.192 |
|   582 | POST   | /api/auth                    | 0.008 | 0.228 |  11.500 | 0.020 | 0.100 |
|   251 | GET    | /api/user/me                 | 0.000 | 0.356 |   4.112 | 0.016 | 0.100 |
|    55 | POST   | /api/isu                     | 0.056 | 0.140 |   4.044 | 0.074 | 0.140 |
|   146 | POST   | /api/signout                 | 0.004 | 0.132 |   2.876 | 0.020 | 0.104 |
|   230 | GET    | /assets/vendor.ee7444dd.js   | 0.012 | 0.056 |   1.496 | 0.007 | 0.040 |
|   230 | GET    | /assets/favicon.d0f5f504.svg | 0.012 | 0.048 |   1.392 | 0.006 | 0.028 |
|   230 | GET    | /assets/index.23dac98b.js    | 0.008 | 0.068 |   1.308 | 0.006 | 0.028 |
|   230 | GET    | /assets/logo_white.svg       | 0.004 | 0.032 |   1.216 | 0.005 | 0.032 |
|   230 | GET    | /assets/index.144d8ca8.css   | 0.004 | 0.028 |   1.052 | 0.005 | 0.024 |
|   177 | GET    | /                            | 0.004 | 0.044 |   1.028 | 0.006 | 0.032 |
|   132 | GET    | /assets/logo_orange.svg      | 0.004 | 0.036 |   0.908 | 0.007 | 0.032 |
|   110 | GET    | /?jwt=                       | 0.008 | 0.056 |   0.764 | 0.007 | 0.036 |
|     1 | POST   | /initialize                  | 0.176 | 0.176 |   0.176 | 0.176 | 0.176 |
|    50 | GET    | /isu/........-....-.+        | 0.000 | 0.004 |   0.020 | 0.000 | 0.004 |
|     3 | GET    | /register                    | 0.000 | 0.000 |   0.000 | 0.000 | 0.000 |
+-------+--------+------------------------------+-------+-------+---------+-------+-------+

mysqldumpslow

Count: 7280  Time=0.00s (32s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=0.0 (0), isucon[isucon]@localhost
  COMMIT

Count: 4768  Time=0.00s (22s)  Lock=0.00s (0s)  Rows_sent=538.2 (2566154), Rows_examined=538.2 (2566142), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY timestamp DESC

Count: 1897  Time=0.00s (8s)  Lock=0.00s (0s)  Rows_sent=668.1 (1267352), Rows_examined=668.1 (1267352), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S'	AND `timestamp` < 'S'	ORDER BY `timestamp` DESC

Count: 1317  Time=0.00s (4s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=0.0 (0), isucon[isucon]@localhost
  #

Count: 1064  Time=0.00s (3s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=1.0 (1064), isucon[isucon]@localhost
  INSERT INTO `isu_condition`	(`jia_isu_uuid`, `timestamp`, `is_sitting`, `condition`, `message`)	VALUES ('S', 'S', N, 'S', 'S')

Count: 541  Time=0.00s (1s)  Lock=0.00s (0s)  Rows_sent=880.4 (476292), Rows_examined=880.4 (476292), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY `timestamp` ASC

Count: 110  Time=0.00s (0s)  Lock=0.00s (0s)  Rows_sent=3.0 (330), Rows_examined=30.4 (3341), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu` WHERE `character` = 'S'

pprof

スクリーンショット 2021-09-26 20 28 05

スクリーンショット 2021-09-26 20 28 23

スクリーンショット 2021-09-26 20 51 35

@zono
Copy link
Owner Author

zono commented Sep 26, 2021

Add bulk commit. cf34fe4

score

11:56:29.229727 score: 18628(18630 - 2) : pass
11:56:29.229735 deduction: 0 / timeout: 22

top

PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
215774 isucon    20   0 1673620  22848   8476 S  55.8   0.6   0:04.53 isucondition
215861 mysql     20   0 1715896 119128  18868 S  44.2   3.1   0:04.03 mysqld
215948 isucon    20   0 1666932 182640  11380 S  41.9   4.8   0:16.61 bench
162 root      19  -1  431268 274128 272776 S  18.6   7.2   0:46.37 systemd-journal
215942 www-data  20   0   13284   9892   4932 S  15.3   0.3   0:01.37 nginx
215941 www-data  20   0   11220   7924   4932 S  11.3   0.2   0:00.96 nginx
520 syslog    20   0  224500   5064   3416 S   7.6   0.1   0:23.43 rsyslogd

alp

+-------+--------+------------------------------+-------+-------+----------+-------+-------+
| COUNT | METHOD |             URI              |  MIN  |  MAX  |   SUM    |  AVG  |  P99  |
+-------+--------+------------------------------+-------+-------+----------+-------+-------+
| 74416 | POST   | /api/condition/[-a-z0-9]+    | 0.004 | 0.164 | 1253.149 | 0.017 | 0.088 |
|  4765 | GET    | /api/isu/.+/icon             | 0.008 | 0.372 |  202.112 | 0.042 | 0.136 |
|  3455 | GET    | /api/condition/[-a-z0-9]+    | 0.004 | 0.284 |  200.944 | 0.058 | 0.180 |
|   160 | GET    | /api/trend                   | 0.020 | 1.016 |  148.176 | 0.926 | 1.016 |
|  1003 | GET    | /api/isu/.+/graph            | 0.008 | 0.240 |   54.952 | 0.055 | 0.164 |
|   702 | GET    | /api/isu                     | 0.096 | 0.272 |   46.540 | 0.066 | 0.200 |
|   795 | GET    | /api/isu/[-a-z0-9]+          | 0.004 | 0.216 |   27.296 | 0.034 | 0.128 |
|   623 | POST   | /api/auth                    | 0.004 | 0.256 |   14.552 | 0.023 | 0.096 |
|   312 | GET    | /api/user/me                 | 0.004 | 0.096 |    4.816 | 0.015 | 0.072 |
|    55 | POST   | /api/isu                     | 0.052 | 0.124 |    3.812 | 0.069 | 0.124 |
|   177 | POST   | /api/signout                 | 0.004 | 0.084 |    3.796 | 0.021 | 0.084 |
|   241 | GET    | /assets/vendor.ee7444dd.js   | 0.000 | 0.076 |    2.448 | 0.010 | 0.052 |
|   241 | GET    | /assets/favicon.d0f5f504.svg | 0.008 | 0.080 |    2.304 | 0.010 | 0.048 |
|   241 | GET    | /assets/index.23dac98b.js    | 0.004 | 0.080 |    2.192 | 0.009 | 0.048 |
|   241 | GET    | /assets/index.144d8ca8.css   | 0.008 | 0.076 |    2.064 | 0.009 | 0.048 |
|   208 | GET    | /                            | 0.000 | 0.076 |    2.008 | 0.010 | 0.048 |
|   241 | GET    | /assets/logo_white.svg       | 0.000 | 0.044 |    1.860 | 0.008 | 0.040 |
|   162 | GET    | /assets/logo_orange.svg      | 0.004 | 0.044 |    1.464 | 0.009 | 0.044 |
|   140 | GET    | /?jwt=                       | 0.004 | 0.040 |    1.364 | 0.010 | 0.036 |
|     1 | POST   | /initialize                  | 0.208 | 0.208 |    0.208 | 0.208 | 0.208 |
|    30 | GET    | /isu/........-....-.+        | 0.000 | 0.004 |    0.012 | 0.000 | 0.004 |
|     3 | GET    | /register                    | 0.004 | 0.004 |    0.004 | 0.001 | 0.004 |
+-------+--------+------------------------------+-------+-------+----------+-------+-------+

mysqldumpslow

Count: 7289  Time=0.00s (26s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=0.0 (0), isucon[isucon]@localhost
  COMMIT

Count: 4862  Time=0.00s (20s)  Lock=0.00s (0s)  Rows_sent=637.5 (3099623), Rows_examined=637.5 (3099537), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY timestamp DESC

Count: 2028  Time=0.00s (8s)  Lock=0.00s (0s)  Rows_sent=739.2 (1499023), Rows_examined=739.2 (1499023), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S'	AND `timestamp` < 'S'	ORDER BY `timestamp` DESC

Count: 615  Time=0.00s (2s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=0.0 (0), isucon[isucon]@localhost
  #

Count: 542  Time=0.00s (1s)  Lock=0.00s (0s)  Rows_sent=944.4 (511867), Rows_examined=944.4 (511867), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY `timestamp` ASC

Count: 255  Time=0.00s (0s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=10.0 (2550), isucon[isucon]@localhost
  INSERT INTO `isu_condition`       (`jia_isu_uuid`, `timestamp`, `is_sitting`, `condition`, `message`)       VALUES ('S', 'S', N, 'S', 'S'),('S', 'S', N, 'S', 'S'),('S', 'S', N, 'S', 'S'),('S', 'S', N, 'S', 'S'),('S', 'S', N, 'S', 'S'),('S', 'S', N, 'S', 'S'),('S', 'S', N, 'S', 'S'),('S', 'S', N, 'S', 'S'),('S', 'S', N, 'S', 'S'),('S', 'S', N, 'S', 'S')

Count: 65  Time=0.00s (0s)  Lock=0.00s (0s)  Rows_sent=0.9 (61), Rows_examined=0.9 (61), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY `timestamp` DESC LIMIT N

pprof

スクリーンショット 2021-09-26 20 58 40

スクリーンショット 2021-09-26 21 00 34

スクリーンショット 2021-09-26 21 02 44

@zono
Copy link
Owner Author

zono commented Sep 26, 2021

Add limit 1. d202960

score

12:50:56.875523 score: 23848(23850 - 2) : pass
12:50:56.875530 deduction: 0 / timeout: 21

top

PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
216240 isucon    20   0 1673876  22892   8492 S  58.1   0.6   0:05.81 isucondition
216326 mysql     20   0 1716396 119992  18420 S  45.5   3.1   0:05.09 mysqld
216412 isucon    20   0 1593200 190916  11632 S  42.9   5.0   0:17.58 bench
216405 www-data  20   0   13732  10524   4900 R  24.9   0.3   0:02.62 nginx
   162 root      19  -1  336080 189028 187676 S   9.0   5.0   0:51.79 systemd-journal
   520 syslog    20   0  224500   5128   3416 S   8.0   0.1   0:27.42 rsyslogd
216404 www-data  20   0   11272   7860   4900 R   6.0   0.2   0:00.66 nginx

alp

+-------+--------+------------------------------+-------+-------+---------+-------+-------+
| COUNT | METHOD |             URI              |  MIN  |  MAX  |   SUM   |  AVG  |  P99  |
+-------+--------+------------------------------+-------+-------+---------+-------+-------+
| 75753 | POST   | /api/condition/[-a-z0-9]+    | 0.001 | 0.112 | 882.003 | 0.012 | 0.056 |
|  9596 | GET    | /api/isu/.+/icon             | 0.004 | 0.128 | 236.610 | 0.025 | 0.072 |
|   270 | GET    | /api/trend                   | 0.020 | 1.024 | 167.482 | 0.620 | 1.016 |
|  4654 | GET    | /api/condition/[-a-z0-9]+    | 0.004 | 0.144 | 156.027 | 0.034 | 0.100 |
|  1355 | GET    | /api/isu                     | 0.004 | 0.180 |  61.181 | 0.045 | 0.128 |
|  1225 | GET    | /api/isu/.+/graph            | 0.012 | 0.124 |  40.796 | 0.033 | 0.104 |
|  1449 | GET    | /api/isu/[-a-z0-9]+          | 0.004 | 0.124 |  28.084 | 0.019 | 0.068 |
|   853 | POST   | /api/auth                    | 0.008 | 0.088 |  12.456 | 0.015 | 0.052 |
|   541 | GET    | /api/user/me                 | 0.004 | 0.060 |   5.608 | 0.010 | 0.044 |
|   297 | POST   | /api/signout                 | 0.004 | 0.088 |   4.293 | 0.014 | 0.064 |
|    55 | POST   | /api/isu                     | 0.056 | 0.156 |   3.964 | 0.072 | 0.156 |
|   362 | GET    | /assets/vendor.ee7444dd.js   | 0.004 | 0.044 |   2.796 | 0.008 | 0.032 |
|   362 | GET    | /assets/favicon.d0f5f504.svg | 0.000 | 0.040 |   2.516 | 0.007 | 0.032 |
|   362 | GET    | /assets/logo_white.svg       | 0.004 | 0.036 |   2.456 | 0.007 | 0.032 |
|   362 | GET    | /assets/index.23dac98b.js    | 0.000 | 0.036 |   2.416 | 0.007 | 0.032 |
|   362 | GET    | /assets/index.144d8ca8.css   | 0.000 | 0.032 |   2.276 | 0.006 | 0.028 |
|   272 | GET    | /assets/logo_orange.svg      | 0.004 | 0.036 |   2.156 | 0.008 | 0.032 |
|   329 | GET    | /                            | 0.004 | 0.040 |   2.028 | 0.006 | 0.028 |
|   249 | GET    | /?jwt=                       | 0.004 | 0.040 |   1.844 | 0.007 | 0.032 |
|     1 | POST   | /initialize                  | 0.224 | 0.224 |   0.224 | 0.224 | 0.224 |
|    30 | GET    | /isu/........-....-.+        | 0.000 | 0.004 |   0.008 | 0.000 | 0.004 |
|     3 | GET    | /register                    | 0.004 | 0.004 |   0.008 | 0.003 | 0.004 |
+-------+--------+------------------------------+-------+-------+---------+-------+-------+

mysqldumpslow

Count: 7478  Time=0.00s (25s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=0.0 (0), isucon[isucon]@localhost
  COMMIT

Count: 2819  Time=0.00s (10s)  Lock=0.00s (0s)  Rows_sent=810.6 (2285067), Rows_examined=810.6 (2285067), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S'	AND `timestamp` < 'S'	ORDER BY `timestamp` DESC

Count: 1378  Time=0.00s (4s)  Lock=0.00s (0s)  Rows_sent=1.0 (1357), Rows_examined=1.0 (1353), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY timestamp DESC LIMIT N

Count: 899  Time=0.00s (2s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=0.0 (0), isucon[isucon]@localhost
  #

Count: 640  Time=0.00s (1s)  Lock=0.00s (0s)  Rows_sent=920.5 (589142), Rows_examined=920.5 (589142), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY `timestamp` ASC

Count: 303  Time=0.00s (1s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=10.0 (3030), isucon[isucon]@localhost
  INSERT INTO `isu_condition`       (`jia_isu_uuid`, `timestamp`, `is_sitting`, `condition`, `message`)       VALUES ('S', 'S', N, 'S', 'S'),('S', 'S', N, 'S', 'S'),('S', 'S', N, 'S', 'S'),('S', 'S', N, 'S', 'S'),('S', 'S', N, 'S', 'S'),('S', 'S', N, 'S', 'S'),('S', 'S', N, 'S', 'S'),('S', 'S', N, 'S', 'S'),('S', 'S', N, 'S', 'S'),('S', 'S', N, 'S', 'S')

Count: 125  Time=0.00s (0s)  Lock=0.00s (0s)  Rows_sent=3.2 (395), Rows_examined=30.1 (3762), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu` WHERE `character` = 'S'

pprof

スクリーンショット 2021-09-26 21 53 07

スクリーンショット 2021-09-26 21 53 29

スクリーンショット 2021-09-26 21 56 49

@zono
Copy link
Owner Author

zono commented Sep 26, 2021

Add level column. 423ea96

score

13:15:04.613514 score: 27000(27002 - 2) : pass
13:15:04.613603 deduction: 0 / timeout: 25

top

PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
217158 isucon    20   0 1747620  24936   8504 S  55.7   0.7   0:12.96 isucondition
217242 mysql     20   0 1716392 110596  18600 S  49.3   2.9   0:11.42 mysqld
217325 isucon    20   0 1661492 207768  11532 S  44.0   5.4   0:22.68 bench
217319 www-data  20   0   15788  12304   4952 R  21.7   0.3   0:04.22 nginx
162 root      19  -1  430472 272164 270800 R   8.7   7.1   0:59.85 systemd-journal
217318 www-data  20   0   11708   8324   4952 R   8.0   0.2   0:02.97 nginx
520 syslog    20   0  224500   5136   3416 S   7.7   0.1   0:33.03 rsyslogd

alp

+-------+--------+------------------------------+-------+-------+---------+-------+-------+
| COUNT | METHOD |             URI              |  MIN  |  MAX  |   SUM   |  AVG  |  P99  |
+-------+--------+------------------------------+-------+-------+---------+-------+-------+
| 78127 | POST   | /api/condition/[-a-z0-9]+    | 0.004 | 0.136 | 668.799 | 0.009 | 0.044 |
|   465 | GET    | /api/trend                   | 0.016 | 1.020 | 269.494 | 0.580 | 1.004 |
| 11498 | GET    | /api/isu/.+/icon             | 0.004 | 0.196 | 259.973 | 0.023 | 0.072 |
|  5302 | GET    | /api/condition/[-a-z0-9]+    | 0.004 | 0.144 | 122.037 | 0.023 | 0.072 |
|  1679 | GET    | /api/isu                     | 0.004 | 0.224 |  66.982 | 0.040 | 0.104 |
|  1411 | GET    | /api/isu/.+/graph            | 0.008 | 0.112 |  41.522 | 0.029 | 0.084 |
|  1785 | GET    | /api/isu/[-a-z0-9]+          | 0.004 | 0.124 |  30.556 | 0.017 | 0.056 |
|   969 | POST   | /api/auth                    | 0.000 | 0.064 |  12.376 | 0.013 | 0.040 |
|   709 | GET    | /api/user/me                 | 0.004 | 0.068 |   6.368 | 0.009 | 0.044 |
|    58 | POST   | /api/isu                     | 0.004 | 0.168 |   4.304 | 0.074 | 0.168 |
|   382 | POST   | /api/signout                 | 0.020 | 0.064 |   4.228 | 0.011 | 0.036 |
|   560 | GET    | /assets/vendor.ee7444dd.js   | 0.008 | 0.132 |   3.984 | 0.007 | 0.032 |
|   560 | GET    | /assets/favicon.d0f5f504.svg | 0.004 | 0.120 |   3.496 | 0.006 | 0.028 |
|   560 | GET    | /assets/logo_white.svg       | 0.004 | 0.040 |   3.452 | 0.006 | 0.032 |
|   560 | GET    | /assets/index.23dac98b.js    | 0.004 | 0.120 |   3.280 | 0.006 | 0.024 |
|   467 | GET    | /assets/logo_orange.svg      | 0.008 | 0.036 |   3.080 | 0.007 | 0.032 |
|   527 | GET    | /                            | 0.008 | 0.056 |   2.848 | 0.005 | 0.028 |
|   560 | GET    | /assets/index.144d8ca8.css   | 0.004 | 0.040 |   2.748 | 0.005 | 0.024 |
|   332 | GET    | /?jwt=                       | 0.008 | 0.032 |   2.152 | 0.006 | 0.024 |
|     1 | POST   | /initialize                  | 0.224 | 0.224 |   0.224 | 0.224 | 0.224 |
|    30 | GET    | /isu/........-....-.+        | 0.000 | 0.004 |   0.016 | 0.001 | 0.004 |
|     3 | GET    | /register                    | 0.000 | 0.000 |   0.000 | 0.000 | 0.000 |
+-------+--------+------------------------------+-------+-------+---------+-------+-------+

mysqldumpslow

Count: 7755  Time=0.00s (26s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=0.0 (0), isucon[isucon]@localhost
  COMMIT

Count: 2652  Time=0.00s (9s)  Lock=0.00s (0s)  Rows_sent=1.0 (2641), Rows_examined=1.0 (2630), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY timestamp DESC LIMIT N

Count: 1374  Time=0.00s (3s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=0.0 (0), isucon[isucon]@localhost
  #

Count: 793  Time=0.00s (2s)  Lock=0.00s (0s)  Rows_sent=906.6 (718934), Rows_examined=906.6 (718934), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY `timestamp` ASC

Count: 378  Time=0.00s (1s)  Lock=0.00s (0s)  Rows_sent=19.7 (7430), Rows_examined=19.7 (7430), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S'	AND `timestamp` < 'S'       AND `level` IN ('S', 'S', 'S')       ORDER BY `timestamp` DESC LIMIT N

Count: 340  Time=0.00s (1s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=10.0 (3400), isucon[isucon]@localhost
  INSERT INTO `isu_condition`       (`jia_isu_uuid`, `timestamp`, `is_sitting`, `condition`, `message`, `level`)       VALUES ('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S')

Count: 268  Time=0.00s (0s)  Lock=0.00s (0s)  Rows_sent=1.0 (259), Rows_examined=1.0 (259), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY `timestamp` DESC LIMIT N

pprof

スクリーンショット 2021-09-26 22 16 39

スクリーンショット 2021-09-26 22 17 50

スクリーンショット 2021-09-26 22 20 02

@zono
Copy link
Owner Author

zono commented Sep 26, 2021

Add condition for graph. b1bd2c0

score

13:24:30.927674 score: 28630(28634 - 4) : pass
13:24:30.927733 deduction: 2 / timeout: 22

top

PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
217571 isucon    20   0 1673888  24632   8496 S  57.5   0.6   0:05.49 isucondition
217657 mysql     20   0 1716396 120184  18936 S  45.8   3.2   0:04.86 mysqld
217741 isucon    20   0 1519468 185708  11388 S  42.9   4.9   0:17.23 bench
217734 www-data  20   0   11464   8408   5024 S  16.6   0.2   0:01.50 nginx
217735 www-data  20   0   14040  10632   5024 S  15.3   0.3   0:01.66 nginx
162 root      19  -1  312868 173192 171824 R   8.6   4.5   1:04.61 systemd-journal
520 syslog    20   0  224500   5124   3416 S   8.3   0.1   0:36.66 rsyslogd

alp

+-------+--------+------------------------------+-------+-------+---------+-------+-------+
| COUNT | METHOD |             URI              |  MIN  |  MAX  |   SUM   |  AVG  |  P99  |
+-------+--------+------------------------------+-------+-------+---------+-------+-------+
| 75921 | POST   | /api/condition/[-a-z0-9]+    | 0.004 | 0.108 | 527.727 | 0.007 | 0.036 |
| 14987 | GET    | /api/isu/.+/icon             | 0.004 | 0.148 | 278.588 | 0.019 | 0.056 |
|   408 | GET    | /api/trend                   | 0.016 | 1.008 | 190.615 | 0.467 | 1.004 |
|  5628 | GET    | /api/condition/[-a-z0-9]+    | 0.004 | 0.136 |  98.426 | 0.017 | 0.056 |
|  2050 | GET    | /api/isu                     | 0.012 | 0.164 |  72.506 | 0.035 | 0.092 |
|  2157 | GET    | /api/isu/[-a-z0-9]+          | 0.004 | 0.104 |  29.168 | 0.014 | 0.044 |
|  1528 | GET    | /api/isu/.+/graph            | 0.012 | 0.104 |  28.648 | 0.019 | 0.056 |
|  1074 | POST   | /api/auth                    | 0.004 | 0.068 |  11.128 | 0.010 | 0.032 |
|   816 | GET    | /api/user/me                 | 0.004 | 0.044 |   5.906 | 0.007 | 0.028 |
|   440 | POST   | /api/signout                 | 0.004 | 0.072 |   4.084 | 0.009 | 0.028 |
|    55 | POST   | /api/isu                     | 0.004 | 0.120 |   3.832 | 0.070 | 0.120 |
|   509 | GET    | /assets/vendor.ee7444dd.js   | 0.004 | 0.040 |   3.152 | 0.006 | 0.028 |
|   509 | GET    | /assets/favicon.d0f5f504.svg | 0.004 | 0.032 |   2.836 | 0.006 | 0.024 |
|   509 | GET    | /assets/index.23dac98b.js    | 0.004 | 0.028 |   2.492 | 0.005 | 0.020 |
|   509 | GET    | /assets/logo_white.svg       | 0.000 | 0.036 |   2.476 | 0.005 | 0.020 |
|   411 | GET    | /assets/logo_orange.svg      | 0.000 | 0.036 |   2.248 | 0.005 | 0.024 |
|   509 | GET    | /assets/index.144d8ca8.css   | 0.004 | 0.032 |   2.176 | 0.004 | 0.020 |
|   477 | GET    | /                            | 0.004 | 0.032 |   2.056 | 0.004 | 0.020 |
|   382 | GET    | /?jwt=                       | 0.004 | 0.020 |   1.872 | 0.005 | 0.020 |
|     1 | POST   | /initialize                  | 0.180 | 0.180 |   0.180 | 0.180 | 0.180 |
|    30 | GET    | /isu/........-....-.+        | 0.000 | 0.004 |   0.012 | 0.000 | 0.004 |
|     3 | GET    | /register                    | 0.000 | 0.004 |   0.004 | 0.001 | 0.004 |
+-------+--------+------------------------------+-------+-------+---------+-------+-------+

mysqldumpslow

Count: 7475  Time=0.00s (25s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=0.0 (0), isucon[isucon]@localhost
  COMMIT

Count: 2157  Time=0.00s (7s)  Lock=0.00s (0s)  Rows_sent=1.0 (2151), Rows_examined=1.0 (2142), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY timestamp DESC LIMIT N

Count: 1452  Time=0.00s (4s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=0.0 (0), isucon[isucon]@localhost
  #

Count: 392  Time=0.00s (1s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=10.0 (3920), isucon[isucon]@localhost
  INSERT INTO `isu_condition`       (`jia_isu_uuid`, `timestamp`, `is_sitting`, `condition`, `message`, `level`)       VALUES ('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S')

Count: 378  Time=0.00s (1s)  Lock=0.00s (0s)  Rows_sent=19.8 (7490), Rows_examined=19.8 (7490), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S'	AND `timestamp` < 'S'       AND `level` IN ('S', 'S', 'S')       ORDER BY `timestamp` DESC LIMIT N

Count: 366  Time=0.00s (1s)  Lock=0.00s (0s)  Rows_sent=1.0 (361), Rows_examined=1.0 (361), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY `timestamp` DESC LIMIT N

Count: 158  Time=0.00s (0s)  Lock=0.00s (0s)  Rows_sent=3.3 (528), Rows_examined=13.9 (2194), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu` WHERE `character` = 'S'

pprof

スクリーンショット 2021-09-26 22 26 21

スクリーンショット 2021-09-26 22 26 48

スクリーンショット 2021-09-26 22 28 39

@zono
Copy link
Owner Author

zono commented Sep 26, 2021

Stop logging. f9c424a

score

13:35:30.399724 score: 32770(32772 - 2) : pass
13:35:30.399792 deduction: 0 / timeout: 25

top

PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
218288 isucon    20   0 1378944  24964   8324 S  59.8   0.7   0:03.39 isucondition
218372 mysql     20   0 1716192 118092  18480 S  56.8   3.1   0:03.45 mysqld
218459 isucon    20   0 1445480 183676  11560 S  45.8   4.8   0:15.71 bench
218452 www-data  20   0   11340   8240   4980 R  18.3   0.2   0:00.99 nginx
218451 www-data  20   0   12740   9268   4980 S  14.6   0.2   0:00.95 nginx
 11 root      20   0       0      0      0 I   0.3   0.0   0:01.90 rcu_sched

alp

+-------+--------+------------------------------+-------+-------+---------+-------+-------+
| COUNT | METHOD |             URI              |  MIN  |  MAX  |   SUM   |  AVG  |  P99  |
+-------+--------+------------------------------+-------+-------+---------+-------+-------+
|   606 | GET    | /api/trend                   | 0.016 | 1.012 | 324.000 | 0.535 | 1.004 |
| 78750 | POST   | /api/condition/[-a-z0-9]+    | 0.004 | 0.104 | 284.900 | 0.004 | 0.028 |
| 17615 | GET    | /api/isu/.+/icon             | 0.004 | 0.156 | 272.196 | 0.015 | 0.048 |
|  6202 | GET    | /api/condition/[-a-z0-9]+    | 0.008 | 0.152 | 102.292 | 0.016 | 0.052 |
|  2518 | GET    | /api/isu                     | 0.008 | 0.120 |  83.084 | 0.033 | 0.084 |
|  1925 | GET    | /api/isu/.+/graph            | 0.004 | 0.100 |  31.800 | 0.017 | 0.052 |
|  2631 | GET    | /api/isu/[-a-z0-9]+          | 0.004 | 0.096 |  31.012 | 0.012 | 0.040 |
|  1242 | POST   | /api/auth                    | 0.004 | 0.048 |   9.536 | 0.008 | 0.028 |
|  1024 | GET    | /api/user/me                 | 0.000 | 0.036 |   4.596 | 0.004 | 0.028 |
|    58 | POST   | /api/isu                     | 0.056 | 0.168 |   4.016 | 0.069 | 0.168 |
|   545 | POST   | /api/signout                 | 0.004 | 0.080 |   3.500 | 0.006 | 0.028 |
|   712 | GET    | /assets/vendor.ee7444dd.js   | 0.000 | 0.032 |   2.324 | 0.003 | 0.020 |
|   712 | GET    | /assets/index.23dac98b.js    | 0.000 | 0.024 |   1.792 | 0.003 | 0.012 |
|   712 | GET    | /assets/favicon.d0f5f504.svg | 0.000 | 0.024 |   1.648 | 0.002 | 0.012 |
|   712 | GET    | /assets/index.144d8ca8.css   | 0.000 | 0.024 |   1.580 | 0.002 | 0.012 |
|   712 | GET    | /assets/logo_white.svg       | 0.000 | 0.036 |   1.500 | 0.002 | 0.012 |
|   608 | GET    | /assets/logo_orange.svg      | 0.000 | 0.036 |   1.400 | 0.002 | 0.012 |
|   679 | GET    | /                            | 0.000 | 0.016 |   1.076 | 0.002 | 0.012 |
|   484 | GET    | /?jwt=                       | 0.000 | 0.012 |   1.032 | 0.002 | 0.012 |
|     1 | POST   | /initialize                  | 0.264 | 0.264 |   0.264 | 0.264 | 0.264 |
|    30 | GET    | /isu/........-....-.+        | 0.000 | 0.004 |   0.004 | 0.000 | 0.004 |
|     3 | GET    | /register                    | 0.004 | 0.004 |   0.004 | 0.001 | 0.004 |
+-------+--------+------------------------------+-------+-------+---------+-------+-------+

mysqldumpslow

Count: 8109  Time=0.00s (33s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=0.0 (0), isucon[isucon]@localhost
  COMMIT

Count: 6087  Time=0.00s (21s)  Lock=0.00s (0s)  Rows_sent=1.0 (6070), Rows_examined=1.0 (6004), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY timestamp DESC LIMIT N

Count: 4807  Time=0.00s (12s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=0.0 (0), isucon[isucon]@localhost
  #

Count: 669  Time=0.00s (2s)  Lock=0.00s (0s)  Rows_sent=19.9 (13287), Rows_examined=19.9 (13287), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S'	AND `timestamp` < 'S'       AND `level` IN ('S', 'S', 'S')       ORDER BY `timestamp` DESC LIMIT N

Count: 716  Time=0.00s (2s)  Lock=0.00s (0s)  Rows_sent=0.0 (0), Rows_examined=0.0 (0), Rows_affected=10.0 (7160), isucon[isucon]@localhost
  INSERT INTO `isu_condition`       (`jia_isu_uuid`, `timestamp`, `is_sitting`, `condition`, `message`, `level`)       VALUES ('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S'),('S', 'S', N, 'S', 'S', 'S')

Count: 709  Time=0.00s (2s)  Lock=0.00s (0s)  Rows_sent=3.5 (2459), Rows_examined=11.8 (8381), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu` WHERE `character` = 'S'

Count: 734  Time=0.00s (2s)  Lock=0.00s (0s)  Rows_sent=1.0 (728), Rows_examined=1.0 (728), Rows_affected=0.0 (0), isucon[isucon]@localhost
  SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = 'S' ORDER BY `timestamp` DESC LIMIT N

pprof

スクリーンショット 2021-09-26 22 37 12

スクリーンショット 2021-09-26 22 37 53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant