[轉]Huge performance hit on a simple Go server with Docker

https://www.reddit.com/r/golang/comments/8ojjoj/huge_performance_hit_on_a_simple_go_server_with/ Docker’s disk I/O was the bottleneck! Solved: Disk I/O was the problem. Even though I’m on Debian 9.4, changing to an in-memory sqlite allowed Docker to push 2.9k reqs/sec. Credits to /u/Willson50 for the amazing find! With file=dco.sqlite3?mode=memory, Docker can push ~2.9k req/sec. Other way: PRAGMA journal_mode=WAL; PRAGMA synchronous=NORMAL; https://www.sqlite.org/wal.html

2018-12-20 · 1 min · 51 words · Me

xgo Go CGO cross compile sqlite

https://github.com/karalabe/xgo

2018-12-20 · 1 min · word · Me

[轉]知乎社区核心业务 Golang 化实践

https://zhuanlan.zhihu.com/p/48039838

2018-12-11 · 1 min · word · Me

ubuntu path golang

.bashrc last line: export PATH="/usr/local/go/bin:$PATH"

2018-12-10 · 1 min · 5 words · Me

gin-jwt 又更新了 renew again

1、Authenticator old:Authenticator: func(userId string, password string, c *gin.Context) New: ============================ `` type login struct { Username string `form:"username" json:"username" binding:"required"` Password string `form:"password" json:"password" binding:"required"` } Authenticator: func(c *gin.Context) (interface{}, error) { var loginVals login if err := c.ShouldBind(&loginVals); err != nil { return "", jwt.ErrMissingLoginValues } userID := loginVals.Username password := loginVals.Password `` 2、authMiddleware old: authMiddleware := jwt.GinJWTMiddleware{ New: authMiddleware, err := jwt.New(&jwt.GinJWTMiddleware{

2018-10-29 · 1 min · 64 words · Me