Performance issues with ~20k policies
See original GitHub issueWas wondering if anyone else is experiencing a slow down even with a relatively low number of policies.
For our ~20k policies we notice it takes around 5 seconds to evaluate them.
Here is our conf.
[request_definition]
r = type, resourceId, userId, action
[policy_definition]
p = type, resourceId, userId, action
[policy_effect]
e = some(where (p.eft == allow))
[matchers]
m = r.type == p.type && r.resourceId == p.resourceId && r.userId == p.userId && r.action == p.action
We have seemed to narrowed it down to this line in coreEnforcer.ts
Switching from compileAsync
to compile
and removing the await
brought us down to around 40ms with the same amount of policies.
Issue Analytics
- State:
- Created 4 years ago
- Comments:27 (18 by maintainers)
Top Results From Across the Web
Outlook performance issues in a Cached Exchange Mode .ost ...
Describes performance issues if there are lots of items or folders in a Cached Exchange Mode .ost or .pst file. Provides a resolution....
Read more >Blog: Building Performance Policy Brief | ENERGY STAR
In this first issue, we're providing background and highlighting recently passed building performance policies affecting existing U.S. commercial and ...
Read more >Amazon layoffs now expected to mount to 20,000, including ...
Amazon plans to lay off as many as 20,000 employees across the company ... should try to identify work performance problems among employees, ......
Read more >Dominant port? And performance problems (2 questions) - Dell
A couple of years ago, a DMX Symmetrix Performance Expert was at my ... in one port group (this friend has a 20k...
Read more >Cash Value Life Insurance Explained – Forbes Advisor
Exact rules on graded death benefits can vary, so make sure you understand them before buying guaranteed issue life insurance.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@hsluoyz, I think @dreamdevil00 provide the solution is good. But in Casbin, If
matcher
has async function and usingcompile
, theenforce
doest not provide the correct result.v3.0.5
has been published to npm.Use
enforceWithSyncCompile
instead ofenforce
.