Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10k+ rule using ABAC takes about 500ms #336

Closed
Castle1984 opened this issue Dec 28, 2023 · 2 comments
Closed

10k+ rule using ABAC takes about 500ms #336

Castle1984 opened this issue Dec 28, 2023 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@Castle1984
Copy link

Castle1984 commented Dec 28, 2023

I'm using ABAC model with casbin_sqlalchemy_adapter and there is about 10k+ rules.

Some rules in Mysql :
image

For example, The value of 't' calculated from this code,
time_start = time.time() result = enforce_mysql.enforce(sub, obj, act) t = (time.time()-time_start)*1000 ,
indicates that one check takes approximately 500ms+.
This differs significantly from the time shown in the benchmark for RABC.

Also, I have tried Fastbin,
such as enforce_fast_mysql = casbin.FastEnforcer('model.conf', adapter_mysql),
but it didn't improve a lot.

Is it my way of testing that is wrong?
Do you have any improvement methods to help me achieve the speed of RABC (large) in the benchmark? Thanks a lot.

@casbin-bot
Copy link
Member

@techoner @Nekotoxin

@casbin-bot casbin-bot added the question Further information is requested label Dec 28, 2023
@Castle1984
Copy link
Author

As of now, after giving it some thought, I believe I can avoid this issue by implementing a compression strategy. I think I won't encounter a problem with such a large number of rules in the near future.
Also, this prolem has been posed in advice on performance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Development

No branches or pull requests

3 participants