Reputation: 2302
I want to determine the number of vCPUs on an EC2 instance when my app starts up, so that I can set an appropriate number of threads.
How can I do this?
Upvotes: 0
Views: 2040
Reputation: 2302
nproc
will return the number of cores, which is equivalent to the number of vCPUs. This is a good number of threads to use.
Upvotes: 4