osohq / oso

Oso is a batteries-included framework for building authorization in your application.
https://docs.osohq.com
Apache License 2.0
3.47k stars 174 forks source link

[Ask] Go (Golang) Oso performance improvement advice #1647

Open bxcodec opened 1 year ago

bxcodec commented 1 year ago

Context:

We're using go-oso v0.26.0 (github.com/osohq/go-oso)

We have a strict timeout which is 2s. If the request exceeded 2s, we would automatically return a timeout response. After digging deeper through profiling, we found that the Oso Go library takes at least 2s for some requests every 1-hour interval. image

Asks

samscott89 commented 1 year ago

Hey @bxcodec.

We're looking into possible reasons why this is. GC definitely seems like a likely candidate.

In the meantime, would you mind trying with 0.26.3 and see if that helps at all? We fixed a potential issue where we were unnecessarily acquiring a write lock on a mutex in 0.26.2 (#1592). So there's a chance we're seeing a deadlock here.

bxcodec commented 1 year ago

Hi @samscott89

Thanks for replying, we will try to upgrade the version first, and see whether the issue still persists

bxcodec commented 1 year ago

For visibility, more conversation can be seen on the Oso community slack channel here https://oso-oss.slack.com/archives/C017KSBTD4M/p1668498111192659

sourcec0de commented 3 months ago

We're experiencing similar issues with performance on v0.27.0 Unfortunately, the community slack only has 90-day message retention. Does anyone know if there was a resolution to this?