Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git call running 100% CPU #1177

Closed
thoreinstein opened this issue Apr 15, 2015 · 12 comments
Closed

Git call running 100% CPU #1177

thoreinstein opened this issue Apr 15, 2015 · 12 comments

Comments

@thoreinstein
Copy link

PM2: 0.12.10
IOJS: v.1.5.1
OS: Ubuntu 12.04.4 LTS

I am seeing this with a crashed process that is attempting to restart. It seems to be coming from:
https://github.com/keymetrics/vizion/blob/07638d9e90e969829fee36ad0912e5464667186b/lib/git.js#L27

1__cloud_u12044ltsba-001_____ssh_

I honestly don't see what the git log has to do with attempting to restart a crashed process, or why it chews up CPU.

@jshkurti
Copy link
Contributor

It comes from the vizion module which grabs metadata about the repository.
Which version of vizion do you have ?

@jshkurti
Copy link
Contributor

It does indeed refresh the metadata at each restart.

@jshkurti
Copy link
Contributor

Normally, these commands are really fast, they shouldn't stay on htop for long but just in case there is a timeout of 60s by default to cancel them if they did not succeed.

@thoreinstein
Copy link
Author

The installed vizion version is 0.2.5, installed on this system yesterday. I understand what it is doing, I don't understand why. Timeout or no, they are still pegging the CPU at 100%+ sometimes with an individual process.

@Unitech
Copy link
Owner

Unitech commented Apr 15, 2015

@jshkurti we should reduce the timeout to 5-3secs instead of 60s

jorge-d added a commit to keymetrics/vizion that referenced this issue Apr 16, 2015
jshkurti added a commit to keymetrics/vizion that referenced this issue Apr 16, 2015
Change timeout to 5 seconds instead of 60 Unitech/pm2#1177
@jshkurti
Copy link
Contributor

@janders223 we will implement a --no-vizion flag soon so you could completely remove this feature.

@jshkurti
Copy link
Contributor

Hi @janders223, check out the new release of PM2 https://github.com/Unitech/PM2/releases
You can now specify --no-vizion flag when you start an app so it won't do any git commands at all ;)

@thoreinstein
Copy link
Author

While I appreciate the work, this seems like a band-aid for a larger underlying problem. Have you spent any time at all to investigate the actual issue reported here?

@jshkurti
Copy link
Contributor

What happens when you LC_ALL=en_US.UTF-8 git show --quiet --format=%H%n%aD%n%s%n%B HEAD manually in the folder of your app ?
Does it take a long time to finish ?

@jshkurti
Copy link
Contributor

Hmm actually vizion isn't supposed to execute multiple parallel instances but when a restart occurs we refreshed the flag value.
I fixed that: eb5b2fa
Can you give it a try please ? Now it should not spawn 15 git commands anymore.
npm i -g git://github.com/Unitech/PM2#development

@thoreinstein
Copy link
Author

That seems to have helped.

@jshkurti
Copy link
Contributor

Thanks for the feedback 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants