GAM
GAM copied to clipboard
Defaulting to 25 threads
Please confirm the following:
- I have upgraded to the latest GAM release from https://github.com/GAM-team/GAM/releases and I still have this issue.
- I am typing the command as described in the GAM Wiki at https://github.com/jay0lee/gam/wiki
Full steps to reproduce the issue:
- Install GAM 6.21 via "bash <(curl -s -S -L https://gam-shortn.appspot.com/gam-install)"
- Perform a bulk operation such as searching for an email in inboxes.
- Computer running gam grinds to a halt as 25 gam processes are spawned
Expected outcome (what are you trying to do?):
GAM doesn't seem to be defaulting to using 5 threads, as described here: https://github.com/GAM-team/GAM/wiki/BulkOperations#determining-how-many-gam-commands-run-in-parallel
Actual outcome (what errors or bad behaviour do you see instead?):
$ unset GAM_THREADS
$ gam all users delete messages query "rfc822msgid:[email protected]"
Getting all Users in Google Workspace account (may take some time on a large account)...
Got 4544 Users...
done getting 4544 Users.
Using 25 processes...
If I set the GAM_THREADS variable to 5 as documented (export GAM_THREADS=) then the behaviour seems to revert to what is documented as the default (5 threads):
$ export GAM_THREADS=5
$ gam all users delete messages query "rfc822msgid:[email protected]"
Getting all Users in Google Workspace account (may take some time on a large account)...
Got 4544 Users...
done getting 4544 Users.
Using 5 processes...
I believe this is a relatively new issue as the last time I used GAM in anger 2-3 months ago I did not have my computer spawn 25 gam worker processes and become almost totally unresponsive.
Many thanks
25 threads should not bog down your computer, unless it is super old. Most apps spawn a lot of threads as there are many cores in the average computer today. How many cores do you have? What CPU are you using? What is the load average? (use htop or uptime)