d2vid
d2vid

Reputation: 2302

How can I determine the number of vCPUs from the command line on an EC2 instance?

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

Answers (1)

d2vid
d2vid

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

Related Questions