Repository navigation
Conversation
|
The Python checkstyle failed. Please run You can install the pre-commit hooks with |
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
|
Many thanks for this @Beetelbrox, really enjoying our conversations around this and we truly appreciate the time and effort you're investing ❤️ The PR looks great, let's merge it in after adding the LRU cache as discussed 🚀 |
|
Thanks a lot @Beetelbrox this is great!! |
|
@Beetelbrox thank you for the awesome PR 🙏. Would you be able to fix the code smell. After that we can merge it. 🚀 |
|
[open-metadata-ingestion] Kudos, SonarCloud Quality Gate passed! |
* Cache ingestion * Uncomment secrets manager * Fix experiment stuff * Fix style * Add LRU cache * Add tests * Fix code smell
* Cache ingestion * Uncomment secrets manager * Fix experiment stuff * Fix style * Add LRU cache * Add tests * Fix code smell
* Fix #5890 - Add health endpoint (#6030) * Add health endpoint * Replace rest_status for health * Update message * [ISSUE-6162] Upgrade RS SQL statement query (#6188) * Upgrade RS SQL statement query * Fix query, remove dupes * [ISSUE-6162] Escape wildcards on revised RS query (#6200) [ISSUE-6162] Escape wildcards on revised RS query (#6200) * Remove retry in ES query (#6191) Remove retry in ES query (#6191) * min/max * Fix #6161 - kill endpoint for Airflow REST (#6244) Fix #6161 - kill endpoint for Airflow REST (#6244) * Fixes #6031 & #6236 -- Handle binary field & UUID when ingesting sample data (#6233) Fixes #6031 & #6236 -- Handle binary field & UUID when ingesting sample data (#6233) * overwrite default sum function to add super for BQ overflow (#6252) * [TASK-6241] Cache ES ingestion when ingesting usage (#6276) * Cache ingestion * Uncomment secrets manager * Fix experiment stuff * Fix style * Add LRU cache * Add tests * Fix code smell * [TASK-6140] Add OMeta header to SQLAlchemy-based queries (#6293) [TASK-6140] Add OMeta header to SQLAlchemy-based queries (#6293) * Fix #6248: Use PUT API instead of POST for tag & tagCategory (#6344) * Fix #6248: Use PUT API instead of POST for tag & tagCategory * Restructure yield_tag topology * Renamed method to create_or_update * compressed logs * Update packages * feat(ui): sync OMD theme with AntD components (#6148) * feat(ui): sync omd theme with antd components * update package.json * fixed failing cypress * fix layout break issue Co-authored-by: Shailesh Parmar <[email protected]> (cherry picked from commit 574dbce) * Fix sql queries formatting Co-authored-by: Francisco J. Jurado Moreno <[email protected]> Co-authored-by: Teddy <[email protected]> Co-authored-by: Mayur Singal <[email protected]> Co-authored-by: Chirag Madlani <[email protected]>








Describe your changes :
As explained on #6241, we've identified that the database usage ingestion does a very large amount of repeated requests to elastisearch and the backend tables for every query/table processed. This PR is a first effort to improve usage ingestion performance by implementing caches/checks in three stages of the process:
metadata_usage&table_mixin: For each table, avoid ingesting the same query more than once as it will add no new information and most of the repetaed queries are created by previous stages in the process.sql_usagecache the result ofsearch_table_entitiesthat does one query to ES and potentially many to backend and was one of the main sources of the slowdown. I wasn't able to find a nice place to put the cache due to the way the code is structured so I ended up creating it as a module-level variable. This is far from ideal but for a nicer setup we'll need to do some restructuring.We did some experiments to evaluate the impact in performance and obtained the results below. Note that to reduce variability we extracted an entire day's worth of queries (~52.5k queries, 57 MB) from RS into a csv file and loaded them from there. All runs below include the sql parsing step which was not optimized:
Not optimized
Optimized
The chart above suggests that the imroved version has a lower complexity, although due to the many parts involved in the execution of each iteration of the ingestion this might be difficult to measure.
There's still plenty of room for improvement as the ones propoed are quite hamfisted and we could greatly reduce the amount of records we generate ourselves but it's a good indicator of how things can improve.
Type of change :
Frontend Preview (Screenshots) :
N/A
Checklist:
Reviewers
@open-metadata/ingestion