While moving to go 1.5 we register that bcrypt.CompareHashAndPassword() takes 4.5 seconds to execute when run in our application.
SessionDump &{0TCe5j-_qSu8FIeVBQmDN1 false {63584465813 411476130 0xe20f80} {63584465828 558786836 0xe20f80} map[RDS:0xc8203e1a40] map[Lang:de hiddenPan:0xc820425cc0 ips:xx.xx.xxx.xx] 300000000000 0xc820451d00}
Rxxxx Dev2015/11/30 08:37:08 serveHTTP appName Parts 3 [ RDS e]
Rxxxx Dev2015/11/30 08:37:08 Event from comp: 36 event: 0
rbac.CheckDBC db returned hash $2a$12$POqiCemuLIFfpwSukrZR4un61NfSxxxxxxxxxxxxxxxxxxxxxxxxx
SCHED 32221ms: gomaxprocs=6 idleprocs=5 threads=9 spinningthreads=0 idlethreads=4 runqueue=0 [0 0 0 0 0 0]
SCHED 33228ms: gomaxprocs=6 idleprocs=5 threads=9 spinningthreads=0 idlethreads=4 runqueue=0 [0 0 0 0 0 0]
SCHED 34234ms: gomaxprocs=6 idleprocs=5 threads=9 spinningthreads=0 idlethreads=4 runqueue=0 [0 0 0 0 0 0]
SCHED 35241ms: gomaxprocs=6 idleprocs=5 threads=9 spinningthreads=0 idlethreads=4 runqueue=0 [0 0 0 0 0 0]
SCHED 36247ms: gomaxprocs=6 idleprocs=5 threads=9 spinningthreads=0 idlethreads=4 runqueue=0 [0 0 0 0 0 0]
rbac.CheckDBC sql.Open took 3.630088ms to run.
rbac.CheckDBC db.QueryRow(select dbhash) took 10.799249ms to run.
rbac.CheckDBC bcrypt.CompareHashAndPassword took 4.575247394s to run.
write session register result: {0xc820443260 1} <nil>
When the same function in the same environment is called from test it takes 360ms.
sysop@godev:~/go/src/t-rbac$ go test -v rbac_test.go
=== RUN Test_VM
rbact genfrompassword took 364.745932ms to generate
rbact comparehashandpassword took 362.068234ms to compare
--- PASS: Test_VM (0.73s)
PASS
ok command-line-arguments 0.736s
Observed with nmon we observe in test clean mapping of the load to all three available cores. However in the application the function appears to be locked to one core which appears to account for the extreme performance degradation. I am unable to register resource limitations. Pprof doesn’t indicate any locked syscalls.
Could someone suggest a way to Debug this?.
thanks,
Nigel Vickers