게시 2026-11-21Published 2026-11-21AWS Core읽는 시간 15분15 min read직접 테스트: 서울 리전, Qwen2.5-1.5B 모델과 g6.2xlarge, g6f.xlarge, 구성별 3회Tested first-hand: Seoul Region, Qwen2.5-1.5B on g6.2xlarge and g6f.xlarge, 3 runs per configuration

AWS Lambda GPU 함수의 시작과 동시성Start-up and concurrency of AWS Lambda GPU functions

AWS Lambda가 2026년 11월 18일에 출시한 GPU 함수를 서울 리전에 직접 배포해 시작 시간, 동시 처리량, 확장과 배포 중의 동작을 테스트해 보았습니다. vLLM 함수는 버전 발행부터 Active까지 구성에 따라 5분 28초에서 7분 33초가 걸렸고 동시성을 48로 올리자 L4 GPU 한 장이 초당 2,885토큰을 처리했습니다. 하지만 SOCI는 이미지 준비 시간을 72% 줄이는 대신 초기화 시간을 늘려 전체로는 10% 단축에 그쳤고 기본 핸들러는 토큰 스트리밍을 지원하지 않았습니다.I deployed the GPU functions AWS Lambda launched on November 18, 2026 in the Seoul Region and tested start-up time, concurrent throughput, and what happens during scaling and deployment. A vLLM function took 5 min 28 s to 7 min 33 s from publish to Active depending on the configuration, and with the concurrency set to 48 one L4 GPU served 2,885 tokens per second. But SOCI cut the image phase by 72% while lengthening initialization, so the total shrank by only 10%, and the default handler did not support token streaming.

#AWS Lambda#Lambda Managed Instances#GPU#vLLM#LLM inference

01

Lambda GPU 함수의 구조와 이해

AWS Lambda가 2026년 11월 18일에 출시한 GPU 함수를 서울 리전(ap-northeast-2)에 배포해 테스트했습니다.

테스트 전에 확인하려던 항목은 서울 리전 동작 여부, 코드에서 실행까지 걸리는 시간, SOCI 지연 로딩의 효과, 동시 요청 처리, 0에서 복귀하는 시간, 토큰 스트리밍 여섯 가지입니다. 발표문과 출시 블로그가 제시한 수치가 서울 리전에서 재현되는지, 문서만으로는 알 수 없는 동작이 무엇인지를 보려고 했습니다. 같은 날 문서 기준으로 정리한 AWS에서 vLLM을 실행하는 플랫폼 여섯 가지와 선택 기준에서 확인하지 못하고 남겨 둔 서울 리전 지원과 응답 스트리밍도 여기에 포함했습니다.

Lambda GPU 함수는 Lambda Managed Instances 위에서 실행됩니다. Lambda Managed Instances는 함수를 내 계정의 EC2 인스턴스에서 실행하되 인스턴스의 시작, 패치, 확장, 요청 라우팅을 Lambda가 맡는 방식입니다. 이번 출시로 여기에 EC2 G 계열 GPU 인스턴스를 사용할 수 있게 됐습니다.

구성 요소는 네 가지입니다. 용량 공급자(capacity provider)는 어떤 인스턴스 유형을 몇 vCPU까지 사용할지 정하는 리소스입니다. 함수의 버전을 발행하면 Lambda가 용량 공급자의 서브넷에 GPU 인스턴스를 시작합니다. 인스턴스 안에서는 GPU 하나를 전용으로 사용하는 실행 환경(execution environment)이 시작되고 실행 환경 하나가 여러 요청을 동시에 처리합니다. 동시에 처리하는 요청 수의 상한은 동시성(PerExecutionEnvironmentMaxConcurrency) 설정으로 정합니다.

호출하는 쪽에서 Lambda 서비스를 거쳐 내 계정 VPC의 GPU 인스턴스와 실행 환경, 워커 프로세스, vLLM 서버, NVIDIA L4 GPU로 이어지는 요청 경로와 설정 다섯 가지를 정리한 그림
그림 1. Lambda GPU 함수의 요청 경로와 설정 다섯 가지

02

서울 리전 테스트 환경과 방법

테스트는 2026년 11월 21일 서울 리전의 한 계정에서 진행했습니다. 발표와 문서에 따르면 GPU 함수는 Lambda Managed Instances와 G 계열 인스턴스가 모두 있는 리전에서 제공되고 서울 리전에서는 g6.2xlarge와 g6f.xlarge에서 동작했습니다. 용량 공급자는 NAT 게이트웨이가 있는 기존 VPC의 프라이빗 서브넷 두 곳에 두었고 인바운드 규칙이 없는 보안 그룹을 연결했습니다.

항목값
리전과 가용 영역ap-northeast-2, 가용 영역 2개(apne2-az1, apne2-az3)
허용 인스턴스 유형vLLM 함수는 g6.2xlarge, g5.2xlarge, g4dn.2xlarge. 분할 GPU 함수는 g6f.large, g6f.xlarge
선택된 인스턴스vLLM 함수는 13회 모두 g6.2xlarge(L4 24GB), 분할 GPU 함수는 g6f.xlarge(L4의 1/8)
컨테이너 이미지vllm:cuda-v1과 vllm:cuda-v1-soci(압축 9.1GB, vLLM 0.33.0), pytorch:cuda-v1에 핸들러를 더한 이미지(압축 5.2GB)
모델Qwen/Qwen2.5-1.5B-Instruct(가중치 2.9GiB), ResNet-50
vLLM 함수 설정메모리 16,384MB, vCPU 4개(메모리 대 vCPU 4:1), /tmp 32,768MB, GPU 메모리 요청 16GB, 제한 시간 900초
호출 도구boto3 1.44.9. SDK 재시도는 비활성화
부하 조건요청당 max_tokens 256, temperature 0. 동시 N건을 같은 순간에 보내는 방식으로 3회 반복

표 1. 테스트 환경. 압축 크기는 Amazon ECR에 올라간 이미지 레이어의 합

시작 시간은 세 가지 구성으로 비교했습니다. 첫째는 모델을 Hugging Face Hub에서 내려받는 구성, 둘째는 같은 리전의 S3 버킷에서 스트리밍하는 구성, 셋째는 여기에 SOCI 지연 로딩을 더한 구성입니다. 구성마다 3회씩 테스트했고 매번 용량 공급자를 새로 만들어 이미지 캐시가 없는 새 인스턴스에서 시작하게 했습니다.

테스트 전체에서 GPU 인스턴스는 g6.2xlarge 13대와 g6f.xlarge 3대가 합계 272분 실행됐습니다. 서울 리전 가격과 수수료율로 계산한 GPU 인스턴스 비용은 약 5.34 USD입니다.

아래 코드는 셋째 구성을 만들 때 실행한 호출입니다. 이름과 계정 ID만 예시 값으로 바꿨습니다. 설치돼 있던 AWS CLI 2.38.5에는 --accelerator-config 옵션이 없어서 최신 boto3로 호출했습니다.

python
import json
import boto3

lam = boto3.client("lambda", region_name="ap-northeast-2")

# 1. 용량 공급자: 사용할 GPU 인스턴스 유형과 vCPU 상한
lam.create_capacity_provider(
    CapacityProviderName="gpu-cp",
    VpcConfig={"SubnetIds": ["subnet-aaaa", "subnet-bbbb"], "SecurityGroupIds": ["sg-aaaa"]},
    PermissionsConfig={"CapacityProviderOperatorRoleArn": "arn:aws:iam::111122223333:role/gpu-operator-role"},
    InstanceRequirements={"Architectures": ["x86_64"],
                          "AllowedInstanceTypes": ["g6.2xlarge", "g5.2xlarge", "g4dn.2xlarge"]},
    CapacityProviderScalingConfig={"ScalingMode": "Auto", "MaxVCpuCount": 16},
)

