Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@saidsef
Last active February 13, 2024 13:57
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save saidsef/882647c6589e868b81f0cced4041b132 to your computer and use it in GitHub Desktop.
Save saidsef/882647c6589e868b81f0cced4041b132 to your computer and use it in GitHub Desktop.
AWS Lambda CPU Cores

AWS Lambda

Whats the maximum number of virtual processor cores available in aws lambda

Memory Settings:

Memory: 3008 MB
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 62
model name	: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
stepping	: 4
microcode	: 0x42a
cpu MHz		: 2799.950
cache size	: 25600 KB
physical id	: 0
siblings	: 2
core id		: 0
cpu cores	: 1
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology eagerfpu pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm fsgsbase smep erms xsaveopt
bugs		:
bogomips	: 5600.17
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 62
model name	: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
stepping	: 4
microcode	: 0x42a
cpu MHz		: 2799.950
cache size	: 25600 KB
physical id	: 0
siblings	: 2
core id		: 0
cpu cores	: 1
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology eagerfpu pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm fsgsbase smep erms xsaveopt
bugs		:
bogomips	: 5600.17
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:

Total CPU

CPU count: 2
def lambda_handler(event, context):
    import multiprocessing
    from subprocess import Popen, PIPE, STDOUT
    print "CPU count: {0}".format(multiprocessing.cpu_count())
    print "=" * 50
    p = Popen("cat /proc/cpuinfo", shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
    output = p.stdout.read()
    print output
@hjander
Copy link

hjander commented Feb 29, 2020

thank you, really helpful!

@msiemens
Copy link

msiemens commented Jan 7, 2021

Seems like now vCPU cores are proportional to the amount of memory configured:

Since Lambda allocates CPU power proportional to the amount of memory provisioned, customers now have access to up to 6 vCPUs. This helps compute intensive applications like machine learning, modelling, genomics, and high-performance computing (HPC) application perform faster.

(https://aws.amazon.com/de/about-aws/whats-new/2020/12/aws-lambda-supports-10gb-memory-6-vcpu-cores-lambda-functions/)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment