AWS Builder Center
Testing read and write performance with S3 Files from AWS Lambda

Testing read and write performance with S3 Files from AWS Lambda

I compared read and write performance between the S3 SDK and S3 Files when accessing Amazon S3 from AWS Lambda.

Is S3 Files faster than the S3 SDK when reading files from AWS Lambda?

In April 2026, AWS Lambda added support for mounting Amazon S3 Files. With S3 Files, objects in an Amazon S3 bucket can be handled as files from a local mount path inside a Lambda function.
Until now, the common approach was to use an AWS SDK to get and put S3 objects. Another option was to mount Amazon EFS when a file system interface was required.
In this article, I compare how much performance difference appears when Lambda reads and writes files through two approaches:
  • Non-VPC Lambda + S3 SDK
  • Lambda + S3 Files
Note: This article summarizes one benchmark design and its results. Actual results can vary depending on the environment, Region, Lambda memory size, file size, concurrency, VPC configuration, and access patterns.

What is S3 Files?

Amazon S3 Files  lets you access data in an S3 bucket as a file system. S3 is usually used as object storage, so the important point is that S3 Files gives you a file system interface while keeping S3 as the underlying storage.
According to the documentation, S3 Files "intelligently translates" file system operations into efficient S3 requests on behalf of the user.
For files smaller than a certain size, 128 KiB by default, S3 Files can import them into high-performance storage. This can improve read latency. On the other hand, when files are not stored in high-performance storage, or when a read is 1 MiB or larger, S3 Files reads directly from the S3 bucket.

What I tested

I compared two configurations.
ConfigurationDescriptionPurpose
ANon-VPC Lambda + S3 SDKBaseline for the simplest S3 access pattern
BLambda + S3 FilesNewer pattern where S3 is mounted as a file system
I looked at three main questions:
  • Small file reads: Does S3 Files low-latency access help?
  • Large file reads: How does it compare with the S3 SDK for reads of 1 MiB or larger?
  • Writes: How different are file writes and S3 PutObject calls?
The S3 Files configuration includes a VPC and mount targets. This means the comparison is not only "S3 API versus file I/O"; it also includes architectural differences between the two setups.
I used a 64 KiB file as the small file and a 16 MiB file as the large file. For each pattern, I measured single reads and single writes. I looked at min, avg, p50, p90, p99, and max, instead of relying only on averages.

Configurations

A. Non-VPC Lambda + S3 SDK

This is a normal Lambda function that is not connected to a VPC. It accesses S3 by using the AWS SDK.
If your function only needs to read and write S3 objects, this is the simplest baseline.

B. Lambda + S3 Files

This Lambda function mounts S3 Files and reads or writes files under a path such as /mnt/s3files.
When using S3 Files with Lambda, the Lambda function must be placed in the same VPC as the mount target. A mount target is also required for each subnet where the function runs.
The Lambda documentation says that direct reads from S3 for S3 Files are supported only for functions configured with 512 MB or more of memory:
Amazon S3 Files optimizes throughput by reading directly from Amazon S3. Direct reads from Amazon S3 are supported only for functions configured with 512 MB or more of memory.
For this benchmark, I configured both functions with 512 MB of memory.
Note: After running this test, I realized that a third pattern, VPC Lambda + S3 SDK, would also be useful to measure. This article compares only the two configurations above.

Benchmark environment

ItemValue
Regionap-northeast-1
Lambda runtimePython 3.14
Lambda architecturearm64
Lambda memory512 MB
S3 storage classS3 Standard
Small file size64 KiB
Large file size16 MiB
Metricsmin / avg / p50 / p90 / p99 / max

Measurement method

Inside each Lambda function, I measured the elapsed time immediately before and after the file operation or S3 API call.
The total Lambda Duration includes initialization, logging, and other overhead, so the main comparison in this article focuses on the read and write operation itself.
Each pattern used the following settings:
TestIterations
Single read100 measured samples
Single write100 measured samples
The functions were invoked with iterations=105 and warmup=5. The first five iterations were excluded from aggregation. These warmup iterations are not meant to remove Lambda cold start time. They are only used to remove the first few fluctuations inside the read or write loop.
For p99, more samples would be ideal. I used 100 measured samples here to balance cost and effort while still seeing the overall trend.

