You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "danhuawang (via GitHub)" <gi...@apache.org> on 2025/08/14 09:58:15 UTC
[I] [Bug report] Auth: list tables API costs too much time even if cache enabled [gravitino]
danhuawang opened a new issue, #8089:
URL: https://github.com/apache/gravitino/issues/8089
### Version
main branch
### Describe what's wrong
1. Enable auth and cache
```
# THE CONFIGURATION FOR Gravitino Entity Cache
gravitino.cache.enabled = true
gravitino.cache.maxEntries = 10000
gravitino.cache.expireTimeInMs = 600000
gravitino.cache.enableStats = true
gravitino.cache.enableWeigher = true
gravitino.cache.implementation = caffeine
# THE CONFIGURATION FOR authorization
gravitino.authorization.enable = false
gravitino.authorization.serviceAdmins = anonymous,service_admin
gravitino.authenticators = simple
gravitino.authenticator.oauth.serviceAudience = test
```
2. List tables cost almost 19s , retry serval times, the same response time. But after I disable the authorization. List 1000 tables cost only 0.31s.
<img width="827" height="875" alt="Image" src="https://github.com/user-attachments/assets/c9a53310-b95a-4626-a8ae-5a6f3b19af8f" />
### Error message and/or stacktrace
N/A
### How to reproduce
1. list tables under schema , tables count is 1000
2. Check response time: `auth enable,cache enable` vs `auth disable,cache enable`
```
curl -o /dev/null -s -w "
time_namelookup: %{time_namelookup}s
time_connect: %{time_connect}s
time_appconnect: %{time_appconnect}s
time_pretransfer: %{time_pretransfer}s
time_redirect: %{time_redirect}s
time_starttransfer: %{time_starttransfer}s
time_total: %{time_total}s
" "http://10.0.4.218:8090/api/metalakes/pm/catalogs/mysql_1/schemas/mydb_tree_9/tables"
```
### Additional context
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug report] Auth: list tables API costs too much time even if cache enabled [gravitino]
Posted by "danhuawang (via GitHub)" <gi...@apache.org>.
danhuawang commented on issue #8089:
URL: https://github.com/apache/gravitino/issues/8089#issuecomment-3188651522
> > <img alt="Image" width="1719" height="1332" src="https://private-user-images.githubusercontent.com/35210666/477993920-f2a9d938-7be5-4a74-bbfb-6bb231890a17.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTUxNzgyMTcsIm5iZiI6MTc1NTE3NzkxNywicGF0aCI6Ii8zNTIxMDY2Ni80Nzc5OTM5MjAtZjJhOWQ5MzgtN2JlNS00YTc0LWJiZmItNmJiMjMxODkwYTE3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA4MTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwODE0VDEzMjUxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI2MTNlYTc0NzExZmQzNDViYzczMDAxOWIyODNlY2I1NGY5YjIwNzA1MjBhMjllNzZmMTIzODBkODRhMjIwOWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.oNhFJElUK9HTB1Pr-TH8ZHfx6FNSEkZXGnxtEXVZoKs"> After analyzing the flame graph, it appears that the main cause of the prolonged execution time is that listRole went through the cache layer, but since the cach
e layer does not support RelationalEntityStore, it resulted in multiple database accesses.
>
> Could you please test it again using the configuration below?
>
> ```
> gravitino.cache.enableWeigher = true
> ```
I test it both `gravitino.cache.enableWeigher =false` and `gravitino.cache.enableWeigher = true` . No changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug report] Auth: list tables API costs too much time even if cache enabled [gravitino]
Posted by "hdygxsj (via GitHub)" <gi...@apache.org>.
hdygxsj commented on issue #8089:
URL: https://github.com/apache/gravitino/issues/8089#issuecomment-3188156538
<img width="1719" height="1332" alt="Image" src="https://github.com/user-attachments/assets/f2a9d938-7be5-4a74-bbfb-6bb231890a17" />
After analyzing the flame graph, it appears that the main cause of the prolonged execution time is that listRole went through the cache layer, but since the cache layer does not support RelationalEntityStore, it resulted in multiple database accesses.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug report] Auth: list tables API costs too much time even if cache enabled [gravitino]
Posted by "danhuawang (via GitHub)" <gi...@apache.org>.
danhuawang commented on issue #8089:
URL: https://github.com/apache/gravitino/issues/8089#issuecomment-3190525852
> [@danhuawang](https://github.com/danhuawang) I'm wondering how many rows in `role_meta` and `user_role_rel` ?
>
> And would increasing `maxEntries` help ?
>
> ```
> gravitino.cache.enableWeigher = false
> # increase to 100k entiries
> gravitino.cache.maxEntries = 100000
> ```
>
> Further more, if you enable cache stats,
>
> ```
> gravitino.cache.enableStats = true
> ```
>
> could you share the Gravitino server log ? It contains cache statistics, which helps a lot while debugging.
```
mysql> select count(*) from role_meta;
+----------+
| count(*) |
+----------+
| 3 |
+----------+
1 row in set (0.00 sec)
mysql> select count(*) from user_role_rel;
+----------+
| count(*) |
+----------+
| 10 |
+----------+
1 row in set (0.00 sec)
```
I increased to 100k entiries , it didn't help.
```
# THE CONFIGURATION FOR Gravitino Entity Cache
gravitino.cache.enabled = true
#gravitino.cache.maxEntries = 10000
gravitino.cache.maxEntries = 100000
gravitino.cache.expireTimeInMs = 3600000
gravitino.cache.enableStats = true
gravitino.cache.enableWeigher = false
gravitino.cache.implementation = caffeine
```
FYI
[gravitino-server.log](https://github.com/user-attachments/files/21783572/gravitino-server.log)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug report] Auth: list tables API costs too much time even if cache enabled [gravitino]
Posted by "unknowntpo (via GitHub)" <gi...@apache.org>.
unknowntpo commented on issue #8089:
URL: https://github.com/apache/gravitino/issues/8089#issuecomment-3190084707
@danhuawang I'm wondering how many rows in `role_meta` and `user_role_rel` ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug report] Auth: list tables API costs too much time even if cache enabled [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi closed issue #8089: [Bug report] Auth: list tables API costs too much time even if cache enabled
URL: https://github.com/apache/gravitino/issues/8089
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug report] Auth: list tables API costs too much time even if cache enabled [gravitino]
Posted by "hdygxsj (via GitHub)" <gi...@apache.org>.
hdygxsj commented on issue #8089:
URL: https://github.com/apache/gravitino/issues/8089#issuecomment-3188464207
> <img alt="Image" width="1719" height="1332" src="https://private-user-images.githubusercontent.com/35210666/477993920-f2a9d938-7be5-4a74-bbfb-6bb231890a17.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTUxNzgyMTcsIm5iZiI6MTc1NTE3NzkxNywicGF0aCI6Ii8zNTIxMDY2Ni80Nzc5OTM5MjAtZjJhOWQ5MzgtN2JlNS00YTc0LWJiZmItNmJiMjMxODkwYTE3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA4MTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwODE0VDEzMjUxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI2MTNlYTc0NzExZmQzNDViYzczMDAxOWIyODNlY2I1NGY5YjIwNzA1MjBhMjllNzZmMTIzODBkODRhMjIwOWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.oNhFJElUK9HTB1Pr-TH8ZHfx6FNSEkZXGnxtEXVZoKs"> After analyzing the flame graph, it appears that the main cause of the prolonged execution time is that listRole went through the cache layer, but since the cache
layer does not support RelationalEntityStore, it resulted in multiple database accesses.
Could you please test it again using the configuration below?
```
gravitino.cache.enableWeigher = true
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug report] Auth: list tables API costs too much time even if cache enabled [gravitino]
Posted by "danhuawang (via GitHub)" <gi...@apache.org>.
danhuawang commented on issue #8089:
URL: https://github.com/apache/gravitino/issues/8089#issuecomment-3187938298
@hdygxsj Can you help check this issue ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org