GithubHelp home page GithubHelp logo

isucon / isucon8-qualify Goto Github PK

View Code? Open in Web Editor NEW
157.0 14.0 84.0 22.81 MB

License: MIT License

Makefile 0.08% Go 24.48% Ruby 2.26% Shell 0.29% Perl 15.09% Perl 6 0.05% HTML 13.38% CSS 0.54% JavaScript 34.88% TypeScript 2.78% PHP 3.42% Python 2.52% TSQL 0.21%

isucon8-qualify's Introduction

ISUCON8 予選問題

本番のマシンスペック

  • vCPU 2コア : Intel(R) Xeon(R) CPU E5-2640 v4 @ 2.40GHz
  • メモリ 1GB
  • ネットワーク帯域 1Gbps
  • ディスク SSD

のVMを競技用に3台。同スペックのVMをベンチマーカー用に1台。

本番のOS/初期ミドルウェア

  • CentOS 7.5.1804
  • MariaDB 5.5.60
  • H2O 2.2.5

感想戦用、1VMでの動かし方

環境構築の詳細については provisioning を参照。

環境構築

xbuildで言語をインストールする。ベンチマーカーのためにGoは必須。他の言語は使わないのであればスキップしても問題ない。

cd
git clone https://github.com/tagomoris/xbuild.git

mkdir local
xbuild/go-install     1.10.3  $HOME/local/go
xbuild/perl-install   5.28.0  $HOME/local/perl
xbuild/ruby-install   2.5.1   $HOME/local/ruby
xbuild/node-install   v8.11.4 $HOME/local/node
xbuild/python-install 3.7.0   $HOME/local/python
xbuild/php-install    7.2.9   $HOME/local/php -- --with-pcre-regex --with-zlib --enable-fpm --enable-pdo --with-pear --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --with-pcre-regex --with-pcre-dir --with-libxml-dir --enable-opcache --enable-bcmath --with-bz2 --enable-calendar --enable-cli --enable-shmop --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-mbregex --enable-mbstring --enable-pcntl --enable-sockets --with-curl --enable-zip

ベンチマーカーの準備

Goを使うのでこれだけは最初に環境変数を設定しておく

export PATH=$HOME/local/go/bin:$HOME/go/bin:$PATH

ビルド

$ cd bench
$ make deps
$ make

初期データ生成

$ cd bench
$ ./bin/gen-initial-dataset   # ../db/isucon8q-initial-dataset.sql.gz ができる

データベース初期化

データベース初期化、アプリが動くのに最低限必要なデータ投入

$ mysql -uroot
mysql> CREATE USER isucon@'%' IDENTIFIED BY 'isucon';
mysql> GRANT ALL on torb.* TO isucon@'%';
mysql> CREATE USER isucon@'localhost' IDENTIFIED BY 'isucon';
mysql> GRANT ALL on torb.* TO isucon@'localhost';
$ ./db/init.sh

参考実装(perl)を動かす

初回のみ

$ cd webapp/perl
$ cpanm --installdeps --notest --force .

起動

$ ./run_local.sh

ベンチマーク実行

$ cd bench
$ ./bin/bench -h # ヘルプ確認
$ ./bin/bench -remotes=127.0.0.1:8080 -output result.json

結果を見るには sudo apt install jq で jq をインストールしてから、

$ jq . < result.json

既知の不具合

  • 管理画面から新規イベントを作成する際に、ベース金額を初期値から変更した場合、金額を数値型ではなく文字列型で POST してしまう JS のバグがありました。 初期実装を確認したところ、このバグに影響を受けるのは go 実装のみでした。また、ベンチマークには影響がないことが分かっているため、JS の修正は見送りました。 なお、JS を書き換えるとベンチマークが fail しますので JS の改修はお勧めしません。
  • 変数名等で使われている、座席を意味する単語 sheets の、正しいスペルは seats です。

isucon8-qualify's People

Contributors

abicky avatar daisuzu avatar dependabot[bot] avatar gfx avatar k-masatany avatar karupanerura avatar nekonenene avatar omega014 avatar polidog avatar rkmathi avatar sonots avatar xaicron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

isucon8-qualify's Issues

bundle install falied

When I set up via playbook, I failed bundle install.

TASK [prepare_webapp : Install for torb.ruby] *******************************************************************************************
fatal: [xx.xxx.xx.xxx]: FAILED! => {"changed": true, "cmd": "bash -lc \"bundle install --path=.bundle\"\n", "delta": "0:00:00.087718", "e
nd": "2019-08-31 03:36:39.049331", "msg": "non-zero return code", "rc": 1, "start": "2019-08-31 03:36:38.961613", "stderr": "/home/isucon
/local/ruby/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFou
ndException)\n\tfrom /home/isucon/local/ruby/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'\n\tfrom /home/isucon/local/ruby/bin/bu
ndle:23:in `<main>'", "stderr_lines": ["/home/isucon/local/ruby/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem bun
dler (>= 0.a) with executable bundle (Gem::GemNotFoundException)", "\tfrom /home/isucon/local/ruby/lib/ruby/2.5.0/rubygems.rb:308:in `act
ivate_bin_path'", "\tfrom /home/isucon/local/ruby/bin/bundle:23:in `<main>'"], "stdout": "", "stdout_lines": []}

After trial and error, I succeeded by deleting Gemfile.lock.

This is a quick update.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.