Skip to content

Commit

Permalink
go: run in release mode of gin 351742
Browse files Browse the repository at this point in the history
  • Loading branch information
mickamy committed Jan 10, 2024
1 parent 491ca94 commit 3436fa6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
15 changes: 15 additions & 0 deletions note.go.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}
```
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion webapp/go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

Expand Down

0 comments on commit 3436fa6

Please sign in to comment.