juju / charm-tools

Tools for charm authors and maintainers
Other
42 stars 64 forks source link

`charm help` (for example) pegs 8 cores at 100% for 3-4 seconds #208

Open dpb1 opened 8 years ago

dpb1 commented 8 years ago

ii charm 2:2.1.0-0~ubuntu16.04.1~ppa0 amd64 Publish and maintain Juju charms. ii charm-tools 2.1.2-0ubuntu4 all Tools for maintaining Juju charms

charm-tools

I think it's running a bunch of commands charm-* -help in parallel, but still, seems like there might be a better way to do it. :)

mbruzek commented 8 years ago

@dpb1 this is an interesting observation. I tired running charm help on my PC and my 8 cores did spike, but briefly for about one second.

cpu_history_charm_help

I have the following versions:

$ uname -a
Linux warhorse 4.4.0-22-generic #39-Ubuntu SMP Thu May 5 16:53:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ charm version
charm 2.1.1-0ubuntu1
charm-tools 2.1.2
$ dpkg -l | grep charm
ii  charm                                                2.1.1-0ubuntu1                                      amd64  
      Tool for publishing and maintaining Juju charms
ii  charm-tools                                          2.1.2-0ubuntu4                                      all    

The charm command is golang, and the charm-tools command is python. Perhaps we should include the level of python on your system as well.

$ python -V
Python 2.7.11+
$ python3 -V
Python 3.5.1+

ii  python                                               2.7.11-1                                            amd64  
      interactive high-level object-oriented language (default version)
ii  python3                                              3.5.1-3                                             amd64  
      interactive high-level object-oriented language (default python3 version)
mbruzek commented 8 years ago

It seems for this problem we should use the time command to compare actual run times.

$ time charm --help
...
real    0m1.377s
user    0m8.700s
sys     0m0.936s
marcoceppi commented 8 years ago

This isn't an issue with charm-tools, it's with charmstore-client and how it dynamically loads the help information for plugins.

jrwren commented 8 years ago

This PR should make this a one time and then very rare occurrence: https://github.com/juju/charmstore-client/pull/60