Test patterns

Reads

IDDescriptionSizeFilesMeasured samples
R1Single small-file read64 KiB1100
R2Single large-file read16 MiB1100
S3 Files can behave differently on the first access and repeated accesses, so I also tested a "unique file per iteration" read pattern.

Writes

IDDescriptionSizeFilesMeasured samples
W1Single small-file write64 KiB1100
W2Single large-file write16 MiB1100
For writes, keep in mind that S3 Files separates the write to the mounted file system from the background export to the S3 bucket.

S3 Files setup

I followed the prerequisites in the S3 Files documentation for mounting S3 Files on Lambda:

Create a VPC

I created a VPC with one private subnet.

Create an S3 bucket

Before creating the file system, I created the S3 bucket that would be linked to S3 Files.

Create the S3 file system

Next, I created the S3 file system.
When I selected the bucket, the console indicated that bucket versioning was required, so I enabled versioning.
Then I selected the VPC and created the file system.

Mount target

When I tried to create a mount target, it had already been created automatically.

Access point

An access point was also created automatically. In my setup, the root directory path was /lambda.

Security groups

I configured security groups for the mount target and the VPC Lambda function.
  • The mount target security group allowed inbound NFS traffic on port 2049.
  • The Lambda security group allowed outbound NFS traffic on port 2049.

Results

I aggregated 100 log records per pattern with CloudWatch Logs Insights.

R1. Single 64 KiB read

Configurationminavgp50p90p99maxNotes
Non-VPC Lambda + S3 SDK21.2 ms25.4 ms24.8 ms27.7 ms40.0 ms57.0 msS3 GetObject
Lambda + S3 Files1.8 ms2.0 ms2.0 ms2.2 ms2.4 ms2.5 msopen().read() from /mnt/s3files
For 64 KiB reads, S3 Files was much faster. At p50, it was about 12 times faster. At p99, it was about 16 times faster.
Because S3 Files can import small files into high-performance storage, that low-latency path seems to be very effective for this repeated-read condition.

R1 add-on. Reading a different 64 KiB file every iteration

Repeatedly reading the same file may benefit from caching. To separate that effect, I also tested reading a different file in every iteration.
Configurationminavgp50p90p99maxNotes
Non-VPC Lambda + S3 SDK34.9 ms55.4 ms53.8 ms68.2 ms104.6 ms112.3 msDifferent S3 object per iteration
Lambda + S3 Files2.2 ms2.4 ms2.4 ms2.5 ms2.7 ms2.7 msDifferent file per iteration
Even when reading different 64 KiB files, S3 Files was still much faster. At p50, it was about 23 times faster. At p99, it was about 39 times faster.
This suggests that S3 Files is a good fit for workloads that read many small files.

R2. Single 16 MiB read

Configurationminavgp50p90p99maxNotes
Non-VPC Lambda + S3 SDK171.2 ms204.9 ms172.5 ms281.5 ms300.4 ms303.0 msS3 GetObject
Lambda + S3 Files4.3 ms10.5 ms14.8 ms15.8 ms19.9 ms19.9 msopen().read() from /mnt/s3files
For repeated reads of the same 16 MiB file, S3 Files was also much faster. At p50, it was about 12 times faster. At p99, it was about 15 times faster.
However, this condition repeatedly reads the same file inside the same Lambda invocation. It is very likely that caching in S3 Files or the execution environment strongly affected this result. So I also tested reading a different large file every iteration.

R2 add-on. Reading a different 16 MiB file every iteration

