xorm 开启redis缓存,并发超过MaxOpenConns数后程序阻塞 #1381
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#1381
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
xorm开启redis缓存并设置MaxOpenConns=15
执行 ab -c 15 -n 100 http://localhost:8080/v2/users/xorm@xorm.com后,所有数据库接口阻塞,其他接口正常响应,查看pprof
sql :
engine.SetMaxIdleConns(5)
engine.SetMaxOpenConns(15)
engine.SetConnMaxLifetime(30 * time.Second)
engine.Where("email=? AND mark=?", email, types.UserUnDeleted).Get(users)
engine.SetDefaultCacher(cacher)
cache:
cStore = cachestore.NewRedisCache(cfg)
cacher = xorm.NewLRUCacher2(cStore, cacheConf.ExpiredTime, mes)
version:
github.com/go-xorm/builder v0.1.0
github.com/go-xorm/cachestore v0.0.0-20170409031804-adfa3466c8e4
github.com/go-xorm/core v0.5.8
github.com/go-xorm/xorm v0.7.0