# 2. 함수: vLLM 베이스 이미지, 모델은 같은 리전의 S3에서 스트리밍
lam.create_function(
    FunctionName="gpu-vllm", PackageType="Image",
    Code={"ImageUri": "111122223333.dkr.ecr.ap-northeast-2.amazonaws.com/gpu/vllm:cuda-v1-soci"},
    Role="arn:aws:iam::111122223333:role/gpu-exec-role", Architectures=["x86_64"],
    MemorySize=16384, Timeout=900, EphemeralStorage={"Size": 32768},
    Environment={"Variables": {"MODEL_ID": "s3://amzn-s3-demo-bucket/models/Qwen2.5-1.5B-Instruct/",
                               "VLLM_LOAD_FORMAT": "runai_streamer"}},
    CapacityProviderConfig={"LambdaManagedInstancesCapacityProviderConfig": {
        "CapacityProviderArn": "arn:aws:lambda:ap-northeast-2:111122223333:capacity-provider:gpu-cp",
        "ExecutionEnvironmentMemoryGiBPerVCpu": 4.0,
        "PerExecutionEnvironmentMaxConcurrency": 4}},
    AcceleratorConfig={"AcceleratorMemorySize": 16},
)

# 3. $LATEST가 ActiveNonInvocable 상태가 된 뒤 버전을 발행하면 GPU 인스턴스가 시작됨
lam.publish_version(FunctionName="gpu-vllm", PublishTo="LATEST_PUBLISHED")

# 4. 발행한 버전이 Active가 되면 호출
resp = lam.invoke(
    FunctionName="gpu-vllm", Qualifier="$LATEST.PUBLISHED",
    Payload=json.dumps({"messages": [{"role": "user", "content": "Explain serverless GPU inference in one sentence."}],
                        "max_tokens": 128}),
)
print(json.loads(resp["Payload"].read())["choices"][0]["message"]["content"])

03

시작 시간: 발행부터 Active까지 5분 28초에서 7분 33초

버전을 발행한 시점부터 버전 상태가 Active가 될 때까지의 중앙값은 구성에 따라 328초에서 453초였습니다. 가장 빠른 구성은 S3 스트리밍에 SOCI를 더한 구성이고 가장 느린 구성은 Hugging Face에서 모델을 내려받는 구성입니다.

세 가지 구성의 발행부터 Active까지 시간을 인스턴스 시작, 이미지 준비, 초기화, 활성 전환 네 구간으로 나눈 막대 그림. Hugging Face 다운로드 453초, S3 스트리밍 364초, S3 스트리밍과 SOCI 328초
그림 2. 구성별 발행부터 Active까지의 시간과 구간별 분해. 3회 가운데 전체 시간이 중앙값인 실행 기준
구성1회2회3회중앙값용량 공급자 생성부터 Active까지
Hugging Face에서 다운로드440초463초453초453초582초(9분 42초)
S3에서 스트리밍373초341초364초364초502초(8분 22초)
S3 스트리밍과 SOCI319초328초331초328초450초(7분 30초)

표 2. 발행부터 Active까지 걸린 시간. 마지막 열은 함수 생성 단계(116초에서 139초)를 포함한 중앙값

출시 블로그는 Hugging Face 모델 ID에서 호출 가능한 엔드포인트까지 약 10분이 걸렸다고 소개합니다. 서울 리전에서 같은 구성으로 테스트한 값은 9분 42초로 이와 비슷합니다. 이 가운데 약 2분은 버전 발행 전에 create-function이 이미지를 준비하는 시간입니다.

가장 긴 구간은 이미지 준비

SOCI를 사용하지 않은 두 구성에서는 인스턴스가 시작된 뒤 함수의 첫 로그가 나오기까지 190초에서 196초가 걸렸습니다. 이 구간에는 인스턴스 부팅과 이미지를 받아서 푸는 시간이 들어 있습니다. vLLM 베이스 이미지는 레이어 30개 가운데 하나가 6.3GB여서, 이 레이어를 다 받아야 풀기를 시작합니다.

S3 스트리밍은 모델 로딩 구간을 단축

vLLM 서버가 시작된 뒤 모델 로딩이 끝날 때까지의 시간은 Hugging Face 구성이 151초, S3 스트리밍 구성이 53초였습니다. Hugging Face 구성은 NAT 게이트웨이를 거쳐 파일을 /tmp에 내려받은 뒤 읽고 S3 구성은 Run:ai Model Streamer가 가중치를 GPU 메모리로 바로 읽습니다. 전체로는 89초 차이입니다.

SOCI는 이미지 준비를 줄이고 초기화를 늘림

발표와 문서는 SOCI 지연 로딩이 실행 환경 시작 시간을 최대 70% 단축한다고 설명합니다. 테스트에서는 SOCI를 적용하자 이미지 준비 구간이 192초에서 54초로 72% 줄었습니다. 하지만 초기화 구간은 101초에서 208초로 107초 늘었습니다. SOCI는 이미지를 미리 받지 않고 함수가 파일을 처음 읽을 때 가져오기 때문입니다. vLLM이 Python 모듈을 불러오는 시간이 18초에서 80초로 늘었고 모델 로딩과 컴파일 단계도 각각 20초 이상 길어졌습니다. 그 결과 발행부터 Active까지는 364초에서 328초로 10% 줄었습니다.

세 구성 모두 Active가 된 직후의 첫 호출은 0.73초에서 0.76초, 이후 호출은 0.47초에서 0.49초에 응답했습니다. 모델 로딩이 발행 단계에서 끝나므로 첫 호출이 콜드 스타트를 겪지 않고 SOCI 구성도 첫 호출이 느려지지 않았습니다.

04

동시 처리량: 동시성 48에서 초당 2,885토큰

실행 환경 하나의 동시성을 4, 16, 48로 바꿔 가며 같은 프롬프트를 동시에 보냈습니다. 동시 요청이 1건일 때 초당 74토큰이던 처리량은 48건에서 2,885토큰으로 39배가 됐고 요청 하나의 응답 시간은 3.45초에서 4.22초로 22% 늘었습니다.

동시 요청 수 1, 4, 8, 16, 32, 48건의 초당 출력 토큰 막대 그래프와 한도를 넘은 요청이 429로 거부되는 비율, 100만 출력 토큰당 비용, 분할 GPU에서 워커마다 모델 사본을 올린 메모리 그림
그림 3. g6.2xlarge 한 대의 동시 처리량, 한도 초과 요청의 처리, 토큰당 비용, 분할 GPU의 워커별 메모리

출시 블로그는 동시 4건이 1건과 비슷한 시간에 끝난다고 설명했고 테스트에서도 1건 3.45초, 4건 3.49초로 같았습니다. vLLM 이미지는 실행 환경마다 추론 서버 하나가 모델을 보유하고 워커 프로세스는 요청을 서버에 전달하기만 합니다. 서버가 동시에 들어온 요청을 묶어서 처리하므로 동시성을 올려도 GPU 메모리 사용량은 달라지지 않았습니다.

한도를 넘은 요청은 대기 없이 429

실행 환경을 1개로 고정하고 한도보다 많은 요청을 보내면 넘는 만큼 정확히 거부됐습니다. 동시성 4에서 8건을 보내면 4건, 동시성 48에서 64건을 보내면 16건이 TooManyRequestsException(HTTP 429)을 받았습니다. 거부된 요청은 0.08초 안에 오류를 받았고 처리된 요청의 응답 시간에는 영향이 없었습니다.

사용률이 비용을 결정

Lambda GPU 함수는 호출 시간이 아니라 인스턴스가 실행 중인 시간에 과금됩니다. g6.2xlarge의 서울 리전 요금은 관리 수수료 9.75%를 포함해 시간당 1.3193 USD입니다. 부하가 끊기지 않는다고 가정하면 100만 출력 토큰당 비용은 동시 1건에서 4.95 USD, 48건에서 0.13 USD로 추정됩니다. 같은 인스턴스에서 39배 차이입니다.

GPU 사용률 지표는 처리 여력을 나타내지 않음

동시 4건 부하를 4분간 유지하는 동안 CloudWatch의 GPUUtilization은 100%였습니다. 같은 GPU가 동시 48건에서 처리량을 10배로 늘렸으므로, 이 지표가 100%라고 해서 여력이 없는 것은 아닙니다. 문서에 따르면 이 지표는 GPU가 얼마나 많이 사용됐는지가 아니라 GPU가 작업 중이던 시간의 비율입니다.

