isucon / isucon7-qualify Goto Github PK
View Code? Open in Web Editor NEWISUCON7 予選問題の参照実装とベンチマーカー
License: MIT License
ISUCON7 予選問題の参照実装とベンチマーカー
License: MIT License
CAUTION: this project is open for only #isucon administrators /webapp /webapp/perl /webapp/ruby /webapp/nodejs /tools /tools/benchmark /tools/domchecker /tools/scoreboard ** Webアプリの基本方針 -処理はすべてリクエストを受け取ってから実施する --DBへのクエリ --テンプレートからのレンダリング -全てのコンテンツをアプリケーションから渡す --js/css/画像も含めて -キャッシュ等はとりあえず全て無し ** 実装するリクエストハンドラ - / -- GET -- articleのリスト(投稿順(id順) 最新10個) --- SELECT id,title,body,created_at FROM article ORDER BY id DESC LIMIT 10 - /article/:articleid -- GET -- articleページの表示 (article + comments) --- SELECT id,title,body,created_at FROM article WHERE id=? --- SELECT name,body,created_at FROM comment WHERE article=? ORDER BY id なお全ページ、左側のサイドバーに「新しいコメントがついた順に記事10件」を表示 --- SELECT article FROM comment GROUP BY article ORDER BY created_at DESC LIMIT 10 - /post -- GET -- 記事投稿用HTML ただしベンチ対象外のURLとする - /post -- POST -- 記事投稿 -- パラメータはform形式で title, body --- INSERT INTO article SET ... -- レスポンスは / へのリダイレクト(成功)、もしくは適当なエラー用のHTTPステータス - /comment/:articleid -- POST -- コメント投稿 (投稿フォームは /article/:articleid の末尾) -- パラメータはform形式で name, body --- INSERT INTO comment SET ... -- レスポンスは /article/:articleid へのリダイレクト(成功)、もしくは適当なエラー用のHTTPステータス ** 添付するstaticファイル - 画像 -- isuconロゴを適当なサイズにして流用、ページトップのバナー画像にする - js -- jquery 最新版の minify 済みファイル -- jquery-ui 最新版の minify 済みファイル -- isucon.js デザイン調整用 - css -- jquery-ui の適当なスタイル用のもの一式 -- isucon.css デザイン調整用
ベンチマーカーの準備のところで、gb vendor restore
した後に make
するところで以下のエラーが出ました。
GOPATH=`pwd`:`pwd`/vendor go install ./src/cmd/...
src/bench/scenario.go:23:2: cannot find package "github.com/PuerkitoBio/goquery" in any of:
/home/isucon/local/go/src/github.com/PuerkitoBio/goquery (from $GOROOT)
/home/isucon/isubata/bench/src/github.com/PuerkitoBio/goquery (from $GOPATH)
/home/isucon/isubata/bench/vendor/src/github.com/PuerkitoBio/goquery
src/bench/urlcache/cache.go:11:2: cannot find package "github.com/marcw/cachecontrol" in any of:
/home/isucon/local/go/src/github.com/marcw/cachecontrol (from $GOROOT)
/home/isucon/isubata/bench/src/github.com/marcw/cachecontrol (from $GOPATH)
/home/isucon/isubata/bench/vendor/src/github.com/marcw/cachecontrol
Makefile:5: recipe for target 'build' failed
make: *** [build] Error 1
gb vendor restore
で必要な vendor/manifest
がないように思われます。
go は詳しくないため間違っていたらすみません。
再現条件不明ですが、原因としてはCookieが消えているのが原因ぽいです。
成功: &{POST http://isubata.example.com/add_channel HTTP/1.1 1 1 map[User-Agent:[isucon7q-benchmarker] Cookie:[session=MTUyOTA0NDgxNHxEdi1CQkFFQ180SUFBUkFCRUFBQUl2LUNBQUVHYzNSeWFXNW5EQWtBQjNWelpYSmZhV1FGYVc1ME5qUUVCQUQtQWZ3PXwtgrgoTCGnZnXKdQEX56eigzk2e_HN7RL5sD33gPOepg==] Content-Type:[application/x-www-form-urlencoded]] {} 0x6c1360 93 [] false isubata.example.com map[] map[] <nil> map[] <nil> <nil> <nil> 0xc424609440} <nil>
失敗: &{POST http://isubata.example.com/add_channel HTTP/1.1 1 1 map[User-Agent:[isucon7q-benchmarker] Content-Type:[application/x-www-form-urlencoded]] {} 0x6c1360 135 [] false isubata.example.com map[] map[] <nil> map[] <nil> <nil> <nil> 0xc424c8faa0} Post http://isubata.example.com/add_channel: EOF
[isu7q-bench] 2018/06/15 15:34:24.248761 bench.go:491: {"job_id":"","ip_addrs":"localhost","pass":false,"score":0,"message":"負荷走行前のバリデーションに失敗しました。2018-06-15 15:34:24.24787555 +0900 JST m=+7.923937128 リクエストに失敗しました Post http://isubata.example.com/add_channel: EOF (POST /add_channel )","error":["2018-06-15 15:34:24.24787555 +0900 JST m=+7.923937128 リクエストに失敗しました Post http://isubata.example.com/add_channel: EOF (POST /add_channel )"],"log":null,"load_level":0,"start_time":"2018-06-15T15:34:16.801076066+09:00","end_time":"2018-06-15T15:34:24.2479395+09:00"}
エラー出てるのは以下の箇所になります。
(クッキー関係なかったです)
isucon7-qualify/bench/src/bench/scenario.go
Line 956 in 5cc8fe0
2018/06/15 17:37:49 [error] 27305#27305: *41767 readv() failed (104: Connection reset by peer) while reading upstream, client: ::1, server: isubata.example.com, request: "POST /profile HTTP/1.1", upstream: "http://127.0.0.1:5000/profile", host: "isubata.example.com"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.