This additional test used the same iterations=105 and warmup=5 settings.
Configurationminavgp50p90p99maxNotes
Non-VPC Lambda + S3 SDK171.3 ms206.5 ms179.7 ms270.2 ms284.3 ms292.1 msDifferent S3 object per iteration
Lambda + S3 Files1,751.5 ms2,331.2 ms1,776.2 ms5,269.6 ms5,290.7 ms5,299.1 msDifferent file per iteration
Under this condition, the S3 SDK was much faster.
This makes the earlier "S3 Files is very fast when repeatedly reading the same large file" result look like a cache-friendly case. When reading different large files each time, the S3 SDK may be more stable and easier to reason about.

W1. Single 64 KiB write

Configurationminavgp50p90p99maxNotes
Non-VPC Lambda + S3 SDK31.4 ms38.2 ms37.5 ms41.9 ms52.9 ms76.9 msS3 PutObject
Lambda + S3 Files12.4 ms13.4 ms13.4 ms14.1 ms15.3 ms17.1 mswrite() + flush() + fsync()
For 64 KiB writes, S3 Files was faster and had less variance.
However, this does not mean that S3 Files always persists data to S3 faster than PutObject.
The S3 SDK measurement includes sending a PutObject request to S3 and waiting for the response. The S3 Files measurement waits until the write is completed from the Lambda function's view of the mounted file system. S3 Files exports file changes to the S3 bucket after writes stop, with a delay before export. Therefore, these two completion points are not exactly the same.
For small writes, fixed overhead such as API calls and HTTP communication can be a larger part of the total time, so S3 Files can appear much faster in this measurement.

W2. Single 16 MiB write

Configurationminavgp50p90p99maxNotes
Non-VPC Lambda + S3 SDK168.8 ms196.8 ms187.0 ms246.9 ms274.4 ms302.5 msS3 PutObject
Lambda + S3 Files147.5 ms198.1 ms190.1 ms240.6 ms286.3 ms298.4 mswrite() + flush() + fsync()
For 16 MiB writes, the S3 SDK and S3 Files were very close. The advantage seen with small writes did not appear as clearly for large writes.

Summary of results

TestConditionFaster configurationMore stable p99Comment
64 KiB readSame file repeatedlyLambda + S3 FilesLambda + S3 FilesS3 Files low-latency access was very effective
64 KiB readDifferent file each iterationLambda + S3 FilesLambda + S3 FilesS3 Files was still fast for many small files
16 MiB readSame file repeatedlyLambda + S3 FilesLambda + S3 FilesLikely a cache-friendly condition
16 MiB readDifferent file each iterationNon-VPC Lambda + S3 SDKNon-VPC Lambda + S3 SDKS3 SDK was faster and more stable
64 KiB writeSingle writeLambda + S3 FilesLambda + S3 FilesS3 Files looked faster for small writes, but completion semantics differ
16 MiB writeSingle writeAlmost equalNon-VPC Lambda + S3 SDKp50 and avg were similar; S3 SDK had slightly better p99
From these results, S3 Files looks strong for small-file reads and repeated reads of the same file. On the other hand, for reading different large files, the S3 SDK was faster and more predictable in this test.

How I would choose

I would not choose only by raw speed. I would choose based on the workload.
Use caseCandidate
Simply reading and writing S3 objectsS3 SDK
Using a library that expects file pathsS3 Files
Keeping S3 as the source of truth while using file system semanticsS3 Files
Sharing a workspace across multiple Lambda functionsS3 Files or Amazon EFS
If the workload is just basic object reads and writes, the S3 SDK is still very strong. It is also simpler because it does not require a VPC or mount targets.
S3 Files is valuable because it lets you treat S3 data as files. That can be useful when moving existing file-based processing to Lambda, or when you want a shared working directory for workflows such as AI agents that create, update, and pass files between multiple steps.

Conclusion

This benchmark compared S3 SDK and S3 Files for single reads and writes of small and large files from Lambda.
S3 Files gives Lambda a new option: handling S3-backed data through a file system interface. But I would not think of it as a simple drop-in replacement for the S3 SDK.
Instead, S3 Files is best understood as an option for getting file system usability while keeping S3 as the backing store.

References

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article