-
Notifications
You must be signed in to change notification settings - Fork 78
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
High cpu usage #2556
Comments
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support. |
Hello @pavel-lobach 👋 It looks like you didn't include the full Salesforce CLI version information in your issue. A few more things to check:
Thank you! |
The behavior is the same on the number of recent versions , including the most recent one 2.15.9. |
@pavel-lobach, there is other information in |
@iowillhoit This is the output inside the container with CLI v 2.11.8: { |
Hello @pavel-lobach 👋 None of the versions of Shared: Update to the latest version of Salesforce CLI (docs) and confirm that you're still seeing your issue. After updating, share the full output of |
I confirm that the issue is there on the latest version. I had to downgrade to check if it helps or not. But it does not help. Here is the output with the recent one. { |
One easy thing to change would be the nodejs version. v19 isn't supported anymore so maybe switching to v20.9.0 would have different results. |
Will try to upgrade the node. But not sure that node is the case. I suppose the CLI always pulls the results from SF. How often? Is it possible to reduce the frequency of pulling of the results? Because to be clear, the command takes about 45-55 minutes. And all the time the process takes so much cpu. |
One more observation. While the container is waiting for the result from Salesforce (about 30-35 minutes) it takes higher CPU % than the process consumes when it starts to extract the received zip file. So the extraction of the zip is easier than the metadata retrieve ) |
I'm able to see that hitting about 300% (that's 3 cores) on a large, slow retrieve, but not the whole time. It's ok for a while (around 2% CPU, polling freq is 500ms) and responses are small like
Then when it gets the real response with the zip file, etc is when the CPU use got crazy for me. And that's kinda reasonable since there's a lot going on (multiple unzipping steps, xml/js conversion/decomposition, a lot of fs operations, and source tracking stuff. Am going close this, and encourage you to use a supported node version. see https://nodejs.org/en/about/previous-releases |
What we saw is completely opposite things when the CLI commands are run in docker containers. Almost 99% of the time the CPU usage is about 100+%, but when the CLI starts to extract and process, then the load reduces to ~30-50%. This is very strange. Something consumes the CPU when the CLI should be idle. So the questions that may help are:
|
Salesforce CLI utilizes extremely huge CPU percentage when it executed any command. We execute commands from Node.js using spawn process. The process is built by that way so almost always at least one of the commands is running, either 'sf project retrieve start' or 'sf package installed list'.
As I understand when the project is being retrieved, it just waits for the answer from Salesforce, but in fact it takes almost full CPU for the entire process, which may take about 60 minutes. So this is weird, the cli should be almost idle at the most time.
Here is the screenshot with CPU usage where 3 different processes are retrieving the metadata in separate docker containers. As you see almost 100% of the time the cpu load is about 100% (blue graph).
It is hard to give you the steps to reproduce, do you have any ideas what can we check?
The text was updated successfully, but these errors were encountered: