catatsuy / isucon12q

0 stars 0 forks source link

最初にやること #1

Open catatsuy opened 2 years ago

catatsuy commented 2 years ago

最初の作業

インフラ担当

アプリケーション担当1

t-cyrill commented 2 years ago
01:09:25.611544 SCORE: 2833 (+2833 0(0%))
t-cyrill commented 2 years ago
01:13:10.296990 SCORE: 2502 (+2502 0(0%))
t-cyrill commented 2 years ago
01:15:17.131880 SCORE: 2743 (+2743 0(0%))
t-cyrill commented 2 years ago

HW性能差はなさそう

               total        used        free      shared  buff/cache   available
Mem:           3.6Gi       851Mi       300Mi       0.0Ki       2.5Gi       2.5Gi
Swap:             0B          0B          0B
---

processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 85
model name  : Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz
stepping    : 4
microcode   : 0x100015c
cpu MHz     : 3404.804
cache size  : 25344 KB
physical id : 0
siblings    : 2
core id     : 0
cpu cores   : 1
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
bugs        : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit mmio_stale_data
bogomips    : 5999.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 6
model       : 85
model name  : Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz
stepping    : 4
microcode   : 0x100015c
cpu MHz     : 2999.998
cache size  : 25344 KB
physical id : 0
siblings    : 2
core id     : 0
cpu cores   : 1
apicid      : 1
initial apicid  : 1
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
bugs        : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit mmio_stale_data
bogomips    : 5999.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:
               total        used        free      shared  buff/cache   available
Mem:           3.6Gi       686Mi       832Mi       0.0Ki       2.1Gi       2.7Gi
Swap:             0B          0B          0B
---
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 85
model name  : Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz
stepping    : 4
microcode   : 0x2006c0a
cpu MHz     : 3405.689
cache size  : 25344 KB
physical id : 0
siblings    : 2
core id     : 0
cpu cores   : 1
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
bugs        : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit mmio_stale_data
bogomips    : 5999.98
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 6
model       : 85
model name  : Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz
stepping    : 4
microcode   : 0x2006c0a
cpu MHz     : 2999.994
cache size  : 25344 KB
physical id : 0
siblings    : 2
core id     : 0
cpu cores   : 1
apicid      : 1
initial apicid  : 1
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
bugs        : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit mmio_stale_data
bogomips    : 5999.98
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:
               total        used        free      shared  buff/cache   available
Mem:           3.6Gi       848Mi       118Mi       0.0Ki       2.7Gi       2.6Gi
Swap:             0B          0B          0B
---
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 85
model name  : Intel(R) Xeon(R) Platinum 8275CL CPU @ 3.00GHz
stepping    : 7
microcode   : 0x500320a
cpu MHz     : 3606.465
cache size  : 36608 KB
physical id : 0
siblings    : 2
core id     : 0
cpu cores   : 1
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
bugs        : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit mmio_stale_data
bogomips    : 5999.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 6
model       : 85
model name  : Intel(R) Xeon(R) Platinum 8275CL CPU @ 3.00GHz
stepping    : 7
microcode   : 0x500320a
cpu MHz     : 2999.998
cache size  : 36608 KB
physical id : 0
siblings    : 2
core id     : 0
cpu cores   : 1
apicid      : 1
initial apicid  : 1
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
bugs        : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit mmio_stale_data
bogomips    : 5999.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:
t-cyrill commented 2 years ago

全部CPU2コア、メモリ3.6G

t-cyrill commented 2 years ago
sudo ss -lntp
State          Recv-Q         Send-Q                  Local Address:Port                    Peer Address:Port         Process
LISTEN         0              4096                    127.0.0.53%lo:53                           0.0.0.0:*             users:(("systemd-resolve",pid=429,fd=14))
LISTEN         0              128                           0.0.0.0:22                           0.0.0.0:*             users:(("sshd",pid=835,fd=3))
LISTEN         0              4096                        127.0.0.1:35003                        0.0.0.0:*             users:(("containerd",pid=513,fd=11))
LISTEN         0              511                           0.0.0.0:443                          0.0.0.0:*             users:(("nginx",pid=815,fd=6),("nginx",pid=814,fd=6),("nginx",pid=813,fd=6))
LISTEN         0              70                          127.0.0.1:33060                        0.0.0.0:*             users:(("mysqld",pid=842,fd=22))
LISTEN         0              151                         127.0.0.1:3306                         0.0.0.0:*             users:(("mysqld",pid=842,fd=25))
LISTEN         0              511                         127.0.0.1:6379                         0.0.0.0:*             users:(("redis-server",pid=499,fd=6))
LISTEN         0              128                              [::]:22                              [::]:*             users:(("sshd",pid=835,fd=4))
LISTEN         0              4096                                *:3000                               *:*             users:(("main",pid=2302,fd=3))
LISTEN         0              4096                                *:3001                               *:*             users:(("blackauth",pid=476,fd=3))
LISTEN         0              511                             [::1]:6379                            [::]:*             users:(("redis-server",pid=499,fd=7))
t-cyrill commented 2 years ago

Disk性能差もなさそう

Model: Amazon Elastic Block Store (nvme)
Disk /dev/nvme0n1: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
14      1049kB  5243kB  4194kB                     bios_grub
15      5243kB  116MB   111MB   fat32              boot, esp
 1      116MB   21.5GB  21.4GB  ext4

---
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 3.91861 s, 274 MB/s

およそ300MB/sくらい IOPSはわからんけど

t-cyrill commented 2 years ago
sudo cat /var/log/nginx/access.log | alp ltsv -m \
"^/api/organizer/competition/[0-9a-zA-Z]+/finish",\
"^/api/player/player/[0-9a-zA-Z]+$",\
"^/api/organizer/competition/[0-9a-zA-Z]+/score",\
"^/api/organizer/player/[0-9a-zA-Z]+/disqualified",\
"^/api/player/competition/[0-9a-zA-Z]+/ranking" --sort=sum --reverse | notify_slack -snippet -filetype txt
t-cyrill commented 2 years ago
ALTER TABLE `visit_history` ADD INDEX `tenant_id_competition_id_idx` (`tenant_id`, `competition_id`);