이 점은 확장 설정과 연결됩니다. Lambda는 GPU 사용률, CPU 사용률, 동시성 가운데 하나라도 목표를 넘으면 실행 환경을 늘리고 GPU 사용률의 기본 목표는 40%입니다. 테스트에서는 동시 4건 부하 직후 최대 실행 환경 수를 1에서 2로 올리자 약 25초 뒤에 두 번째 인스턴스가 시작됐습니다. 이때 GPU 사용률과 동시성이 모두 목표를 넘은 상태였습니다.

05

분할 GPU에서 확인한 워커별 모델 사본

작은 모델은 분할 GPU 인스턴스에서 실행했습니다. PyTorch 베이스 이미지에 ResNet-50을 올린 함수를 GPU 메모리 3GB로 요청하자 g6f.xlarge가 선택됐습니다. 서울 리전 요금은 수수료를 포함해 시간당 0.3205 USD이고 발행부터 Active까지는 218초였습니다.

함수 안에서 드라이버가 보고한 장치 이름은 NVIDIA L4-3Q, 전체 메모리는 2,856MB였습니다. 배치 8개를 추론하는 시간은 GPU에서 67밀리초에서 152밀리초, 같은 실행 환경의 CPU에서 800밀리초였습니다.

동시성을 지정하지 않으면 기본값 4가 적용되어 워커 프로세스 4개가 시작됩니다. PyTorch 이미지에서는 워커마다 핸들러를 불러오므로 모델도 워커마다 한 벌씩 GPU에 올라갑니다. 워커 4개가 모두 초기화된 뒤 남은 GPU 메모리는 603MB였고 배치 32개 요청을 4건 동시에 보내자 3건이 CUDA out of memory로 실패했습니다.

동시성을 2로 낮춰 다시 발행하자 남은 메모리는 1,505MB가 됐고 배치 32개 요청 2건이 모두 처리됐습니다. 재배포에는 213초가 걸렸습니다. vLLM 이미지와 달리 직접 작성한 핸들러는 동시성을 올리면 GPU 메모리 사용량이 함께 늘어납니다. 그래서 문서는 ExecutionEnvironmentGPUMemoryUsed 지표를 보면서 동시성을 조정하라고 권고합니다.

06

확장, 0으로 축소, 배포 중에 호출자가 보는 것

운영 중에는 실행 환경이 새로 시작되는 경우가 세 가지 있습니다. 부하가 늘어 확장할 때, 0으로 축소된 뒤 다시 호출될 때, 새 버전을 배포할 때입니다. 세 경우 모두 새 실행 환경이 준비되는 데 분 단위 시간이 걸리며 그동안 호출자가 받는 응답은 경우마다 달랐습니다.

확장, 0에서 복귀, 새 버전 배포, 배포 실패 네 가지 상황에서 걸린 시간과 그동안 호출자가 받은 응답을 시간순으로 나타낸 그림
그림 4. 확장, 0에서 복귀, 배포에서 걸린 시간과 호출자가 받은 응답
상황조건걸린 시간호출자가 받은 응답
확장동시성 48, 동시 64건 부하, 유휴 인스턴스 있음125초 뒤 두 번째 실행 환경이 요청 처리 시작그동안 48건은 처리, 넘는 16건은 429. 이후 64건 모두 처리
0으로 축소최소 실행 환경 0, 호출 없음설정 16분 31초 뒤 인스턴스 종료 시작호출하지 않음. 버전 상태는 Active 유지
0에서 복귀실행 환경과 인스턴스가 없는 상태에서 호출첫 호출부터 5분 15초 뒤 첫 성공5초 간격 호출 60회가 모두 429. 이후 0.72초에 응답
새 버전 배포동시성 변경 후 재발행, 유휴 GPU 있음161초1초 간격 호출 1,242회가 모두 성공
새 버전 배포동시성 변경 후 재발행, 새 인스턴스 필요366초배포 중 호출하지 않음
배포 실패MaxVCpuCount 16, 인스턴스 2대 사용 중195초 뒤 실패 처리이전 버전이 계속 응답. 오류 없음

표 3. 실행 환경이 새로 시작되는 상황별 시간과 호출자가 받은 응답

유휴 인스턴스가 있을 때의 확장 시간

동시성 48인 함수에 동시 64건 부하를 8분간 유지했습니다. 처음 125초 동안은 48건만 처리되고 넘는 요청은 429를 받았습니다. 그 뒤 두 번째 실행 환경이 요청을 받기 시작하면서 429가 사라졌고 처리량은 초당 2,949토큰에서 3,953토큰으로 늘었습니다. 이때 용량 공급자에는 이미지를 받아 둔 유휴 인스턴스가 있었습니다. 인스턴스부터 새로 시작해야 하면 앞에서 테스트한 시작 시간만큼 더 걸립니다.

0으로 축소된 함수의 복귀 시간

최소 실행 환경을 0으로 바꾸고 호출을 멈추자 16분 31초 뒤에 인스턴스 3대가 모두 종료 절차에 들어갔습니다. 마지막 호출로부터는 약 17분 뒤입니다. 그동안 버전 상태는 Active로 유지됐습니다. 종료가 시작되고 30초 뒤에 함수를 다시 호출하자 첫 호출은 429를 받았고 8초 뒤 새 인스턴스가 시작됐습니다.

발표와 문서는 0에서 복귀하는 데 일반적으로 수 분이 걸리고 그동안 호출이 429로 거부된다고 설명합니다. 테스트에서 5초 간격으로 계속 호출한 60회는 모두 429를 받았고 첫 성공은 5분 15초 뒤였습니다. 오류 메시지는 함수가 0으로 축소되어 새 실행 환경을 시작하는 중이니 지수 백오프로 재시도하라는 내용입니다. 인스턴스가 없는 상태에서 시작하므로 걸린 시간은 발행부터 Active까지의 시간과 비슷합니다.

배포는 무중단이지만 용량 공급자에 여유가 필요

동시성을 바꿔 다시 발행하는 동안 1초 간격으로 함수를 호출했습니다. 실패한 배포 세 번과 성공한 배포 한 번을 거친 20분 41초 동안 1,242회 호출이 모두 성공했고 가장 느린 응답은 0.29초였습니다. Lambda가 새 버전의 실행 환경을 먼저 시작한 뒤 이전 실행 환경을 정리하기 때문입니다.

첫 배포는 실패했습니다. 용량 공급자의 MaxVCpuCount가 16이어서 g6.2xlarge를 2대까지만 둘 수 있었는데 직전 부하로 실행 환경이 이미 2개였습니다. 새 버전을 올릴 세 번째 인스턴스를 시작할 수 없었고 배포는 195초 뒤 CapacityProviderScalingLimitExceeded로 실패했습니다. Lambda는 발행된 버전을 이전 설정으로 되돌렸고 호출은 계속 처리됐습니다.

MaxVCpuCount를 32로 올린 직후의 재발행도 같은 오류로 실패했습니다. 변경 0.2초 뒤와 77초 뒤에 발행한 두 번 모두 약 40초 만에 실패했습니다. 6분 50초 뒤의 발행은 성공했는데 이때는 유휴 GPU가 하나 있었습니다. 18분 뒤의 배포에서는 새 인스턴스가 정상적으로 추가됐습니다. 한도 변경이 언제부터 적용되는지는 이 테스트로 확정하지 못했습니다.

07

문서에 없거나 예상과 달랐던 동작

테스트 스크립트를 수정하게 만든 동작을 모았습니다. 대부분 오류 메시지만으로 원인을 알 수 있었지만 미리 알면 시간을 줄일 수 있는 항목입니다.

