Exploring the AWS Lambda Execution Environment

Figure showing a Lambda function that is put under the magnifying glass.

Last updated: November 9, 2019

This blog post provides up-to-date information about the hardware and software profiles of the AWS Lambda execution environment:

  • CPU, memory, disk size, and the execution duration
  • OS version, Linux kernel version, timezone, runtime versions, AWS SDK versions, environment variables, resource limits, and the list of RPM packages

General Information

AWS Lambda is available in 18 AWS regions:

  • ap-east-1
  • ap-northeast-1
  • ap-northeast-2
  • ap-south-1
  • ap-southeast-1
  • ap-southeast-2
  • ca-central-1
  • eu-central-1
  • eu-north-1
  • eu-west-1
  • eu-west-2
  • eu-west-3
  • me-south-1
  • sa-east-1
  • us-east-1
  • us-east-2
  • us-west-1
  • us-west-2

AWS Lambda runs your code on a fleet of Amazon EC2 instances across different availability zones in a region. CPU model of these instances can be, for example, the following:

  • Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz
  • Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
  • AWS Lambda allocates CPU power proportionally to the configured memory.
    The more memory you configure for your Lambda function, the more CPU power is allocated for this Lambda function. For example, at 1792 MB a Lambda function has the equivalent of 1 vCPU.

You can set the amount of memory that your Lambda function has access to in 64 MB increments from 128 MB to 3008 MB.

You can set the timeout for your Lambda function to any value between 1 second and the maximum execution duration per request, which is 900 seconds.

Ephemeral disk size (/tmp size) is 526 MB. /dev/shm is not supported.

Timezone is UTC.

Runtimes

AWS Lambda has built-in support of the following runtime versions:

  • .NET Core 2.1
  • Go 1.x
  • Java 1.8.0_201
  • Node.js 8.10.0, 10.17.0
  • Python 2.7.16, 3.6.9, 3.7.5
  • Ruby 2.5.7p206
  • Runtimes Node.js 0.10, Node.js 4.3, Node.js 6.10, .NET Core 1.0, and .NET Core 2.0 are end-of-life.

The Runtime API allows you to write Lambda functions in any language. Also, you can use available open-source runtimes, for example, C++ and Rust.

OS and Kernel

The following table lists the OS and Linux kernel versions of the AWS Lambda execution environment in different runtimes.

OSKernelRuntime
Amazon Linux AMI release 2018.034.14.133-97.112.amzn2.x86_64
  • dotnetcore2.1
  • go1.x
  • java8
  • nodejs8.10
  • python2.7
  • python3.6
  • python3.7
  • ruby2.5
Amazon Linux release 2 (Karoo)4.14.133-97.112.amzn2.x86_64nodejs10.x

AWS SDK Versions

The AWS SDK is pre-installed in Python, Ruby, and Node.js runtimes.

VersionRuntime
boto31.9.221
botocore1.12.221
  • python2.7
  • python3.6
  • python3.7
aws-sdk 2.488.0
  • nodejs10.x
  • nodejs8.10
aws-sdk 3.0.1ruby2.5

Environment Variables

The following table lists the environment variables that are set in the AWS Lambda execution environment in different regions and runtimes.

KeyValue
AWS_DEFAULT_REGION
  • ap-east-1
  • ap-northeast-1
  • ap-northeast-2
  • ap-south-1
  • ap-southeast-1
  • ap-southeast-2
  • ca-central-1
  • eu-central-1
  • eu-north-1
  • eu-west-1
  • eu-west-2
  • eu-west-3
  • me-south-1
  • sa-east-1
  • us-east-1
  • us-east-2
  • us-west-1
  • us-west-2
AWS_EXECUTION_ENV
  • AWS_Lambda_dotnetcore2.1
  • AWS_Lambda_go1.x
  • AWS_Lambda_java8
  • AWS_Lambda_nodejs10.x
  • AWS_Lambda_nodejs8.10
  • AWS_Lambda_python2.7
  • AWS_Lambda_python3.6
  • AWS_Lambda_python3.7
  • AWS_Lambda_ruby2.5
