Closed9
ISUCON 6 予選問題をやる

から、AWS環境で構築してみる。
isucon
ユーザーのauthorized_keyに公開鍵を登録した。

EC2のセキュリティグループに、送信元0.0.0.0/0
、ポート80のインバウンドルールを追加した。
アプリケーションが表示されるようになった。

を眺めている。
mysql login
isucon@ip-172-31-30-161:~$ mysql -uisucon -pisucon
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.7.33-0ubuntu0.16.04.1 (Ubuntu)
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
MySQL の my.cnf がスカスカ
isucon@ip-172-31-30-161:~$ cat /etc/mysql/my.cnf
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
bind-address = 127.0.0.1
max_allowed_packet = 16M
log_error = /var/log/mysql/error.log

どの言語のdaemon動いてるのか調べるのに
sudo systemctl list-dependencies multi-user.target
して確認した。どう調べるのがいいんだろ
追記:
systemctl list-units --type=service
で見れる
HOME 画面での general log(クエリ一覧)https://gist.github.com/zensai3805/868ffcfb087b59c671012a1c445dec14
isutar.star を isuda db に copy
mysql> CREATE table isuda.star LIKE isutar.star;
Query OK, 0 rows affected (0.02 sec)
mysql> INSERT into isuda.star SELECT * from isutar.star;
Query OK, 13 rows affected (0.00 sec)
Records: 13 Duplicates: 0 Warnings: 0
index 作成
mysql> ALTER TABLE star ADD INDEX index_keyword(keyword);
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> show index from star;
+-------+------------+---------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------+------------+---------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| star | 0 | PRIMARY | 1 | id | A | 13 | NULL | NULL | | BTREE | | |
| star | 1 | index_keyword | 1 | keyword | A | 12 | NULL | NULL | | BTREE | | |
+-------+------------+---------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
2 rows in set (0.00 sec)
このスクラップは2021/08/15にクローズされました