항목관찰한 동작대응
함수 상태함수를 만들면 $LATEST는 Active가 아닌 ActiveNonInvocable 상태로 끝남이 상태를 준비 완료로 판단하고 버전을 발행
MaxVCpuCount 최소값8과 11은 below the recommended minimum 오류, 12는 통과12 이상으로 설정
인스턴스 조회Lambda가 시작한 인스턴스는 DescribeInstances 기본 결과에 나타나지 않음IncludeManagedResources를 지정
토큰 스트리밍문서에 예제가 없음. "stream": true를 넣으면 기본 핸들러가 JSONDecodeError로 실패. InvokeWithResponseStream은 호출되지만 응답이 끝에 한 번에 도착기본 핸들러에서는 스트리밍 없이 사용
함수 URL$LATEST.PUBLISHED는 함수 URL과 별칭의 대상으로 지정할 수 없음. 한정자 없는 URL은 502를 반환번호 버전과 별칭이 필요. 이 경로는 테스트하지 않음
스케일링 설정 직후 발행PutFunctionScalingConfig 직후의 PublishVersion은 ResourceConflictException몇 초 간격으로 재시도
이미지 매니페스트매니페스트 목록으로 감싼 단일 이미지는 CreateFunction이 거부. SOCI 인덱스는 통과단일 이미지 매니페스트에 태그를 지정
GPU 메모리 요청값16GB를 요청한 vLLM 함수가 24GB GPU에서 18.7GB를 사용vLLM의 메모리 비율(기본 0.8)은 실제 GPU 크기 기준

표 4. 테스트 중 확인한 동작과 대응. 2026년 11월 21일 서울 리전, boto3 1.44.9 기준

인스턴스 조회는 비용 확인과 직접 관련됩니다. Lambda가 시작한 GPU 인스턴스는 내 계정에서 실행되고 과금되지만 기본 조회에서는 숨겨집니다. 아래처럼 조회하면 용량 공급자 ARN이 태그로 표시됩니다.

python
ec2 = boto3.client("ec2", region_name="ap-northeast-2")
resp = ec2.describe_instances(
    IncludeManagedResources=True,
    Filters=[{"Name": "operator.principal", "Values": ["scaler.lambda.amazonaws.com"]}],
)
for r in resp["Reservations"]:
    for i in r["Instances"]:
        tags = {t["Key"]: t["Value"] for t in i["Tags"]}
        print(i["InstanceId"], i["InstanceType"], i["State"]["Name"], tags["aws:lambda:capacity-provider"])

08

Lambda GPU 함수를 활용하기 좋은 예시

테스트 결과로 보면 Lambda GPU 함수에 맞는 워크로드에는 조건이 세 가지 있습니다. 첫째는 S3 업로드나 SQS 메시지 같은 이벤트로 시작되는 작업입니다. 둘째는 여러 요청을 묶어 GPU 한 장을 채울 수 있는 작업으로, 동시 요청이 많을수록 요청 하나의 비용이 내려갑니다. 셋째는 새 실행 환경이 준비되는 몇 분을 기다리거나 재시도로 넘길 수 있는 작업입니다.

아래 예시 가운데 처음 네 가지는 이번 테스트 수치를 근거로 든 것이고 나머지는 AWS 문서와 출시 블로그가 제시한 사례입니다. S3, SQS, API Gateway, EventBridge Scheduler와 연결하는 구성은 이번에 테스트하지 않았습니다.

예시구성맞는 이유근거가 된 결과
문서 요약, 분류, 추출S3 업로드, SQS 대기열, vLLM 함수결과를 한 번에 받고 대기열이 요청을 모아 동시성을 채움동시 48건에서 테스트한 처리량
이미지 분류와 검수S3 업로드 이벤트, PyTorch 함수, 분할 GPU모델이 작아 L4 GPU의 8분의 1로 충분분할 GPU의 배치 추론 시간이 같은 실행 환경의 CPU보다 짧음
애플리케이션에 내장하는 소형 모델 APIAPI Gateway, 동기 호출, 최소 실행 환경 1 이상분류, 판단, 추천처럼 결과를 한 번에 받는 호출동시 요청이 48건까지 늘어도 응답 시간 증가가 작음
정해진 시간대의 작업EventBridge Scheduler의 예약 스케일링으로 최소 실행 환경을 0과 1 사이에서 변경요청이 없는 시간에는 인스턴스를 종료0으로 축소와 복귀에 걸린 시간

표 5. 테스트 결과를 근거로 든 활용 예시. 이벤트 소스와 연결하는 구성은 문서 기준이며 테스트하지 않았습니다

문서 요약, 분류, 추출 파이프라인

S3에 올라온 문서를 SQS 대기열에 넣고 vLLM 함수가 요약, 분류, 항목 추출을 하는 구성입니다. 출시 블로그도 SQS 대기열로 문서를 일괄 처리하는 구성을 예로 듭니다. 결과를 한 번에 받으면 되므로 토큰 스트리밍이 필요 없고 대기열이 요청을 모아 주므로 동시성을 채우기 쉽습니다.

동시 48건에서 테스트한 처리량을 그대로 적용하면 g6.2xlarge 한 대가 출력 256토큰인 요청을 시간당 약 4만 건 처리합니다. 100만 건에는 약 25시간이 걸리고 비용은 요청 요금 0.20 USD를 포함해 약 33 USD로 추정됩니다. 입력이 짧은 테스트 조건에서 나온 값이므로 긴 문서를 입력으로 넣으면 처리량은 이보다 낮아집니다.

문서에 따르면 함수가 429로 거부한 메시지는 SQS 이벤트 소스 매핑이 다시 시도합니다. 재시도할 시간이 충분하도록 대기열의 가시성 제한 시간(visibility timeout)을 함수 제한 시간의 6배 이상으로 설정하라고 문서는 안내합니다.

이미지 분류와 검수

사용자가 올린 이미지를 분류하거나 검수하는 작업은 S3 업로드 이벤트로 시작되고 모델이 작습니다. 분할 GPU 테스트에서 ResNet-50은 L4 GPU의 8분의 1을 사용하는 g6f.xlarge에서 같은 실행 환경의 CPU보다 빠르게 배치를 추론했습니다. 이 인스턴스의 서울 리전 요금은 g6.2xlarge의 4분의 1 수준입니다. 직접 작성한 핸들러는 워커마다 모델 사본을 올리므로 동시성은 GPU 메모리에 맞춰 정해야 합니다.

애플리케이션에 내장하는 소형 모델 API

문의 분류, 라우팅 판단, 추천처럼 애플리케이션이 요청마다 호출하는 소형 모델도 맞는 예시입니다. 최소 실행 환경을 1 이상으로 두면 모델이 올라간 상태로 대기하므로 첫 호출도 콜드 스타트를 겪지 않습니다. 동시 처리량 테스트에서 동시 요청이 1건에서 48건으로 늘어도 요청 하나의 응답 시간은 크게 늘지 않았습니다.

대신 요청이 없는 시간에도 인스턴스 요금이 나갑니다. 실행 환경 1개를 한 달(730시간) 유지하는 비용은 g6.2xlarge 약 963 USD, g6f.xlarge 약 234 USD로 추정됩니다.

정해진 시간대의 작업

야간 배치나 업무 시간에만 사용하는 사내 도구처럼 요청이 들어오는 시간이 정해진 워크로드는 그 시간에만 GPU를 실행하면 됩니다. 문서는 EventBridge Scheduler로 최소 실행 환경 수를 정해진 시각에 바꾸는 예약 스케일링을 안내하고 0으로 축소가 맞는 예로 개발과 테스트 환경, 배치 작업, 사내 도구를 듭니다.

0으로 축소된 함수가 복귀하는 데는 앞에서 테스트한 것처럼 분 단위 시간이 걸립니다. 따라서 요청이 시작되는 시각보다 복귀 시간만큼 먼저 최소값을 올려 두어야 첫 요청이 429를 받지 않습니다. 평일 10시간씩 한 달에 220시간만 실행하면 g6.2xlarge 한 대의 비용은 약 290 USD로 추정되며 상시 실행의 30% 수준입니다.

AWS가 제시한 그 밖의 사례