AWS_LAMBDA_FUNCTION_MEMORY_SIZEMemory size in MB
AWS_REGION
  • ap-east-1
  • ap-northeast-1
  • ap-northeast-2
  • ap-south-1
  • ap-southeast-1
  • ap-southeast-2
  • ca-central-1
  • eu-central-1
  • eu-north-1
  • eu-west-1
  • eu-west-2
  • eu-west-3
  • me-south-1
  • sa-east-1
  • us-east-1
  • us-east-2
  • us-west-1
  • us-west-2
GEM_HOMEOnly for ruby2.5 runtime:
/var/runtime
GEM_PATHOnly for ruby2.5 runtime:
/var/task/vendor/bundle/ruby/2.5.0:/opt/ruby/gems/2.5.0
LAMBDA_RUNTIME_DIR/var/runtime
LAMBDA_TASK_ROOT/var/task
LANGen_US.UTF-8
LD_LIBRARY_PATH
  • For go1.x, java8 and python2.7 runtimes:
    /lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib:/opt/lib
  • For dotnetcore2.1, nodejs10.x, nodejs8.10, python3.6, python3.7 and ruby2.5 runtimes:
    /var/lang/lib:/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib:/opt/lib
NODE_PATH
  • For nodejs10.x runtime:
    /opt/nodejs/node10/node_modules:/opt/nodejs/node_modules:/var/runtime/node_modules
  • For nodejs8.10 runtime:
    /opt/nodejs/node8/node_modules:/opt/nodejs/node_modules:/var/runtime/node_modules:/var/runtime:/var/task:/var/runtime/node_modules
PATH
  • For go1.x, java8 and python2.7 runtimes:
    /usr/local/bin:/usr/bin/:/bin:/opt/bin
  • For dotnetcore2.1, nodejs10.x, nodejs8.10, python3.6 and python3.7 runtimes:
    /var/lang/bin:/usr/local/bin:/usr/bin/:/bin:/opt/bin
  • For ruby2.5 runtime:
    /var/lang/bin:/var/lang/bin:/usr/local/bin:/usr/bin/:/bin:/opt/bin
PYTHONPATHOnly for python2.7 and python3.6 runtimes:
/var/runtime
RUBYLIBOnly for ruby2.5 runtime:
/var/task:/var/runtime/lib:/opt/ruby/lib
TZ:UTC
  • Values of AWS_ACCESS_KEY, AWS_ACCESS_KEY_ID, AWS_LAMBDA_FUNCTION_NAME, AWS_LAMBDA_FUNCTION_VERSION, AWS_LAMBDA_LOG_GROUP_NAME, AWS_LAMBDA_LOG_STREAM_NAME, AWS_LAMBDA_RUNTIME_API, AWS_SECRET_ACCESS_KEY, AWS_SECRET_KEY, AWS_SECURITY_TOKEN, AWS_SESSION_TOKEN, AWS_XRAY_CONTEXT_MISSING, AWS_XRAY_DAEMON_ADDRESS, _AWS_XRAY_DAEMON_ADDRESS, _AWS_XRAY_DAEMON_PORT, _HANDLER, _LAMBDA_CONSOLE_SOCKET, _LAMBDA_CONTROL_SOCKET, _LAMBDA_LOG_FD, _LAMBDA_RUNTIME_LOAD_TIME, _LAMBDA_SB_ID, _LAMBDA_SERVER_PORT, _LAMBDA_SHARED_MEM_FD and _X_AMZN_TRACE_ID are not listed in this table.

Resource Limits

The following table lists the resource limits of the AWS Lambda execution environment in all supported built-in runtimes.

ResourceSoft LimitHard Limit
asunlimitedunlimited
coreunlimitedunlimited
cpuunlimitedunlimited
dataunlimitedunlimited
fsizeunlimitedunlimited
memlock6553665536
nofile10241024
nproc736736
rssunlimitedunlimited
stack8388608unlimited

RPM Packages of Amazon Linux 2018.03

