bin/
: Misc scriptsbenchmarker/
: Benchmarkerdocs/
: Rules and Task descriptionspacker/
: Packer & itamae manifests for machine imageproto/
: protobuf source fileswebapp/
: Task web application (XSUCON Portal)
- Go
- Jsonnet
- protoc
- protoc-gen-go (
go get google.golang.org/protobuf/cmd/protoc-gen-go
) - protoc-gen-go-grpc (
go get google.golang.org/grpc/cmd/protoc-gen-go-grpc
) - Node.js & yarn
You need a wildcard TLS certificate or a TLS certificate for at least 2 subjects, for the following purposes:
- Benchmarker (Web Push service)
- Task web application (XSUCON Portal)
Obtain and place it at secrets/cert.pem
and secrets/key.pem
.
cd webapp/frontend
yarn
yarn build
cd benchmarker
make
./bin/benchmarker \
-exit-status \
-target app.t.isucon.dev:3000 \
-host-advertise local.t.isucon.dev \
-tls-cert ../secrets/tls-cert.pem \
-tls-key ../secrets/tls-key.pem
- Adjust
-target
as you want. - Add
-tls
if the target is serving HTTPS. *.t.isucon.dev
always points localhost.
Edit packer/files/itamae/cookbooks/isucon-user/default.rb
to embed ssh public keys in advance. You don't need this when building a EC2 AMI.
cd packer/
# Build Amazon EC2 AMI
make build-full-ec2
# Build QEMU qcow2
make build-full-qemu
Boot built image on QEMU(Virtualbox) or EC2.
- EC2 AMI: Log in as
ubuntu
user - QEMU: Log in as
isucon
user
You need to add names to /etc/hosts
for connecting app from benchmarker & connecting app to benchmarker WebPush service. Assume you have a *.t.isucon.dev
TLS certificate, you can add the followings:
app.t.isucon.dev 127.0.0.1
bench.t.isucon.dev 127.0.0.1
sudo vim /etc/systemd/system/contestant.slice
sudo vim /etc/systemd/system/benchmarker.slice
sudo systemctl daemon-reload
sudo systemctl restart contestant.slice benchmarker.slice
- Default
- contestant.slice (mysql, isuxportal, envoy): CPU share of 50%, 1024M RAM, IO 800op/s 1024M/s
- benchmarker.slice (benchmarker): CPU share of 50%, 2048M RAM
- You may remove
CPUWeight=
and addAllowedCPUs=
if you want to dedicate specific CPU cores to services. See systemd.resource-control(5) for details. - If you assign a dedicated machine, you don't have to edit.
Follow the task description. By default, all implementations are disabled, so you need to enable them and start:
sudo systemctl enable --now xsuportal-api-ruby.service xsuportal-web-ruby.service
As a isucon
user, run:
sudo systemd-run \
--working-directory=/home/isucon/benchmarker \
--pipe \
--wait \
--collect \
--uid=$(id -u)\
--gid=$(id -g) \
--slice=benchmarker.slice \
--service-type=oneshot \
-p AmbientCapabilities=CAP_NET_BIND_SERVICE \
-p CapabilityBoundingSet=CAP_NET_BIND_SERVICE \
-p LimitNOFILE=2000000 \
-p TimeoutStartSec=110s \
~isucon/benchmarker/bin/benchmarker \
-exit-status \
-tls \
-target app.t.isucon.dev:443 \
-host-advertise bench.t.isucon.dev \
-push-service-port 1001 \
-tls-cert /etc/ssl/private/tls-cert.pem \
-tls-key /etc/ssl/private/tls-key.pem \
(Adjust -target
and -host-advertise
as your domain names)
- For contestant
- isu1
- CPU: 2 Core (AMD EPYC 7352)
- Memory: 1 GiB
- IO throughput: 1 Gbps
- IOPS limit: 800 (Read / Write)
- Interface: 1 Gbps
- Root disk size: 30 GB
- isu2
- CPU: 2 Core (AMD EPYC 7352)
- Memory: 2 GiB
- IO throughput: 1 Gbps
- IOPS limit: 800 (Read / Write)
- Interface: 1 Gbps
- Root disk size: 30 GB
- isu3
- CPU: 4 Core (AMD EPYC 7352)
- Memory: 1 GiB
- IO throughput: 1 Gbps
- IOPS limit: 800 (Read / Write)
- Interface: 1 Gbps
- Root disk size: 30 GB
- isu1
- For benchmarker
- bench
- CPU: 8 Core (AMD EPYC 7352)
- Memory: 16 GiB
- IO throughput: 1 Gbps
- IOPS limit: 800 (Read / Write)
- Interface: 1 Gbps
- Root disk size: 30 GB
- bench
MIT License unless otherwise specified