아래는 문서와 출시 블로그가 제시한 사례입니다. 이번 테스트에서는 확인하지 않았습니다.

  • 맞춤형 모델 추론입니다. 음성 인식과 음성 합성, 추천, 문서 분석, 의사 결정 모델을 애플리케이션의 한 단계로 실행합니다.
  • 미디어 처리입니다. 업로드로 시작되는 영상과 이미지 트랜스코딩에 GPU의 하드웨어 인코더와 디코더를 사용합니다. Lambda Managed Instances의 함수는 비동기 호출과 이벤트 소스 매핑 호출에서 최대 90분까지 실행되므로 긴 작업도 한 번의 호출로 처리합니다.
  • 렌더링과 생성형 미디어입니다. 프레임과 미리보기를 렌더링하고 diffusion 모델로 이미지를 생성합니다.
  • 과학 계산과 금융 모델링입니다. CuPy 베이스 이미지로 행렬 계산, 시뮬레이션, 위험 분석을 실행합니다.
  • 에이전트의 추론 단계입니다. Lambda durable functions 워크플로가 GPU 함수를 한 단계로 호출합니다.

맞지 않는 경우

테스트 결과와 문서의 제한으로 보면 다음 경우에는 맞지 않습니다.

  • 토큰 스트리밍이 필요한 대화형 화면입니다. 기본 vLLM 핸들러는 스트리밍을 지원하지 않았고 직접 작성한 스트리밍 핸들러는 테스트하지 않았습니다.
  • 가끔 들어오는 요청에 바로 응답해야 하는 서비스입니다. 0으로 축소된 함수는 복귀하는 몇 분 동안 모든 호출을 429로 거부하고 최소 실행 환경을 유지하면 유휴 시간에도 요금이 나갑니다.
  • GPU 한 장에 올라가지 않는 모델입니다. 실행 환경 하나에는 GPU가 하나만 배정되고 GPU 메모리는 최대 48GB입니다.
  • 파운데이션 모델 사용과 모델 학습입니다. 문서는 파운데이션 모델에는 Amazon Bedrock을, 모델 학습과 수명 주기 관리에는 Amazon SageMaker AI를 안내합니다.

09

테스트의 한계와 다시 테스트할 항목

이 결과는 하루 동안 한 계정에서 얻은 값입니다. 다음 조건이 달라지면 수치도 달라집니다.

  • 모델은 1.5B 크기 하나입니다. 모델이 커지면 모델 로딩 구간이 길어지고 동시 처리량과 응답 시간의 관계도 달라집니다.
  • 허용 목록의 세 유형 가운데 13회 모두 g6.2xlarge가 선택됐습니다. 용량 부족으로 이전 세대로 내려가는 경우와 T4, A10G GPU의 처리량은 테스트하지 못했습니다.
  • 시작 시간은 구성마다 3회입니다. 3회의 편차는 12초에서 31초였지만 다른 날짜와 시간대의 편차는 알 수 없습니다.
  • 처리량은 같은 프롬프트에 출력 256토큰인 조건의 값입니다. 입력이 길거나 요청마다 길이가 다르면 결과가 달라집니다.
  • 번호 버전과 별칭, 함수 URL, 직접 작성한 스트리밍 핸들러, On-Demand Capacity Reservation은 테스트하지 않았습니다.
  • 비용은 서울 리전 On-Demand 가격에 수수료율을 곱한 계산값이고 청구서로 확인한 값이 아닙니다.

10

적용 기준과 설정 권고

Lambda GPU 함수가 맞는 경우는 이벤트로 시작되는 GPU 작업과 요청이 꾸준히 들어오는 소형 모델 추론입니다. 앞에서 본 예시에 해당하는 워크로드라면 아래 설정에서 시작하는 것을 권고합니다.

설정권고근거가 된 결과
모델 위치같은 리전의 S3에 두고 runai_streamer로 로딩S3 스트리밍 구성의 모델 로딩 구간이 더 짧음
SOCI적용하되 효과는 워크로드별로 테스트이미지 준비는 줄었지만 초기화가 늘어 전체 단축은 작음
동시성vLLM 이미지는 48까지 올려서 테스트. 직접 작성한 핸들러는 GPU 메모리를 보면서 조정동시 48건까지 처리량이 증가, 분할 GPU는 기본값 4에서 메모리 부족
최소 실행 환경응답 지연에 민감하면 1 이상, 개발과 배치 작업은 00에서 복귀하는 동안 모든 호출이 429
GPU 사용률 목표요청을 묶어 처리하는 워크로드는 기본 40%보다 높게 설정하고 최대 실행 환경 수를 지정동시 4건에서 지표가 이미 최대값
MaxVCpuCount운영 중인 인스턴스 수에 배포용 1대분을 더한 값으로 설정여유가 없으면 배포 실패
호출 측 재시도429에 지수 백오프로 재시도확장과 복귀 중에는 429가 분 단위로 이어짐

표 6. 테스트 결과에 근거한 설정 권고. 1.5B 모델과 g6.2xlarge 조건의 결과이므로 적용 전에 같은 방법으로 다시 테스트하는 것을 권고합니다

적용 전에 확인할 수치는 두 가지입니다. 첫째는 발행부터 Active까지의 시간으로, 확장과 0에서 복귀할 때 호출자가 기다리는 시간의 기준이 됩니다. 둘째는 목표 응답 시간 안에서 GPU 한 장이 처리하는 동시 요청 수이고 이 값이 토큰당 비용을 결정합니다. 두 수치 모두 모델 크기와 인스턴스 유형에 따라 달라지므로 운영할 모델로 직접 테스트하는 것을 권고합니다.

01

How a Lambda GPU function is built and how to understand it

I deployed the GPU functions that AWS Lambda launched on November 18, 2026 in the Seoul Region (ap-northeast-2) and tested them.

I went in with six things to check: whether it works in Seoul, the time from code to a running function, the effect of SOCI lazy loading, how concurrent requests are handled, the time to come back from zero, and token streaming. I wanted to see whether the figures in the announcement and the launch blog reproduce in Seoul, and what the documentation alone does not tell you. Two of them are the points I left open in Six AWS platforms for running vLLM and how to choose, a post I wrote from the documentation the same day: support in the Seoul Region and response streaming.

A Lambda GPU function runs on Lambda Managed Instances. With Lambda Managed Instances, a function runs on EC2 instances in your own account while Lambda launches, patches and scales the instances and routes the requests. This launch adds EC2 G-series GPU instances to it.

There are four parts. A capacity provider is the resource that says which instance types to use and up to how many vCPUs. When you publish a version of the function, Lambda launches GPU instances in the subnets of the capacity provider. On an instance, an execution environment starts with one GPU dedicated to it, and one execution environment serves several requests at the same time. The cap on how many it serves at once is set by the concurrency (PerExecutionEnvironmentMaxConcurrency).

The request path from the caller through the Lambda service to a GPU instance in a VPC in your account, the execution environment, the worker processes, the vLLM server and the NVIDIA L4 GPU, together with the five settings
Figure 1. The request path of a Lambda GPU function and the five settings

02

Test environment and method in the Seoul Region

I ran the tests on November 21, 2026 in one account in the Seoul Region. According to the announcement and the docs, GPU functions are available where both Lambda Managed Instances and G-series instances are available, and in Seoul they worked on g6.2xlarge and g6f.xlarge. The capacity providers sat in two private subnets of an existing VPC with a NAT gateway, with a security group that has no inbound rule.

ItemValue
Region and Availability Zonesap-northeast-2, two Availability Zones (apne2-az1, apne2-az3)
Allowed instance typesg6.2xlarge, g5.2xlarge and g4dn.2xlarge for the vLLM function. g6f.large and g6f.xlarge for the fractional GPU function
Instances selectedg6.2xlarge (L4, 24 GB) all 13 times for the vLLM function, g6f.xlarge (1/8 of an L4) for the fractional GPU function
Container imagesvllm:cuda-v1 and vllm:cuda-v1-soci (9.1 GB compressed, vLLM 0.33.0), and pytorch:cuda-v1 plus a handler (5.2 GB compressed)
ModelsQwen/Qwen2.5-1.5B-Instruct (2.9 GiB of weights), ResNet-50
vLLM function settings16,384 MB of memory, 4 vCPUs (memory to vCPU 4:1), 32,768 MB of /tmp, 16 GB of GPU memory requested, 900 s timeout
Clientboto3 1.44.9, with SDK retries disabled
Loadmax_tokens 256 and temperature 0 per request. N requests sent at the same instant, repeated three times

