From 3436fa6faf0fc8100eb80b494f33c88f7b983103 Mon Sep 17 00:00:00 2001 From: mickamy Date: Wed, 10 Jan 2024 09:13:33 +0900 Subject: [PATCH] go: run in release mode of gin 351742 --- note.go.md | 15 +++++++++++++++ run.sh | 2 +- webapp/go/main.go | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/note.go.md b/note.go.md index 6183ea5..2d792c4 100644 --- a/note.go.md +++ b/note.go.md @@ -120,3 +120,18 @@ docker exec -i ishocon2-bench-1 sh -c "./benchmark --ip app:443 --workload 7" 2024/01/10 09:02:51 投票者の感心がなくなりました 2024/01/10 09:02:51 {"score": 371622, "success": 246886, "failure": 0} ``` + +go: run in release mode of gin 351742 + +``` +❯ make bench +docker exec -i ishocon2-bench-1 sh -c "./benchmark --ip app:443 --workload 7" +2024/01/10 09:10:14 Start GET /initialize +2024/01/10 09:10:14 期日前投票を開始します +2024/01/10 09:10:15 期日前投票が終了しました +2024/01/10 09:10:15 投票を開始します Workload: 7 +2024/01/10 09:11:00 投票が終了しました +2024/01/10 09:11:00 投票者が結果を確認しています +2024/01/10 09:11:15 投票者の感心がなくなりました +2024/01/10 09:11:15 {"score": 351742, "success": 245246, "failure": 0} +``` diff --git a/run.sh b/run.sh index 89c761d..7083890 100755 --- a/run.sh +++ b/run.sh @@ -64,7 +64,7 @@ function run_python() { function run_go() { cd "/home/ishocon/webapp/$app_lang" make_tmp_file - GIN_MODE=release /tmp/go/webapp + /tmp/go/webapp } function run_php() { diff --git a/webapp/go/main.go b/webapp/go/main.go index a6341b1..4d428ff 100644 --- a/webapp/go/main.go +++ b/webapp/go/main.go @@ -54,7 +54,7 @@ func main() { db, _ = sql.Open("mysql", user+":"+pass+"@/"+dbname) db.SetMaxIdleConns(5) - gin.SetMode(gin.DebugMode) + gin.SetMode(gin.ReleaseMode) r := gin.Default() r.Use(static.Serve("/css", static.LocalFile("public/css", true)))