All supported built-in runtimes except Node.js 10.x run on Amazon Linux AMI release 2018.03.

The AWS Lambda execution environment of these runtimes contains a wide range of tools and libraries. For example, it contains ImageMagick, curl, libpng, libtiff, and even the Python interpreter.

The following table lists the RPM packages that are pre-installed in the AWS Lambda execution environment of all supported built-in runtimes except Node.js 10.x.

NameVersionReleaseArch
ImageMagick6.7.8.915.21.amzn1x86_64
alsa-lib1.0.223.9.amzn1x86_64
audit-libs2.6.53.28.amzn1x86_64
avahi-libs0.6.2512.17.amzn1x86_64
basesystem10.04.9.amzn1noarch
bash4.2.4628.37.amzn1x86_64
binutils2.25.131.base.66.amzn1x86_64
bzip21.0.68.12.amzn1x86_64
bzip2-libs1.0.68.12.amzn1x86_64
ca-certificates2018.2.2265.1.20.amzn1noarch
cairo1.12.146.8.amzn1x86_64
chkconfig1.3.49.32.14.amzn1x86_64
compat-gmp44.3.21.14.amzn1x86_64
copy-jdk-configs3.310.3.amzn1noarch
coreutils8.2215.52.amzn1x86_64
cpio2.1012.12.amzn1x86_64
cracklib2.8.164.14.amzn1x86_64
cracklib-dicts2.8.164.14.amzn1x86_64
cups-libs1.4.267.21.amzn1x86_64
curl7.61.112.93.amzn1x86_64
cyrus-sasl-lib2.1.2313.16.amzn1x86_64
db44.7.2518.11.amzn1x86_64
db4-utils4.7.2518.11.amzn1x86_64
dbus-libs1.6.1214.29.amzn1x86_64
dejavu-fonts-common2.336.6.amzn1noarch
dejavu-sans-fonts2.336.6.amzn1noarch
dejavu-serif-fonts2.336.6.amzn1noarch
diffutils3.34.15.amzn1x86_64
elfutils-libelf0.1688.19.amzn1x86_64
expat2.1.010.21.amzn1x86_64
file5.343.37.amzn1x86_64
file-libs5.343.37.amzn1x86_64
filesystem2.4.303.8.amzn1x86_64
findutils4.4.26.9.amzn1x86_64
fontconfig2.8.05.8.amzn1x86_64
fontpackages-filesystem1.411.1.2.amzn1noarch
freetype2.3.1115.14.amzn1x86_64
gawk3.1.710.10.amzn1x86_64
gdbm1.8.036.6.amzn1x86_64
ghostscript-fonts5.5023.2.7.amzn1noarch
giflib4.1.63.1.6.amzn1x86_64
glib22.36.35.21.amzn1x86_64
glibc2.17260.175.amzn1x86_64
glibc-common2.17260.175.amzn1x86_64
gmp6.0.011.16.amzn1x86_64
gnupg22.0.282.33.amzn1x86_64
gnutls2.12.2321.18.amzn1x86_64
gpg-pubkey21c0f39f56d0e29a(none)
gpgme1.4.35.15.amzn1x86_64
grep2.203.18.amzn1x86_64
groff-base1.22.28.11.amzn1x86_64
gzip1.59.19.amzn1x86_64
hwdata0.23314.1.19.amzn1noarch
info5.14.10.amzn1x86_64
jasper-libs1.900.121.9.amzn1x86_64
java-1.8.0-openjdk1.8.0.201.b090.43.amzn1x86_64
java-1.8.0-openjdk-headless1.8.0.201.b090.43.amzn1x86_64
javapackages-tools0.9.11.5.amzn1noarch
jbigkit-libs2.011.4.amzn1x86_64
jpackage-utils1.7.527.17.amzn1noarch
keyutils-libs1.5.83.12.amzn1x86_64
kmod1410.10.amzn1x86_64
kmod-libs1410.10.amzn1x86_64
krb5-libs1.15.134.44.amzn1x86_64
lcms22.62.5.amzn1x86_64
libICE1.0.61.4.amzn1x86_64
libSM1.2.12.6.amzn1x86_64
libX111.6.02.2.12.amzn1x86_64
libX11-common1.6.02.2.12.amzn1x86_64
libXau1.0.64.9.amzn1x86_64
libXcomposite0.4.34.6.amzn1x86_64
libXdamage1.1.34.7.amzn1x86_64
libXext1.3.22.1.10.amzn1x86_64
libXfixes5.0.12.1.8.amzn1x86_64
libXfont1.4.55.12.amzn1x86_64
libXi1.7.22.2.9.amzn1x86_64
libXrender0.9.82.1.9.amzn1x86_64
libXt1.1.46.1.9.amzn1x86_64
libXtst1.2.22.1.9.amzn1x86_64
libXxf86vm1.1.32.1.9.amzn1x86_64
libacl2.2.496.11.amzn1x86_64
libassuan2.0.33.3.amzn1x86_64
libattr2.4.4612.10.amzn1x86_64
libblkid2.23.259.29.amzn1x86_64
libcap2.165.5.8.amzn1x86_64
libcap-ng0.7.54.15.amzn1x86_64
libcom_err1.43.52.43.amzn1x86_64
libcurl7.61.112.93.amzn1x86_64
libdrm2.4.821.14.amzn1x86_64
libffi3.0.1316.5.amzn1x86_64
libfontenc1.0.52.6.amzn1x86_64
libgcc727.2.12.59.amzn1x86_64
libgcrypt1.5.312.19.amzn1x86_64
libglvnd0.2.99914.20170308git8e6e102.3.amzn1x86_64
libglvnd-glx0.2.99914.20170308git8e6e102.3.amzn1x86_64
libgomp6.4.11.45.amzn1x86_64
libgpg-error1.111.12.amzn1x86_64
libicu50.1.211.12.amzn1x86_64
libidn20.161.2.amzn1x86_64
libjpeg-turbo1.2.908.16.amzn1x86_64
libmount2.23.259.29.amzn1x86_64
libnghttp21.31.12.5.amzn1x86_64
libpciaccess0.13.14.1.11.amzn1x86_64
libpng1.2.492.14.amzn1x86_64
libpsl0.6.21.2.amzn1x86_64
libpwquality1.2.34.8.amzn1x86_64
libselinux2.1.103.22.amzn1x86_64
libsepol2.1.73.12.amzn1x86_64
libsmartcols2.23.259.29.amzn1x86_64
libssh21.4.23.12.amzn1x86_64
libstdc++727.2.12.59.amzn1x86_64
libtasn12.36.6.amzn1x86_64
libtiff4.0.332.34.amzn1x86_64
libtool-ltdl2.4.220.4.8.5.32.amzn1x86_64
libudev1734.13.amzn1x86_64
libunistring0.9.36.1.amzn1x86_64
libuser0.607.23.amzn1x86_64
libutempter1.1.54.1.6.amzn1x86_64
libuuid2.23.259.29.amzn1x86_64
libverto0.2.54.9.amzn1x86_64
libwmf-lite0.2.8.441.13.amzn1x86_64
libxcb1.112.21.amzn1x86_64
libxml22.9.16.3.52.amzn1x86_64
libxshmfence1.21.4.amzn1x86_64
libxslt1.1.285.13.amzn1x86_64
lksctp-tools1.0.107.7.amzn1x86_64
lua5.1.44.1.9.amzn1x86_64
make3.8221.10.amzn1x86_64
mesa-dri-drivers17.1.52.41.amzn1x86_64
mesa-filesystem17.1.52.41.amzn1x86_64
mesa-libGL17.1.52.41.amzn1x86_64
mesa-libglapi17.1.52.41.amzn1x86_64
ncurses5.74.20090207.14.amzn1x86_64
ncurses-base5.74.20090207.14.amzn1x86_64
ncurses-libs5.74.20090207.14.amzn1x86_64
nspr4.19.01.43.amzn1x86_64
nss3.36.05.82.amzn1x86_64
nss-pem1.0.34.3.amzn1x86_64
nss-softokn3.36.05.42.amzn1x86_64
nss-softokn-freebl3.36.05.42.amzn1x86_64
nss-sysinit3.36.05.82.amzn1x86_64
nss-tools3.36.05.82.amzn1x86_64
nss-util3.36.01.54.amzn1x86_64
openldap2.4.4016.31.amzn1x86_64
openssl1.0.2k16.150.amzn1x86_64
p11-kit0.18.52.3.amzn1x86_64
p11-kit-trust0.18.52.3.amzn1x86_64
pam1.1.812.33.amzn1x86_64
patch2.7.112.14.amzn1x86_64
pcre8.217.8.amzn1x86_64
perl5.16.3294.43.amzn1x86_64
perl-Carp1.26244.5.amzn1noarch
perl-Encode2.517.5.amzn1x86_64
perl-Exporter5.683.5.amzn1noarch
perl-File-Path2.092.5.amzn1noarch
perl-File-Temp0.23.013.5.amzn1noarch
perl-Filter1.493.5.amzn1x86_64
perl-Getopt-Long2.403.6.amzn1noarch
perl-HTTP-Tiny0.0333.6.amzn1noarch
perl-PathTools3.405.5.amzn1x86_64
perl-Pod-Escapes1.04294.43.amzn1noarch
perl-Pod-Perldoc3.204.7.amzn1noarch
perl-Pod-Simple3.284.6.amzn1noarch
perl-Pod-Usage1.633.5.amzn1noarch
perl-Scalar-List-Utils1.27248.5.amzn1x86_64
perl-Socket2.0103.5.amzn1x86_64
perl-Storable2.453.5.amzn1x86_64
perl-Text-ParseWords3.294.5.amzn1noarch
perl-Time-HiRes1.9725272.5.amzn1x86_64
perl-Time-Local1.23002.5.amzn1noarch
perl-constant1.272.5.amzn1noarch
perl-libs5.16.3294.43.amzn1x86_64
perl-macros5.16.3294.43.amzn1x86_64
perl-parent0.225244.5.amzn1noarch
perl-podlators2.5.13.8.amzn1noarch
perl-threads1.874.5.amzn1x86_64
perl-threads-shared1.436.5.amzn1x86_64
pinentry0.7.66.11.amzn1x86_64
pixman0.32.44.11.amzn1x86_64
pkgconfig0.27.12.7.amzn1x86_64
popt1.137.7.amzn1x86_64
procps3.2.845.16.amzn1x86_64
psmisc22.208.12.amzn1x86_64
pth2.0.79.3.7.amzn1x86_64
python272.7.161.129.amzn1x86_64
python27-iniparse0.3.12.1.9.amzn1noarch
python27-libs2.7.161.129.amzn1x86_64
python27-pycurl7.19.017.12.amzn1x86_64
python27-pygpgme0.39.12.amzn1x86_64
python27-pyliblzma0.5.311.6.amzn1x86_64
python27-pyxattr0.5.01.6.amzn1x86_64
python27-urlgrabber3.108.16.amzn1noarch
python363.6.81.14.amzn1x86_64
python36-libs3.6.81.14.amzn1x86_64
python36-pip9.0.31.26.amzn1noarch
python36-setuptools36.2.71.33.amzn1noarch
readline6.29.14.amzn1x86_64
rpm4.11.321.75.amzn1x86_64
rpm-build-libs4.11.321.75.amzn1x86_64
rpm-libs4.11.321.75.amzn1x86_64
rpm-python274.11.321.75.amzn1x86_64
sed4.2.110.10.amzn1x86_64
setup2.8.1420.12.amzn1noarch
shadow-utils4.1.4.213.10.amzn1x86_64
shared-mime-info1.19.8.amzn1x86_64
sqlite3.7.178.14.amzn1x86_64
sysctl-defaults1.01.1.amzn1noarch
system-release2018.030.0noarch
tar1.2631.22.amzn1x86_64
ttmkfdir3.0.932.1.5.amzn1x86_64
tzdata2019b1.72.amzn1noarch
tzdata-java2019b1.72.amzn1noarch
unzip6.04.10.amzn1x86_64
urw-fonts2.410.7.amzn1noarch
util-linux2.23.259.29.amzn1x86_64
which2.196.10.amzn1x86_64
xorg-x11-font-utils7.211.5.amzn1x86_64
xorg-x11-fonts-Type17.29.1.5.amzn1noarch
xz5.1.212alpha.12.amzn1x86_64
xz-libs5.1.212alpha.12.amzn1x86_64
yum3.4.3150.70.amzn1noarch
yum-metadata-parser1.1.410.20.amzn1x86_64
yum-plugin-priorities1.1.3146.30.amzn1noarch
zlib1.2.87.18.amzn1x86_64