Table 1. Test environment. The compressed size is the sum of the image layers stored in Amazon ECR

I compared start-up time across three configurations. The first downloads the model from the Hugging Face Hub, the second streams it from an S3 bucket in the same Region, and the third adds SOCI lazy loading to the second. Each configuration ran three times, and each run used a new capacity provider so that it started on a new instance with no image cache.

Across all the tests, 13 g6.2xlarge and 3 g6f.xlarge instances ran for 272 minutes in total. At the Seoul price plus the fee rate, the GPU instances cost about 5.34 USD.

The code below is the set of calls I ran for the third configuration. Only the names and the account ID are replaced with example values. The installed AWS CLI 2.38.5 had no --accelerator-config option, so I made the calls with the latest boto3.

python
import json
import boto3

lam = boto3.client("lambda", region_name="ap-northeast-2")

# 1. Capacity provider: the GPU instance types to use and the vCPU limit
lam.create_capacity_provider(
    CapacityProviderName="gpu-cp",
    VpcConfig={"SubnetIds": ["subnet-aaaa", "subnet-bbbb"], "SecurityGroupIds": ["sg-aaaa"]},
    PermissionsConfig={"CapacityProviderOperatorRoleArn": "arn:aws:iam::111122223333:role/gpu-operator-role"},
    InstanceRequirements={"Architectures": ["x86_64"],
                          "AllowedInstanceTypes": ["g6.2xlarge", "g5.2xlarge", "g4dn.2xlarge"]},
    CapacityProviderScalingConfig={"ScalingMode": "Auto", "MaxVCpuCount": 16},
)

# 2. Function: the vLLM base image, the model streamed from S3 in the same Region
lam.create_function(
    FunctionName="gpu-vllm", PackageType="Image",
    Code={"ImageUri": "111122223333.dkr.ecr.ap-northeast-2.amazonaws.com/gpu/vllm:cuda-v1-soci"},
    Role="arn:aws:iam::111122223333:role/gpu-exec-role", Architectures=["x86_64"],
    MemorySize=16384, Timeout=900, EphemeralStorage={"Size": 32768},
    Environment={"Variables": {"MODEL_ID": "s3://amzn-s3-demo-bucket/models/Qwen2.5-1.5B-Instruct/",
                               "VLLM_LOAD_FORMAT": "runai_streamer"}},
    CapacityProviderConfig={"LambdaManagedInstancesCapacityProviderConfig": {
        "CapacityProviderArn": "arn:aws:lambda:ap-northeast-2:111122223333:capacity-provider:gpu-cp",
        "ExecutionEnvironmentMemoryGiBPerVCpu": 4.0,
        "PerExecutionEnvironmentMaxConcurrency": 4}},
    AcceleratorConfig={"AcceleratorMemorySize": 16},
)

# 3. Once $LATEST reaches ActiveNonInvocable, publishing a version launches the GPU instance
lam.publish_version(FunctionName="gpu-vllm", PublishTo="LATEST_PUBLISHED")

# 4. Invoke once the published version is Active
resp = lam.invoke(
    FunctionName="gpu-vllm", Qualifier="$LATEST.PUBLISHED",
    Payload=json.dumps({"messages": [{"role": "user", "content": "Explain serverless GPU inference in one sentence."}],
                        "max_tokens": 128}),
)
print(json.loads(resp["Payload"].read())["choices"][0]["message"]["content"])

03

Start-up time: 5 min 28 s to 7 min 33 s from publish to Active

The median time from publishing a version to the version state Active ranged from 328 s to 453 s by configuration. The fastest was S3 streaming with SOCI, and the slowest was the download from Hugging Face.

Bars that split the time from publish to Active into four phases, instance launch, image, initialization and activation, for the three configurations. 453 s with the Hugging Face download, 364 s with S3 streaming, 328 s with S3 streaming and SOCI
Figure 2. Time from publish to Active by configuration, split into phases. The run whose total is the median of the three
ConfigurationRun 1Run 2Run 3MedianFrom creating the capacity provider to Active
Download from Hugging Face440 s463 s453 s453 s582 s (9 min 42 s)
Stream from S3373 s341 s364 s364 s502 s (8 min 22 s)
S3 streaming and SOCI319 s328 s331 s328 s450 s (7 min 30 s)

Table 2. Time from publish to Active. The last column is the median including the function creation step (116 s to 139 s)

The launch blog says it took about 10 minutes from a Hugging Face model ID to an invocable endpoint. The same configuration tested in Seoul took 9 min 42 s, which is close. About 2 minutes of that is create-function preparing the image before the version is published.

The longest phase: the image

In the two configurations without SOCI, 190 s to 196 s passed between the instance launch and the first log line of the function. This phase holds the instance boot and the pull and unpack of the image. One of the 30 layers of the vLLM base image is 6.3 GB, and unpacking it starts only after the whole layer has arrived.

A shorter model load with S3 streaming

From the start of the vLLM server to the end of the model load, the Hugging Face configuration took 151 s and the S3 streaming configuration took 53 s. The Hugging Face configuration downloads the files to /tmp through the NAT gateway and then reads them, while in the S3 configuration the Run:ai Model Streamer reads the weights straight into GPU memory. The difference in the total is 89 s.

SOCI shortens the image phase and lengthens initialization

The announcement and the docs say SOCI lazy loading cuts execution environment start-up time by up to 70%. In the test, the image phase fell 72% with SOCI, from 192 s to 54 s. But initialization grew by 107 s, from 101 s to 208 s. SOCI does not pull the image up front. It fetches a file when the function reads it for the first time. The time vLLM spends importing Python modules grew from 18 s to 80 s, and the model load and the compile steps each took over 20 s longer. As a result, publish to Active fell from 364 s to 328 s, a 10% reduction.

In all three configurations the first call right after Active answered in 0.73 s to 0.76 s, and later calls in 0.47 s to 0.49 s. The model load finishes during the publish, so the first call sees no cold start, and the first call was no slower with SOCI.

04

Concurrent throughput: 2,885 tokens per second at a concurrency of 48

I set the concurrency of one execution environment to 4, 16 and 48 and sent the same prompt in parallel. Throughput went from 74 tokens per second at 1 concurrent request to 2,885 at 48, a factor of 39, while the response time of one request grew 22%, from 3.45 s to 4.22 s.

A bar chart of output tokens per second at 1, 4, 8, 16, 32 and 48 concurrent requests, the share of requests over the limit rejected with 429, the cost per million output tokens, and the GPU memory taken by one model copy per worker on a fractional GPU
Figure 3. Concurrent throughput of one g6.2xlarge, requests over the limit, cost per token, and memory per worker on a fractional GPU

The launch blog says four concurrent requests finish in about the time of one, and the test agreed: 3.45 s for 1 and 3.49 s for 4. In the vLLM image, one inference server per execution environment holds the model, and the worker processes only forward requests to it. The server batches the requests that arrive together, so GPU memory use did not change as the concurrency went up.

429 with no wait for requests over the limit

With the function fixed at one execution environment, sending more requests than the limit rejected exactly the excess. Sending 8 at a concurrency of 4 rejected 4, and sending 64 at a concurrency of 48 rejected 16, each with TooManyRequestsException (HTTP 429). A rejected request got its error within 0.08 s, and the response time of the served requests did not change.

Cost set by utilization

A Lambda GPU function is billed for the time the instance runs, not for invocation time. A g6.2xlarge in the Seoul Region costs 1.3193 USD per hour including the 9.75% management fee. Assuming a load that never stops, the estimated cost per million output tokens is 4.95 USD at 1 concurrent request and 0.13 USD at 48. That is a factor of 39 on the same instance.

The GPU utilization metric, not a sign of headroom

While I held a load of 4 concurrent requests for four minutes, GPUUtilization in CloudWatch read 100%. The same GPU delivered 10 times the throughput at 48 concurrent requests, so 100% on this metric does not mean there is no headroom. According to the documentation, the metric is the share of time the GPU was busy, not how much of the GPU was in use.

