Performance
Performance Considerations
The following factors may affect S3 Protector performance:
Number of protected columns in a file: Affects the number of requests to Cloud API. The more protected columns, the longer it will take to process the file. Review Performance section in Cloud API on AWS documentation on how to monitor and configure Cloud API for best performance.
Maximum batch size:
MAX_BATCH_SIZEdetermines the maximum number of rows to process in a single Cloud API invocation. This value is applied to all columns. The higher the batch size, the higher the Cloud API throughput. This value controls the size of a single request to Cloud API. The request size is limited by AWS Lambda infrastructure to 6 MB. Review AWS Lambda quotas and limitations for latest information.Maximum parallel protect calls:
MAX_PARALLEL_PROTECT_CALLScontrols how many protect requests can be sent at the same time across the file being processed. The default is1000. Lower values can reduce pressure on Cloud API; higher values can improve throughput if Cloud API has enough capacity.File streaming read size:
FILE_CHUNK_SIZEcontrols how many rows S3 Protector reads into memory at a time from source file. Lower values reduce peak memory usage. Higher values may improve throughput. This does not apply to JSON arrays. Applies to all other file types including JSON lines.Large-file threshold:
LARGE_FILE_DISPATCH_THRESHOLD_BYTESFiles larger than this threshold are processed in parallel by multiple S3 Protector instances. Does not apply to XLS files.Large-file chunk size:
LARGE_FILE_CHUNK_SIZE_BYTEScontrols the target size of each chunk when large files are processed in parallel. For JSON array files, each chunk must fit into a single Lambda’s memory; this constraint does not apply to JSON lines files.Function timeout: Default S3 Protector execution time is set to 15 minutes, the maximum value imposed by AWS Lambda infrastructure. If S3 Protector runs out of time when processing a file, ensure
LARGE_FILE_DISPATCH_THRESHOLD_BYTESis smaller than the files size andLARGE_FILE_CHUNK_SIZE_BYTESis small enough to fit file processing into 15 minute timeout.Cloud API performance: S3 Protector uses Cloud API to apply protect operations to data in the file. Performance of Cloud API directly affects the performance of S3 Protector. Review Performance section in Cloud API on AWS documentation.
Benchmarks
Single S3 Protector Instance Per File
The following table shows throughput and latency for three different files when large file processing is not enabled. Each file has 21 columns, 6 of which were protected by S3 Protector with tokenization data elements. The remaining 15 columns were configured to pass through without applying protection.
Two of the default S3 Protector settings were updated for this benchmark:
- Default function timeout was increased to its maximum of 15 minutes
- ‘MaxBatchSize’ was increased from default ‘25000’ to ‘50000’ (via CloudFormation template)
Performance Results
| Rows x Columns | Protected Columns | Number of Protect Operations | File Size (MB) | Total Duration (s) | Throughput (MB/s) | Throughput (Operations/s) |
|---|---|---|---|---|---|---|
| 100k x 21 | 6 | 600,000 | 22 | 5 | 4.34 | 118k/s |
| 1m x 21 | 6 | 6,000,000 | 220 | 50 | 4.36 | 119k/s |
| 10m x 21 | 6 | 60,000,000 | 2,200 | 510 | 4.31 | 118k/s |
Multiple S3 Protector Instances Per File
The following results show wall-clock duration and throughput when large-file dispatch is enabled and each file is split across multiple parallel S3 Protector instances.
Test configuration:
- Lambda memory: 1700 MB
LARGE_FILE_CHUNK_SIZE_BYTES: 109 MB per chunkFILE_CHUNK_SIZE: 150,000 rowsMAX_BATCH_SIZE: 75,000- Each file has 31 columns; 9 protected with tokenization data elements
Performance Results
| Format | File Size | Parallel Chunks | Total Duration | Throughput (MB/s) |
|---|---|---|---|---|
| CSV | 5 GB | 46 | 1m 7s | ~77 |
| Parquet | 5 GB | 28 | 1m 43s | ~50 |
| JSON array | 5 GB | 46 | 59s | ~86 |
| JSON lines | 5 GB | 46 | 52s | ~99 |
| CSV | 20 GB | 186 | 1m 52s | ~183 |
| Parquet | 20 GB | 294 | 1m 51s | ~185 |
| JSON array | 20 GB | 189 | 2m 9s | ~159 |
| JSON lines | 20 GB | 183 | 1m 32s | ~223 |
| CSV | 100 GB | 930 | 6m 36s | ~259 |
| Parquet | 100 GB | 600 | 5m 5s | ~336 |
| JSON array | 100 GB | 916 | 8m 52s | ~227 |
Throughput scales with file size because larger files produce more parallel Processor Lambda invocations, increasing overall concurrency.
Note on JSON array files
Unlike other formats, each JSON array chunk must fit entirely in the Processor Lambda’s RAM. With 1700 MB Lambda memory, the effective chunk size is limited to approximately 109 MB, yielding up to 916 parallel chunks for a 100 GB file. Increasing Lambda memory to 7000 MB permits larger chunks (~356 MB, 282 parallel chunks) and delivers comparable throughput (~250 MB/s for 100 GB). Choosing excessively large chunk sizes reduces parallelism and lowers overall throughput.Feedback
Was this page helpful?