RPM Packages of Amazon Linux 2

Node.js 10.x runtime runs on Amazon Linux release 2 (Karoo).

The AWS Lambda execution environment of this runtime is minimalistic. It does not contain a wide range of tools and libraries. You may need to include additional tools and libraries into a layer and attach this layer to the execution environment of your Lambda function.

The following table lists the RPM packages that are pre-installed in the AWS Lambda execution environment of Node.js 10.x runtime.

NameVersionReleaseArch
basesystem10.07.amzn2.0.1noarch
bash4.2.4630.amzn2x86_64
ca-certificates2018.2.2270.0.amzn2noarch
chkconfig1.7.41.amzn2.0.2x86_64
coreutils8.2221.amzn2x86_64
filesystem3.225.amzn2.0.4x86_64
gawk4.0.24.amzn2.1.2x86_64
glibc2.2632.amzn2.0.2x86_64
glibc-all-langpacks2.2632.amzn2.0.2x86_64
glibc-common2.2632.amzn2.0.2x86_64
glibc-minimal-langpack2.2632.amzn2.0.2x86_64
gmp6.0.015.amzn2.0.2x86_64
gpg-pubkeyc87f5b1a593863f8(none)
grep2.203.amzn2.0.2x86_64
info5.15.amzn2x86_64
keyutils-libs1.5.83.amzn2.0.2x86_64
krb5-libs1.15.120.amzn2.0.1x86_64
libacl2.2.5114.amzn2x86_64
libattr2.4.4612.amzn2.0.2x86_64
libcap2.229.amzn2.0.2x86_64
libcom_err1.42.912.amzn2.0.2x86_64
libffi3.0.1318.amzn2.0.2x86_64
libgcc7.3.16.amzn2.0.4x86_64
libselinux2.512.amzn2.0.2x86_64
libsepol2.58.1.amzn2.0.2x86_64
libstdc++7.3.16.amzn2.0.4x86_64
libtasn14.101.amzn2.0.2x86_64
libverto0.2.54.amzn2.0.2x86_64
ncurses6.08.20170212.amzn2.1.3x86_64
ncurses-base6.08.20170212.amzn2.1.3noarch
ncurses-libs6.08.20170212.amzn2.1.3x86_64
nspr4.21.01.amzn2.0.2x86_64
nss-softokn-freebl3.44.05.amzn2.0.2x86_64
nss-util3.44.03.amzn2.0.2x86_64
openssl-libs1.0.2k16.amzn2.1.1x86_64
p11-kit0.23.53.amzn2.0.2x86_64
p11-kit-trust0.23.53.amzn2.0.2x86_64
pcre8.3217.amzn2.0.2x86_64
popt1.1316.amzn2.0.2x86_64
sed4.2.25.amzn2.0.2x86_64
setup2.8.7110.amzn2noarch
system-release210.amzn2x86_64
tzdata2019b1.amzn2noarch
zlib1.2.717.amzn2.0.2x86_64
  • This blog post is based on the information from the following 10 AWS regions: ap-northeast-1, ap-northeast-2, ap-south-1, ap-southeast-2, ca-central-1, eu-central-1, sa-east-1, us-east-1, us-east-2 and us-west-2.