This ties into the scaling settings. Lambda adds execution environments when any one of GPU utilization, CPU utilization or concurrency exceeds its target, and the default target for GPU utilization is 40%. In the test, right after the load of 4 concurrent requests, I raised the maximum number of execution environments from 1 to 2, and a second instance launched about 25 s later. At that moment both GPU utilization and concurrency were over their targets.

05

One model copy per worker, seen on a fractional GPU

I ran a small model on a fractional GPU instance. A function with ResNet-50 on the PyTorch base image, requesting 3 GB of GPU memory, was placed on a g6f.xlarge. The Seoul price is 0.3205 USD per hour including the fee, and publish to Active took 218 s.

Inside the function the driver reported the device as NVIDIA L4-3Q with 2,856 MB in total. Inference on a batch of 8 took 67 ms to 152 ms on the GPU and 800 ms on the CPU of the same execution environment.

With no concurrency set, the default of 4 applies and four worker processes start. On the PyTorch image every worker imports the handler, so every worker puts its own copy of the model on the GPU. After all four workers had initialized, 603 MB of GPU memory was left, and when I sent 4 requests with a batch of 32 at the same time, 3 failed with CUDA out of memory.

After I lowered the concurrency to 2 and published again, 1,505 MB was left and both of 2 requests with a batch of 32 were served. The redeployment took 213 s. Unlike the vLLM image, a handler you write yourself uses more GPU memory as the concurrency goes up. That is why the documentation recommends tuning the concurrency while watching the ExecutionEnvironmentGPUMemoryUsed metric.

06

What a caller sees during scale-out, scale to zero and deployment

In operation, a new execution environment starts in three cases: when load grows and the function scales out, when it is invoked again after scaling to zero, and when a new version is deployed. In all three the new execution environment takes minutes to get ready, and what the caller gets in the meantime differed from case to case.

Timelines for four situations, scale-out, coming back from zero, deploying a new version and a failed deployment, showing how long each took and what the caller received in the meantime
Figure 4. Time taken by scale-out, coming back from zero and deployment, and what the caller received
SituationConditionTime takenWhat the caller received
Scale-outConcurrency 48, load of 64 concurrent requests, an idle instance presentA second execution environment took requests after 125 sUntil then 48 served and the 16 over the limit got 429. After that all 64 served
Scale to zeroMinimum execution environments 0, no callsInstances began shutting down 16 min 31 s after the settingNo calls made. The version state stayed Active
Back from zeroInvoked with no execution environment and no instanceFirst success 5 min 15 s after the first callAll 60 calls at 5-second intervals got 429. After that it answered in 0.72 s
Deploying a new versionRepublish after a concurrency change, an idle GPU present161 sAll 1,242 calls at one per second succeeded
Deploying a new versionRepublish after a concurrency change, a new instance needed366 sNo calls made during the deployment
Failed deploymentMaxVCpuCount 16, two instances in useMarked failed after 195 sThe previous version kept answering. No errors

Table 3. Time taken and what the caller received in each situation where a new execution environment starts

Scale-out time with an idle instance present

I held a load of 64 concurrent requests for eight minutes on a function with a concurrency of 48. For the first 125 s only 48 were served and the requests over the limit got 429. Then a second execution environment began taking requests, the 429s stopped, and throughput went from 2,949 to 3,953 tokens per second. The capacity provider had an idle instance with the image already pulled at that time. If an instance has to launch first, add the start-up time measured above.

How long a function scaled to zero takes to come back

After I set the minimum number of execution environments to 0 and stopped calling, all three instances began shutting down 16 min 31 s later. That is about 17 minutes after the last call. The version state stayed Active throughout. When I invoked the function again 30 s after the shutdown began, the first call got 429, and a new instance launched 8 s later.

The announcement and the docs say coming back from zero typically takes a few minutes, with calls rejected with 429 in the meantime. In the test, all 60 calls I kept sending at 5-second intervals got 429, and the first success came after 5 min 15 s. The error message says the function scaled down to zero, a new execution environment is starting, and the caller should retry with exponential backoff. The function starts with no instance, so the time is close to the time from publish to Active.

Deployment without downtime, with headroom needed on the capacity provider

I invoked the function once per second while changing the concurrency and publishing again. Over 20 min 41 s that covered three failed deployments and one successful one, all 1,242 calls succeeded and the slowest took 0.29 s. Lambda starts the execution environments of the new version first and removes the old ones afterwards.

The first deployment failed. The capacity provider had a MaxVCpuCount of 16, room for two g6.2xlarge instances, and the load just before had already brought the function to two execution environments. There was no room to launch a third instance for the new version, and the deployment failed after 195 s with CapacityProviderScalingLimitExceeded. Lambda rolled the published version back to the previous settings and calls kept being served.

Publishing again right after raising MaxVCpuCount to 32 failed with the same error. Two publishes, 0.2 s and 77 s after the change, each failed in about 40 s. A publish 6 min 50 s after the change succeeded, but an idle GPU was available at that point. A deployment 18 minutes after the change added a new instance as expected. This test did not pin down when the new limit takes effect.

07

Behavior that is not in the docs or was not what I expected

These are the behaviors that made me change the test scripts. In most cases the error message was enough to find the cause, but knowing them in advance saves time.

ItemWhat I observedWhat to do
Function stateAfter you create the function, $LATEST ends in ActiveNonInvocable, not ActiveTreat this state as ready and publish a version
Minimum MaxVCpuCount8 and 11 return below the recommended minimum, 12 passesSet 12 or more
Listing instancesInstances launched by Lambda do not appear in the default result of DescribeInstancesPass IncludeManagedResources
Token streamingThe docs have no example. With "stream": true the default handler fails with JSONDecodeError. InvokeWithResponseStream is accepted, but the response arrives in one piece at the endUse the default handler without streaming
Function URL$LATEST.PUBLISHED cannot be the target of a function URL or an alias. A URL with no qualifier returns 502A numbered version and an alias are needed. I did not test that path
Publishing right after a scaling changePublishVersion right after PutFunctionScalingConfig returns ResourceConflictExceptionRetry every few seconds
Image manifestCreateFunction rejects a single image wrapped in a manifest list. A SOCI index passesTag the single image manifest
GPU memory requestA vLLM function that requested 16 GB used 18.7 GB on a 24 GB GPUThe memory fraction of vLLM (0.8 by default) applies to the actual GPU size

Table 4. Behavior found during the tests and what to do about it. Seoul Region, November 21, 2026, boto3 1.44.9

Listing instances matters for checking cost. The GPU instances Lambda launches run and are billed in your account, but the default listing hides them. Listed as below, each one carries the capacity provider ARN as a tag.

python
ec2 = boto3.client("ec2", region_name="ap-northeast-2")
resp = ec2.describe_instances(
    IncludeManagedResources=True,
    Filters=[{"Name": "operator.principal", "Values": ["scaler.lambda.amazonaws.com"]}],
)
for r in resp["Reservations"]:
    for i in r["Instances"]:
        tags = {t["Key"]: t["Value"] for t in i["Tags"]}
        print(i["InstanceId"], i["InstanceType"], i["State"]["Name"], tags["aws:lambda:capacity-provider"])

08

Examples where a Lambda GPU function fits well

Going by the test results, a workload that fits Lambda GPU functions meets three conditions. First, it starts from an event such as an S3 upload or an SQS message. Second, its requests can be batched to fill one GPU, and the more requests run together, the lower the cost of each. Third, it can wait out, or retry through, the minutes a new execution environment needs.

Of the examples below, the first four are backed by figures from these tests, and the rest are use cases named in the AWS documentation and the launch blog. I did not test the wiring to S3, SQS, API Gateway or EventBridge Scheduler.

ExampleSetupWhy it fitsResult behind it
Document summarization, classification, extractionS3 upload, SQS queue, vLLM functionThe result is taken in one piece, and the queue gathers requests to fill the concurrencyThroughput tested at 48 concurrent requests
Image classification and moderationS3 upload event, PyTorch function, fractional GPUThe model is small, so one eighth of an L4 GPU is enoughBatch inference on the fractional GPU took less time than on the CPU of the same execution environment
A small-model API inside an applicationAPI Gateway, synchronous calls, 1 or more minimum execution environmentsCalls that take the result in one piece, such as classification, decisions and recommendationsResponse time grew little up to 48 concurrent requests
Work at set hoursScheduled scaling with EventBridge Scheduler, moving the minimum execution environments between 0 and 1Instances are terminated during the hours with no requestsTime taken to scale to zero and to come back

