Add script to analyze installer log for action run times#989
Add script to analyze installer log for action run times#989ehelms wants to merge 3 commits intotheforeman:developfrom
Conversation
| profile << {:task => evaltrace[:resource], :time => evaltrace[:time].to_f} | ||
| end | ||
|
|
||
| profile.sort! { |a,b| b[:time] <=> a[:time] } |
There was a problem hiding this comment.
I prefer sort_by when I can
| profile.sort! { |a,b| b[:time] <=> a[:time] } | |
| profile.sort_by! { |p| p[:time] } |
This runs
This all also loads the Rails environment one way or another. So that's 7 times we do something that takes at least 25 seconds. I have no idea if we can, but any time we can save there pays itself back very well. That said, in some things the Puppet model just limits us. If there was a way to determine if something changed rather (like Ansible) than needing to run some expensive script it would speed up. More importantly. the services can start in parallel. I've been wondering if we can define a systemd target ( |
|
Note that https://github.com/Shopify/bootsnap says it can work in production:
Also:
We currently on have: So it's not used in production. |
I gave this a cursory test in production, on an already installed machine, re-running the installer but with services stopped. Before bootsnap: After bootsnap: Bootsnap saves ~43 seconds. For a fresh installation scenario with bootsnap, total 220 sec and 276 for non-bootsnap saving the same amount of time: |
|
That's nice win IMHO. They do mention the cache directory isn't cleaned so let's discuss strategies for that. If it's stored in |
|
When running this I get a gazillion of: before the first "useful" line. Is it expected? |
Co-authored-by: Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>
|
It seems that there are some problems with entries related to keystore and truststore: |
FYI it looks like the problem is with resources that have multiple |
Co-authored-by: Pablo Méndez Hernández <pablomh@gmail.com>
|
|
||
| profile = [] | ||
|
|
||
| #2021-04-27 01:13:35 [DEBUG ] [configure] /Stage[main]/Foreman/Foreman::Rake[apipie:cache:index]/Exec[foreman-rake-apipie:cache:index]: Evaluated in 86.60 seconds |
There was a problem hiding this comment.
| #2021-04-27 01:13:35 [DEBUG ] [configure] /Stage[main]/Foreman/Foreman::Rake[apipie:cache:index]/Exec[foreman-rake-apipie:cache:index]: Evaluated in 86.60 seconds | |
| # 2021-04-27 01:13:35 [DEBUG ] [configure] /Stage[main]/Foreman/Foreman::Rake[apipie:cache:index]/Exec[foreman-rake-apipie:cache:index]: Evaluated in 86.60 seconds |
| next if evaltrace.nil? | ||
| profile << {:task => evaltrace[:resource], :time => evaltrace[:time].to_f} |
There was a problem hiding this comment.
| next if evaltrace.nil? | |
| profile << {:task => evaltrace[:resource], :time => evaltrace[:time].to_f} | |
| next if evaltrace.nil? | |
| profile << { :task => evaltrace[:resource], :time => evaltrace[:time].to_f } |
| profile = [] | ||
|
|
||
| #2021-04-27 01:13:35 [DEBUG ] [configure] /Stage[main]/Foreman/Foreman::Rake[apipie:cache:index]/Exec[foreman-rake-apipie:cache:index]: Evaluated in 86.60 seconds | ||
| EVALTRACE = %r{.+/(?<resource>.+\[.+\]): Evaluated in (?<time>\d+\.\d+) seconds} |
There was a problem hiding this comment.
| EVALTRACE = %r{.+/(?<resource>.+\[.+\]): Evaluated in (?<time>\d+\.\d+) seconds} | |
| EVALTRACE = %r{.+/(?<resource>.+\[.+\]): Evaluated in (?<time>\d+\.\d+) seconds}.freeze |
I've had this little script for a while, and wanted to stop losing track of where it is. The idea is it analyzes an installer run log file and identifies the actions that took the longest. For example, a recent analysis: