Create Database Troubleshooting/Opitimisation Guide for Harbor #18199
Replies: 3 comments 2 replies
-
@slushysnowman @Vad1mo @wy65701436 @MarcelMue @AlexBarth13 tagging you here so we can kick off this! :) |
Beta Was this translation helpful? Give feedback.
-
where do you want us to share our experiences? Maybe as a |
Beta Was this translation helpful? Give feedback.
-
Hello, There's few queries very usefull in order to track performance issues. with pg_stats_statement activated : datname is the database name, here it's breghr1, not sure if it's the default name of harbor. to reset the stats : This will give you a good overview of which queries are time consuming Exemple with our production :
The results here are quite fine because we have implemented a cleaning cronjob. Based on this stackoverflow topic https://stackoverflow.com/questions/2596670/how-do-you-find-the-row-count-for-all-your-tables-in-postgres Get the number of rows in each table :
Here is the result with production :
Based on the top tables we can look at how datas are handled :
Here is an example with our production :
Based on the top time consuming queries and average, the most interesting tables are
with informations from pg_stat_user_tables : there's a lot of activities over artifact and task which are executed sequentially (without any index) vulnerability_record is ok because it uses indexes most of the time Here are an example of 3 queries over vulnerability record :
That's a first approach for troubleshooting performances. We still have something to do with our audit_log because it's never been cleaned. |
Beta Was this translation helpful? Give feedback.
-
Hello Community,
looks like we have a big gab in the area of DB optimisation for running Harbor!
Let's use this discussion to collect all ideas and the we can work on make it structured and in paragraphs so it will be easy to consume by anyone!
I urge everyone to share their tips on that topic in format like:
Issue faced:
Symptoms:
Troubleshooting:
Fixes and Optimisation steps:
Beta Was this translation helpful? Give feedback.
All reactions