Table 5. Use cases backed by the test results. The wiring to event sources follows the documentation and was not tested

A pipeline for document summarization, classification and extraction

Documents uploaded to S3 go into an SQS queue, and a vLLM function summarizes them, classifies them or extracts fields. The launch blog also gives batch processing of documents from an SQS queue as an example. The result is taken in one piece, so token streaming is not needed, and the queue gathers the requests, so the concurrency is easy to fill.

Applying the throughput tested at 48 concurrent requests as is, one g6.2xlarge serves about 40,000 requests of 256 output tokens per hour. One million requests take about 25 hours and cost an estimated 33 USD, including 0.20 USD in request charges. The figure comes from a test with short inputs, so long documents as input will lower the throughput.

According to the documentation, the SQS event source mapping retries a message the function rejected with 429. The documentation tells you to set the visibility timeout of the queue to at least six times the function timeout so that there is enough time to retry.

Image classification and moderation

Classifying or moderating images that users upload starts from an S3 upload event and uses a small model. In the fractional GPU test, ResNet-50 ran its batches faster on a g6f.xlarge, which uses one eighth of an L4 GPU, than on the CPU of the same execution environment. In the Seoul Region this instance costs about a quarter of a g6.2xlarge. A handler you write yourself puts a copy of the model on the GPU for every worker, so set the concurrency to fit the GPU memory.

A small-model API inside an application

A small model that an application calls on every request, for classifying inquiries, routing decisions or recommendations, is another good fit. With the minimum number of execution environments at 1 or more, the model stays loaded, so even the first call sees no cold start. In the concurrent throughput test, the response time of one request grew little as concurrent requests went from 1 to 48.

The price is that the instance is billed even when no requests arrive. Keeping one execution environment for a month (730 hours) costs an estimated 963 USD on a g6.2xlarge and 234 USD on a g6f.xlarge.

Work at set hours

A workload whose requests arrive at known hours, such as a nightly batch or an internal tool used only in office hours, needs the GPU only during those hours. The documentation describes scheduled scaling, which changes the minimum number of execution environments at set times with EventBridge Scheduler, and names development and test environments, batch jobs and internal tools as examples that suit scaling to zero.

As tested above, a function scaled to zero takes minutes to come back. So the minimum has to be raised ahead of the first request by at least the time it takes to come back, or the first request gets 429. Running only 220 hours a month, 10 hours on weekdays, one g6.2xlarge costs an estimated 290 USD, about 30% of running all the time.

Other use cases AWS lists

These are use cases named in the documentation and the launch blog. I did not check them in these tests.

  • Custom model inference. Speech-to-text and text-to-speech, recommendation, document analysis and decision models run as one step of an application.
  • Media processing. Video and image transcoding that starts on upload uses the hardware encoders and decoders of the GPU. A function on Lambda Managed Instances runs for up to 90 minutes on asynchronous and event source mapping invocations, so a long job finishes in a single invocation.
  • Rendering and generative media. Frames and previews are rendered, and images are generated with diffusion models.
  • Scientific computing and financial modeling. Matrix computation, simulations and risk analysis run on the CuPy base image.
  • The inference step of an agent. A Lambda durable functions workflow calls the GPU function as one of its steps.

Where it does not fit

Going by the test results and the documented limits, these cases do not fit.

  • An interactive screen that needs token streaming. The default vLLM handler did not stream, and I did not test a streaming handler of my own.
  • A service that has to answer occasional requests immediately. A function scaled to zero rejects every call with 429 for the minutes it takes to come back, and keeping a minimum execution environment is billed during idle hours too.
  • A model that does not fit on one GPU. An execution environment gets exactly one GPU, and GPU memory goes up to 48 GB.
  • Using foundation models and training models. The documentation points to Amazon Bedrock for foundation models and to Amazon SageMaker AI for training and managing the model lifecycle.

09

Limits of the tests and what to test again

These results come from one account on one day. The figures change when the following conditions change.

  • There is one model, of 1.5B size. A larger model lengthens the model load, and the relation between concurrent throughput and response time changes too.
  • Of the three allowed types, g6.2xlarge was selected all 13 times. I could not test a fallback to an older generation for lack of capacity, or the throughput of the T4 and A10G GPUs.
  • Start-up time has three runs per configuration. The spread of the three runs was 12 s to 31 s, but the spread on other days and at other times is unknown.
  • Throughput is for the same prompt with 256 output tokens. Longer inputs or requests of mixed length give different results.
  • I did not test numbered versions and aliases, function URLs, a streaming handler of my own, or On-Demand Capacity Reservations.
  • Costs are calculated from the Seoul On-Demand price and the fee rate, not checked against a bill.

10

When to use it and which settings to choose

Lambda GPU functions fit GPU work that starts from an event and small-model inference with steady requests. If your workload matches the examples above, I recommend starting from the settings below.

SettingRecommendationResult behind it
Model locationKeep it in S3 in the same Region and load it with runai_streamerThe model load was shorter with S3 streaming
SOCIApply it, but test the effect for each workloadThe image phase shrank, but initialization grew, so the total gain was small
ConcurrencyTest the vLLM image up to 48. Tune a handler of your own while watching GPU memoryThroughput kept growing up to 48 concurrent requests, out of memory at the default of 4 on the fractional GPU
Minimum execution environments1 or more if response delay matters, 0 for development and batch workEvery call got 429 while the function came back from zero
GPU utilization targetFor a workload that batches requests, set it above the default 40% and set a maximum number of execution environmentsThe metric was already at its maximum at 4 concurrent requests
MaxVCpuCountSet it to the instances in service plus one more for deploymentsDeployment fails with no headroom
Retries on the callerRetry 429 with exponential backoff429 continues for minutes during scale-out and resume

Table 6. Setting recommendations based on the test results. They come from a 1.5B model on g6.2xlarge, so I recommend testing again the same way before applying them

There are two figures to check before applying this. The first is the time from publish to Active, which is the baseline for how long a caller waits during scale-out and when coming back from zero. The second is the number of concurrent requests one GPU serves within your target response time, and that number sets the cost per token. Both change with model size and instance type, so I recommend testing them directly with the model you will run.

참고 자료References

No.출처Source종류Kind확인한 날Checked
1AWS Lambda adds support for GPU instances on Lambda Managed InstancesWhat's NewWhat's New2026-11-21
2AWS Lambda now supports GPU instances for Event Functions on Lambda Managed InstancesAWS 블로그AWS blog2026-11-21
3Run GPU-accelerated Event Functions on Lambda Managed Instances공식 문서AWS docs2026-11-21
4Getting started with GPU-accelerated Event Functions공식 문서AWS docs2026-11-21
5Understanding scaling and concurrency for GPU-accelerated Event Functions공식 문서AWS docs2026-11-21
6Optimizing startup time for GPU-accelerated functions공식 문서AWS docs2026-11-21
7GPU base images for Lambda Managed Instances공식 문서AWS docs2026-11-21
8Run inference workloads on GPU-accelerated functions공식 문서AWS docs2026-11-21
9Monitoring GPU-accelerated Event Functions공식 문서AWS docs2026-11-21
10Best practices for GPU-accelerated functions on Lambda Managed Instances공식 문서AWS docs2026-11-21
11Troubleshooting GPU-accelerated functions on Lambda Managed Instances공식 문서AWS docs2026-11-21
12Lazy-load container images with Seekable OCI (SOCI)공식 문서AWS docs2026-11-21
13Scaling Lambda Managed Instances공식 문서AWS docs2026-11-21
14Best practices for Lambda Managed Instances공식 문서AWS docs2026-11-21
15Handling errors for an SQS event source in Lambda공식 문서AWS docs2026-11-21
16AWS Lambda pricing요금 페이지Pricing page2026-11-21