diff --git a/benchmarks/RESULTS.md b/benchmarks/RESULTS.md index 2dd779018..eb8d4365b 100644 --- a/benchmarks/RESULTS.md +++ b/benchmarks/RESULTS.md @@ -21,6 +21,7 @@ Compare entries only when they used the same instance type, architecture, and sc | 2026-10-19 | `9e99caa8` | 4.2.0 (tagged on `baee716c`, which differs only in one test file) | `r7g.2xlarge` (arm64), fleet of 10 | Spot | medium, large, xlarge, xxlarge | [2026-10-19-9e99caa8](history/2026-10-19-9e99caa8.md) | | 2026-10-19 | `9e99caa8` | 4.2.0 (tagged on `baee716c`, which differs only in one test file), filesystem suite | `c8gn.2xlarge` (arm64), one host | Spot | small, medium, large, xlarge (objects) | [2026-10-19-9e99caa8-filesystem](history/2026-10-19-9e99caa8-filesystem.md) | | 2026-10-23 | `7b20b499` | unreleased (after 4.2.1), filesystem and objects suites against s3fs | `c8gn.2xlarge` (arm64), one host | Spot | small, medium, large, xlarge (single objects); medium (object set) | [2026-10-23-7b20b499-filesystem](history/2026-10-23-7b20b499-filesystem.md) | +| 2026-11-15 | `1d9e5039` | unreleased (after 4.2.1), filesystem and objects suites against s3fs, with Python 3.15 and 3.15t | `c8gn.2xlarge` (arm64), one host | Spot | small, medium, large, xlarge (single objects); medium (object set) | [2026-11-15-1d9e5039-filesystem](history/2026-11-15-1d9e5039-filesystem.md) | ## Recommendations diff --git a/benchmarks/history/2026-11-15-1d9e5039-filesystem.md b/benchmarks/history/2026-11-15-1d9e5039-filesystem.md new file mode 100644 index 000000000..eb2e5f1ae --- /dev/null +++ b/benchmarks/history/2026-11-15-1d9e5039-filesystem.md @@ -0,0 +1,296 @@ + + +# S3 filesystem re-measurement on 2026-11-15 + +This entry records the [filesystem suite](../README.md#filesystem-suite) and the [objects suite](../README.md#objects-suite) at commit [`1d9e5039`](https://github.com/pyathena-dev/PyAthena/tree/1d9e5039d34f9923768c1f921e50e3b3981b5340/benchmarks), the re-measurement of #1332. +It measures the concurrent batch operations of the synchronous `S3FileSystem` (#1322) and the parallel range downloads of `get_file()` (#1323) against `AioS3FileSystem` and s3fs on the same host, and the time of one request at a time, question 4 of #1322. +It also measures the upload checksum settings of #1325, and compares Python 3.15 with its free-threaded build for #1324. +The [entry of 2026-10-23](2026-10-23-7b20b499-filesystem.md) ran on another host and is cited only for what changed in the code. + +## Environment + +| Item | Value | +| --- | --- | +| Commit | `1d9e5039d34f9923768c1f921e50e3b3981b5340`, with a clean checkout | +| Lockfile SHA-256 | `8eb419c6cb798129b81021c39bb8484b13ce0ae0181bbbb3155f21808ec7fc47`, the same as the commit's `uv.lock` | +| Default environment | Python 3.12.14 with boto3 1.43.102, botocore 1.43.102, urllib3 2.8.0, and fsspec 2026.9.0, for PyAthena | +| `s3fs` environment | Python 3.12.14 with s3fs 2026.9.0, aiobotocore 3.9.2, aiohttp 3.14.5, botocore 1.43.102, and fsspec 2026.9.0, for s3fs | +| `fs315` and `fs315t` environments | Python 3.15.2 and its free-threaded build, with only PyAthena, s3fs, and psutil and their dependencies, in the same versions; psutil 7.2.2 was built from source for 3.15t | +| GIL | every trial of `fs315t` recorded the GIL as disabled after its measurement, and every other trial as enabled | +| awscrt | not installed in any environment, so botocore computed CRC32 checksums with `zlib` | +| Host | one `c8gn.2xlarge` (arm64, 8 vCPUs, 16 GiB, 25 Gbps baseline network bandwidth), Spot, Amazon Linux 2023 (`ami-0c09db4d8b86a32d2`), kernel 6.18.62, in `us-west-2d` | +| Single objects | zero bytes in the stack's scratch bucket in `us-west-2`: 64 MiB (small), 256 MiB (medium), 1 GiB (large), and 6 GiB (xlarge) | +| Many objects | the medium set: 1,000 objects of 1 MiB of zero bytes, and a listing of 1,000 directories of 100 empty objects, 100,000 keys | +| Block size | single objects: 8 MiB for range requests, parts, and s3fs's `chunksize`; many objects: each filesystem's defaults, under which an object of 1 MiB fits in one range or part | + +## Selection + +Three queues ran with five repetitions and no warmups: 186 jobs, 561 cases. + +- **`step5-main-1`**, with the suite's configuration: 8 and 40 workers, connection pools of 10 and 40, and concurrency 8 and 40 for many objects; 153 jobs. + - In the default environment: the objects suite over the medium set, and `get` of one object at small, medium, and large, with the three APIs. + - In `fs315` and in `fs315t`: the objects suite over the medium set, and `read`, `get`, `write`, and `put` of one object at small, medium, and large, with the three APIs. +- **`step5-checksum-1`**, with 40 workers, a pool of 40, and three sets of client options in the default environment; 30 jobs. + - `default` sets nothing; `required` sets `request_checksum_calculation="when_required"`; `unsigned` also sets `s3={"payload_signing_enabled": False}`. + - `write` and `put` at medium, large, and xlarge, and `read` and `get` at medium and large, with the three APIs. +- **`step5-latency-1`**, with concurrency 1 for many objects: `cat` of the medium set with the three APIs; 3 jobs. + +The s3fs cases of the default configuration ran in the `s3fs` environment, and in `fs315` and `fs315t` in the same environment as the PyAthena cases. + +## Run record + +One worker on the one host ran the queues one after another: `step5-latency-1` from 16:37 to 16:57 UTC on 2026-11-15, `step5-checksum-1` until 17:47, and `step5-main-1` until 20:19. +Each of the 186 jobs finished on its first attempt with exit code 0, without an interruption, and each of the 561 cases recorded five successful trials and no failure. +The host then stayed idle until 14:29 UTC on 2026-11-16, when a script on it found every job done without a failure and retired it. +After recovering the results, `cleanup --execute` removed the source objects and sets, and the stack was deleted. + +## Findings + +1. **The synchronous `S3FileSystem` ran the batch operations as fast as `AioS3FileSystem`.** + It catted, downloaded, uploaded, piped, and copied 97 to 247 objects per second at concurrency 8 and 267 to 508 at concurrency 40, 1.01 to 1.08 times the aio throughput of each operation. + The entry of 2026-10-23 measured 6.5 to 20.3 objects per second for these operations, when they ran one object at a time. + Against s3fs, the transfers split by operation: s3fs uploaded, piped, and copied at 0.95 to 1.15 times the synchronous throughput, catted at 0.65 to 0.69 times, and downloaded at 1.40 to 1.42 times. + s3fs deleted and listed at 0.92 to 1.08 times the synchronous throughput, and ran `info()` at 1.04 times at concurrency 8 and 1.31 times at concurrency 40. + In the transfers and `info()`, the synchronous processes peaked at 19 threads at concurrency 8 and 51 at concurrency 40, and at 27 and 91 for downloads, whose files read their ranges in the request pool; s3fs's peaked at 13. + In `rm`, every API's peaked at 43 or 44 threads, with the 32 threads that the harness uses to prepare the copies to delete. + They took 0.79 to 1.63 times s3fs's CPU time for the transfers at concurrency 8, and 1.25 to 2.30 times at concurrency 40. +2. **`get_file()` downloaded one object at up to 613 MiB/s, close to or above s3fs.** + Both PyAthena APIs downloaded at 232 to 613 MiB/s, and s3fs at 246 to 546 MiB/s, at 0.77 to 1.06 times PyAthena's throughput of the same case. + The entry of 2026-10-23 measured 54 to 73 MiB/s for PyAthena with every setting, when `get_file()` read one block at a time. + With 40 workers, the 1 GiB download peaked at 906 to 938 MiB of RSS, against 336 to 337 MiB with 8 workers; s3fs's peaked at 917 to 1,143 MiB with 40 and 411 to 417 MiB with 8. +3. **One request at a time took 68 to 84 ms for an object of 1 MiB with every API.** + With concurrency 1, `cat` took 84 ms per object with `S3FileSystem`, 76 ms with `AioS3FileSystem`, and 68 ms with s3fs. + With concurrency 8, each of the eight lanes took 32 to 33 ms per object with both PyAthena APIs and 47 ms with s3fs. + So the difference that question 4 of #1322 found between the sequential loop, then 106 to 110 ms per object, and a lane of an aio batch is not specific to the synchronous filesystem: with every API, a request sent one at a time took 1.5 to 2.6 times as long as a request of a lane at concurrency 8. + This run does not isolate the cause. +4. **With 40 workers, PyAthena uploaded large objects faster without the default CRC32 checksum.** + `write` and `put` of the 1 GiB object ran at 1.17 to 1.28 times the default throughput with `required`, and at 1.38 to 1.46 times with `unsigned`; of the 6 GiB object, at 1.41 to 1.45 and 1.64 to 1.66 times, up to 1,623 and 1,840 MiB/s. + For the 256 MiB object, the other configurations ran within 0.96 to 1.16 times of the default. + `default` and `required` took the same CPU time, 10.8 to 11.7 seconds for the 6 GiB object, and `unsigned` 34 to 39% less. + With the default, botocore 1.43.102 sends each part as an `aws-chunked` stream of 1 MiB chunks with a CRC32 trailer (`AwsChunkedWrapper`); with `when_required`, it sends the part as a `BytesIO` without that framing and signs its SHA-256 hash. + The HTTP connection reads either body in blocks of 128 KiB, the block size that botocore sets for its connection pools. + The run did not profile the requests, so it shows the difference without attributing it to either step. + s3fs's `write`, which uploads one part at a time, ran within 0.93 to 1.05 times with every configuration; its `put_file()` ran at 0.80 to 0.86 times the default throughput with `required` and at 1.10 to 1.38 times with `unsigned`. + Reads and downloads ran within 0.93 to 1.05 times of the default with every API, as expected, since range responses carry no checksum. +5. **On free-threaded Python 3.15t, PyAthena's transfers ran up to 2.7 times faster with 40 threads, and s3fs's did not.** + With concurrency 40, both PyAthena APIs catted, downloaded, uploaded, piped, and copied the medium set at 1.16 to 2.70 times their throughput on Python 3.15, and ran `info()` at 2.22 to 2.24 times: 1.91 to 2.12 times for `cat` and 2.57 to 2.70 times for downloads, up to 930 and 680 objects per second. + With 40 workers, they read the 1 GiB object at 1.96 to 2.20 times, downloaded it at 1.46 to 1.98 times, and wrote and put it at 1.37 to 1.47 times, up to 1,217, 1,048, and 1,212 MiB/s. + With concurrency 8, the PyAthena APIs ran within 0.94 to 1.09 times of Python 3.15, and with 8 workers within 0.96 to 1.26 times, except three 64 MiB cases of the aio API at 0.54 to 0.81. + s3fs, which runs its requests on one event loop thread, ran at 0.81 to 0.94 times its throughput on Python 3.15 in every operation but `rm` (0.99) with concurrency 40, at 0.91 to 1.01 times with concurrency 8, and at 0.83 to 1.15 times for one object. + Python 3.15 with the GIL ran the transfers of the medium set within 0.92 to 1.09 times of Python 3.12 with every API. + The free-threaded processes took 0.89 to 1.52 times the CPU time of Python 3.15 for the PyAthena transfers and 1.12 to 1.22 times for s3fs's. + +## Status for #1315 + +The two gaps that the entry of 2026-10-23 listed for #1315 are closed: the synchronous filesystem's batch operations run concurrently, at the throughput of `AioS3FileSystem`, and `get_file()` downloads in parallel ranges, at 0.94 to 1.30 times s3fs's throughput. +PyAthena read one object at 5.7 to 6.6 times and wrote it at 6.4 to 15.3 times s3fs's throughput in the `default` cases of the checksum queue, and free-threaded Python widens its lead at high concurrency; single-object copies did not run. +s3fs remains ahead in downloads of many small objects, at 1.40 to 1.42 times, and in `info()` at concurrency 40, at 1.31 times, and uses fewer threads and less CPU time. + +## Limits + +- One host and five trials per case in one run; the entry does not estimate the variation between runs, so small differences between cases are not attributed to their settings. +- The 64 MiB cases took about 0.2 to 1 second each, and their free-threaded ratios ranged from 0.54 to 1.22 for the PyAthena APIs; the larger objects carry the comparison. +- The objects hold zero bytes; S3 does not compress them, but other content was not measured. +- Only the medium set of 1,000 objects of 1 MiB ran; small objects and larger sets were not measured. +- s3fs ran with the settings of the suite and its block size of 8 MiB, not with its default of 50 MiB. +- The `fs315` and `fs315t` environments import no DataFrame backend, so their RSS is not comparable with that of the default environment. +- The mechanism of finding 4 is read from botocore's source, not measured. +- The entry of 2026-10-23 ran on another host in another Availability Zone; its numbers are cited for the code that changed, not as a comparison. +- Every download writes the object to the tmpfs `/tmp`, which the RSS does not include. + +## Results + +Median throughput is the transferred bytes or objects divided by the median total time; threads are the peak thread count of the trial process, RSS its peak sampled resident memory, including the harness's common imports, and CPU the median process CPU time, user and system, of the operation. + +### Downloads + +`get` of one object in the default environment, Python 3.12, with 8 MiB blocks: + +| Scale | Workers | Pool | sync (MiB/s) | aio (MiB/s) | s3fs (MiB/s) | s3fs / sync | s3fs / aio | sync threads | aio threads | s3fs threads | sync peak RSS (MiB) | aio peak RSS (MiB) | s3fs peak RSS (MiB) | sync CPU (s) | aio CPU (s) | s3fs CPU (s) | +| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | +| small (64 MiB) | 8 | 10 | 323 | 288 | 275 | 0.85 | 0.95 | 19 | 22 | 13 | 279 | 289 | 328 | 0.22 | 0.23 | 0.14 | +| small (64 MiB) | 8 | 40 | 331 | 308 | 281 | 0.85 | 0.91 | 19 | 22 | 13 | 283 | 288 | 329 | 0.22 | 0.23 | 0.14 | +| small (64 MiB) | 40 | 10 | 327 | 304 | 292 | 0.89 | 0.96 | 19 | 22 | 13 | 283 | 285 | 328 | 0.22 | 0.23 | 0.14 | +| small (64 MiB) | 40 | 40 | 311 | 232 | 246 | 0.79 | 1.06 | 19 | 22 | 13 | 283 | 285 | 326 | 0.23 | 0.23 | 0.14 | +| medium (256 MiB) | 8 | 10 | 420 | 423 | 392 | 0.93 | 0.93 | 19 | 22 | 13 | 328 | 337 | 403 | 0.70 | 0.77 | 0.50 | +| medium (256 MiB) | 8 | 40 | 442 | 423 | 389 | 0.88 | 0.92 | 19 | 23 | 13 | 335 | 336 | 402 | 0.72 | 0.73 | 0.51 | +| medium (256 MiB) | 40 | 10 | 526 | 563 | 476 | 0.91 | 0.85 | 43 | 46 | 13 | 540 | 597 | 524 | 1.01 | 0.96 | 0.46 | +| medium (256 MiB) | 40 | 40 | 584 | 560 | 450 | 0.77 | 0.80 | 43 | 46 | 13 | 596 | 553 | 631 | 0.97 | 0.95 | 0.50 | +| large (1 GiB) | 8 | 10 | 476 | 452 | 466 | 0.98 | 1.03 | 19 | 22 | 13 | 336 | 337 | 417 | 2.68 | 2.79 | 1.75 | +| large (1 GiB) | 8 | 40 | 469 | 467 | 468 | 1.00 | 1.00 | 19 | 22 | 13 | 336 | 337 | 411 | 2.76 | 2.73 | 1.71 | +| large (1 GiB) | 40 | 10 | 599 | 583 | 542 | 0.91 | 0.93 | 51 | 54 | 13 | 932 | 925 | 917 | 3.72 | 3.85 | 1.74 | +| large (1 GiB) | 40 | 40 | 613 | 606 | 546 | 0.89 | 0.90 | 51 | 54 | 13 | 938 | 906 | 1,143 | 3.41 | 3.46 | 1.78 | + +### Many objects + +The medium set in the default environment, Python 3.12; throughput and median total time: + +| Operation | Concurrency | sync (objects/s) | aio (objects/s) | s3fs (objects/s) | s3fs / sync | s3fs / aio | sync (s) | aio (s) | s3fs (s) | +| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | +| cat | 8 | 247.1 | 242.8 | 170.9 | 0.69 | 0.70 | 4.05 | 4.12 | 5.85 | +| cat | 40 | 475.5 | 439.9 | 306.9 | 0.65 | 0.70 | 2.10 | 2.27 | 3.26 | +| get | 8 | 171.8 | 166.9 | 240.2 | 1.40 | 1.44 | 5.82 | 5.99 | 4.16 | +| get | 40 | 267.0 | 252.2 | 379.6 | 1.42 | 1.51 | 3.74 | 3.97 | 2.63 | +| put | 8 | 156.9 | 154.4 | 149.2 | 0.95 | 0.97 | 6.37 | 6.48 | 6.70 | +| put | 40 | 432.3 | 410.8 | 438.0 | 1.01 | 1.07 | 2.31 | 2.43 | 2.28 | +| pipe | 8 | 152.3 | 151.0 | 152.3 | 1.00 | 1.01 | 6.57 | 6.62 | 6.56 | +| pipe | 40 | 507.8 | 492.1 | 504.0 | 0.99 | 1.02 | 1.97 | 2.03 | 1.98 | +| copy | 8 | 97.1 | 92.0 | 99.7 | 1.03 | 1.08 | 10.30 | 10.87 | 10.03 | +| copy | 40 | 383.9 | 358.0 | 441.9 | 1.15 | 1.23 | 2.61 | 2.79 | 2.26 | +| rm | 8 | 1,176.1 | 1,203.5 | 1,181.9 | 1.00 | 0.98 | 0.85 | 0.83 | 0.85 | +| rm | 40 | 1,189.6 | 1,213.3 | 1,177.7 | 0.99 | 0.97 | 0.84 | 0.82 | 0.85 | +| find | 8 | 7,632.3 | 7,925.0 | 6,996.8 | 0.92 | 0.88 | 13.10 | 12.62 | 14.29 | +| find | 40 | 7,628.0 | 7,697.2 | 8,238.5 | 1.08 | 1.07 | 13.11 | 12.99 | 12.14 | +| info | 8 | 534.9 | 527.2 | 556.2 | 1.04 | 1.05 | 1.87 | 1.90 | 1.80 | +| info | 40 | 883.9 | 787.2 | 1,153.8 | 1.31 | 1.47 | 1.13 | 1.27 | 0.87 | + +Process cost: + +| Operation | Concurrency | sync threads | aio threads | s3fs threads | sync peak RSS (MiB) | aio peak RSS (MiB) | s3fs peak RSS (MiB) | sync CPU (s) | aio CPU (s) | s3fs CPU (s) | +| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | +| cat | 8 | 19 | 20 | 13 | 1,196 | 1,194 | 1,222 | 2.95 | 3.22 | 3.72 | +| cat | 40 | 51 | 52 | 13 | 1,223 | 1,216 | 1,250 | 4.06 | 4.31 | 3.25 | +| get | 8 | 27 | 28 | 13 | 211 | 209 | 221 | 4.66 | 4.82 | 2.87 | +| get | 40 | 91 | 92 | 13 | 285 | 284 | 254 | 5.89 | 6.17 | 2.56 | +| put | 8 | 19 | 20 | 13 | 230 | 229 | 251 | 2.93 | 3.06 | 2.27 | +| put | 40 | 51 | 52 | 13 | 385 | 384 | 396 | 3.55 | 3.81 | 2.13 | +| pipe | 8 | 19 | 20 | 13 | 214 | 212 | 244 | 2.45 | 2.61 | 2.09 | +| pipe | 40 | 51 | 52 | 13 | 304 | 302 | 343 | 2.98 | 3.24 | 1.92 | +| copy | 8 | 19 | 20 | 13 | 199 | 198 | 218 | 2.74 | 2.95 | 2.15 | +| copy | 40 | 51 | 52 | 13 | 225 | 224 | 231 | 2.78 | 3.08 | 1.82 | +| rm | 8 | 43 | 44 | 44 | 214 | 214 | 241 | 0.04 | 0.04 | 0.05 | +| rm | 40 | 43 | 44 | 44 | 214 | 214 | 241 | 0.04 | 0.04 | 0.05 | +| find | 8 | 11 | 13 | 13 | 307 | 308 | 346 | 6.26 | 6.30 | 5.93 | +| find | 40 | 11 | 13 | 13 | 307 | 313 | 350 | 6.27 | 6.29 | 5.91 | +| info | 8 | 19 | 20 | 13 | 200 | 200 | 217 | 1.21 | 1.34 | 0.89 | +| info | 40 | 51 | 52 | 13 | 225 | 221 | 225 | 1.42 | 1.53 | 0.85 | + +### One object at a time + +`cat` of the medium set with concurrency 1, in the default environment, Python 3.12: + +| API | Objects/s | Time per object (ms) | Total (s) | Threads | CPU (s) | +| --- | ---: | ---: | ---: | ---: | ---: | +| sync | 11.9 | 84.2 | 84.24 | 12 | 3.04 | +| aio | 13.2 | 75.9 | 75.91 | 13 | 3.18 | +| s3fs | 14.6 | 68.4 | 68.35 | 13 | 3.32 | + +### Upload checksums + +40 workers and a pool of 40 connections in the default environment, Python 3.12; throughput in MiB/s and CPU time in seconds for each client configuration: + +| Operation | Scale | API | default (MiB/s) | required (MiB/s) | unsigned (MiB/s) | required / default | unsigned / default | default CPU (s) | required CPU (s) | unsigned CPU (s) | +| --- | --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | +| write | medium (256 MiB) | sync | 477 | 460 | 474 | 0.96 | 0.99 | 0.71 | 0.71 | 0.56 | +| write | medium (256 MiB) | aio | 497 | 523 | 572 | 1.05 | 1.15 | 0.71 | 0.68 | 0.51 | +| write | medium (256 MiB) | s3fs | 74 | 68 | 74 | 0.93 | 1.01 | 0.29 | 0.38 | 0.33 | +| write | large (1 GiB) | sync | 836 | 1,002 | 1,216 | 1.20 | 1.45 | 2.23 | 2.19 | 1.44 | +| write | large (1 GiB) | aio | 832 | 1,067 | 1,146 | 1.28 | 1.38 | 2.14 | 2.06 | 1.56 | +| write | large (1 GiB) | s3fs | 75 | 71 | 79 | 0.95 | 1.05 | 1.12 | 1.47 | 0.82 | +| write | xlarge (6 GiB) | sync | 1,119 | 1,623 | 1,836 | 1.45 | 1.64 | 10.96 | 10.82 | 7.12 | +| write | xlarge (6 GiB) | aio | 1,110 | 1,601 | 1,840 | 1.44 | 1.66 | 11.25 | 11.37 | 6.89 | +| write | xlarge (6 GiB) | s3fs | 73 | 70 | 76 | 0.95 | 1.03 | 9.74 | 8.90 | 7.90 | +| put | medium (256 MiB) | sync | 484 | 487 | 561 | 1.01 | 1.16 | 0.73 | 0.72 | 0.54 | +| put | medium (256 MiB) | aio | 499 | 498 | 496 | 1.00 | 0.99 | 0.74 | 0.71 | 0.55 | +| put | medium (256 MiB) | s3fs | 416 | 357 | 458 | 0.86 | 1.10 | 0.39 | 0.52 | 0.35 | +| put | large (1 GiB) | sync | 843 | 987 | 1,229 | 1.17 | 1.46 | 2.18 | 2.25 | 1.47 | +| put | large (1 GiB) | aio | 833 | 973 | 1,196 | 1.17 | 1.43 | 2.19 | 2.27 | 1.53 | +| put | large (1 GiB) | s3fs | 585 | 470 | 696 | 0.80 | 1.19 | 1.23 | 1.81 | 1.11 | +| put | xlarge (6 GiB) | sync | 1,102 | 1,556 | 1,803 | 1.41 | 1.64 | 11.44 | 11.53 | 7.52 | +| put | xlarge (6 GiB) | aio | 1,098 | 1,557 | 1,819 | 1.42 | 1.66 | 11.73 | 11.38 | 7.40 | +| put | xlarge (6 GiB) | s3fs | 680 | 569 | 937 | 0.84 | 1.38 | 7.31 | 9.61 | 5.49 | +| read | medium (256 MiB) | sync | 520 | 532 | 544 | 1.02 | 1.05 | 0.99 | 0.99 | 0.99 | +| read | medium (256 MiB) | aio | 549 | 515 | 538 | 0.94 | 0.98 | 1.00 | 1.03 | 0.98 | +| read | medium (256 MiB) | s3fs | 91 | 91 | 91 | 1.00 | 1.00 | 0.44 | 0.44 | 0.44 | +| read | large (1 GiB) | sync | 602 | 617 | 624 | 1.02 | 1.04 | 3.50 | 3.42 | 3.41 | +| read | large (1 GiB) | aio | 607 | 636 | 567 | 1.05 | 0.93 | 3.49 | 3.33 | 3.50 | +| read | large (1 GiB) | s3fs | 92 | 92 | 92 | 1.00 | 1.00 | 1.70 | 1.69 | 1.54 | +| get | medium (256 MiB) | sync | 568 | 540 | 572 | 0.95 | 1.01 | 0.98 | 1.02 | 0.96 | +| get | medium (256 MiB) | aio | 532 | 525 | 552 | 0.99 | 1.04 | 1.02 | 1.03 | 0.98 | +| get | medium (256 MiB) | s3fs | 469 | 457 | 456 | 0.97 | 0.97 | 0.49 | 0.50 | 0.50 | +| get | large (1 GiB) | sync | 597 | 611 | 619 | 1.02 | 1.04 | 3.50 | 3.41 | 3.37 | +| get | large (1 GiB) | aio | 589 | 604 | 578 | 1.03 | 0.98 | 3.55 | 3.44 | 3.64 | +| get | large (1 GiB) | s3fs | 524 | 541 | 527 | 1.03 | 1.01 | 1.86 | 1.78 | 1.82 | + +### Free-threaded Python + +The medium set with Python 3.15.2 (`fs315`) and its free-threaded build (`fs315t`); throughput in objects per second: + +| Operation | Concurrency | sync 3.15 | sync 3.15t | 3.15t / 3.15 | aio 3.15 | aio 3.15t | 3.15t / 3.15 | s3fs 3.15 | s3fs 3.15t | 3.15t / 3.15 | sync CPU 3.15 / 3.15t (s) | aio CPU 3.15 / 3.15t (s) | s3fs CPU 3.15 / 3.15t (s) | +| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | +| cat | 8 | 234.4 | 241.2 | 1.03 | 240.1 | 239.0 | 1.00 | 164.8 | 159.2 | 0.97 | 3.01 / 3.33 | 3.13 / 3.54 | 3.82 / 4.37 | +| cat | 40 | 439.7 | 930.1 | 2.12 | 426.6 | 812.9 | 1.91 | 308.2 | 255.9 | 0.83 | 4.14 / 3.68 | 4.14 / 3.96 | 3.22 / 3.89 | +| get | 8 | 164.1 | 166.8 | 1.02 | 168.5 | 170.0 | 1.01 | 230.4 | 226.3 | 0.98 | 4.64 / 5.55 | 4.81 / 5.82 | 3.01 / 3.35 | +| get | 40 | 264.7 | 679.6 | 2.57 | 245.0 | 660.9 | 2.70 | 375.0 | 340.0 | 0.91 | 5.78 / 5.96 | 6.20 / 6.28 | 2.57 / 2.88 | +| put | 8 | 148.5 | 146.9 | 0.99 | 147.4 | 143.3 | 0.97 | 147.4 | 144.5 | 0.98 | 2.89 / 4.41 | 3.03 / 4.49 | 2.33 / 2.65 | +| put | 40 | 411.8 | 576.4 | 1.40 | 389.7 | 576.7 | 1.48 | 450.4 | 401.9 | 0.89 | 3.59 / 4.69 | 3.73 / 4.93 | 2.10 / 2.39 | +| pipe | 8 | 151.2 | 142.2 | 0.94 | 150.1 | 142.4 | 0.95 | 147.7 | 148.9 | 1.01 | 2.52 / 3.51 | 2.65 / 3.66 | 2.12 / 2.40 | +| pipe | 40 | 484.4 | 629.3 | 1.30 | 462.0 | 607.1 | 1.31 | 509.8 | 460.2 | 0.90 | 3.03 / 3.63 | 3.21 / 3.78 | 1.90 / 2.12 | +| copy | 8 | 99.1 | 98.4 | 0.99 | 100.0 | 96.1 | 0.96 | 102.8 | 98.2 | 0.96 | 2.72 / 3.44 | 2.91 / 3.72 | 2.21 / 2.70 | +| copy | 40 | 378.9 | 439.3 | 1.16 | 346.4 | 429.6 | 1.24 | 458.7 | 432.1 | 0.94 | 2.73 / 3.38 | 2.99 / 3.68 | 1.84 / 2.20 | +| rm | 8 | 1,111.7 | 1,197.5 | 1.08 | 1,204.9 | 1,139.8 | 0.95 | 1,168.0 | 1,122.6 | 0.96 | 0.04 / 0.05 | 0.04 / 0.05 | 0.05 / 0.05 | +| rm | 40 | 1,171.8 | 1,133.1 | 0.97 | 1,157.2 | 1,172.5 | 1.01 | 1,181.6 | 1,171.6 | 0.99 | 0.04 / 0.05 | 0.04 / 0.05 | 0.05 / 0.05 | +| find | 8 | 7,578.2 | 7,749.5 | 1.02 | 7,140.4 | 7,339.9 | 1.03 | 8,438.7 | 7,647.6 | 0.91 | 5.80 / 6.43 | 5.82 / 6.90 | 5.39 / 6.18 | +| find | 40 | 7,608.2 | 6,942.1 | 0.91 | 8,227.5 | 7,250.7 | 0.88 | 8,527.6 | 7,049.0 | 0.83 | 5.81 / 6.43 | 5.81 / 6.90 | 5.39 / 6.18 | +| info | 8 | 559.2 | 581.9 | 1.04 | 513.1 | 559.8 | 1.09 | 572.0 | 572.6 | 1.00 | 1.22 / 1.56 | 1.34 / 1.69 | 0.90 / 1.10 | +| info | 40 | 799.4 | 1,791.6 | 2.24 | 739.1 | 1,640.9 | 2.22 | 1,242.4 | 1,000.8 | 0.81 | 1.40 / 1.84 | 1.52 / 2.01 | 0.80 / 0.99 | + +One object with 8 MiB blocks, in MiB/s: + +| Scale | Operation | Workers | Pool | sync 3.15 | sync 3.15t | 3.15t / 3.15 | aio 3.15 | aio 3.15t | 3.15t / 3.15 | s3fs 3.15 | s3fs 3.15t | 3.15t / 3.15 | sync threads 3.15t | sync CPU 3.15 / 3.15t (s) | aio CPU 3.15 / 3.15t (s) | s3fs CPU 3.15 / 3.15t (s) | +| --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | +| small (64 MiB) | read | 8 | 10 | 267 | 326 | 1.22 | 267 | 148 | 0.56 | 86 | 85 | 0.99 | 9 | 0.22 / 0.21 | 0.23 / 0.22 | 0.13 / 0.14 | +| small (64 MiB) | read | 8 | 40 | 276 | 296 | 1.07 | 279 | 305 | 1.09 | 86 | 85 | 0.99 | 9 | 0.24 / 0.21 | 0.23 / 0.22 | 0.11 / 0.15 | +| small (64 MiB) | read | 40 | 10 | 291 | 329 | 1.13 | 278 | 304 | 1.10 | 86 | 85 | 0.99 | 9 | 0.23 / 0.21 | 0.24 / 0.22 | 0.13 / 0.13 | +| small (64 MiB) | read | 40 | 40 | 265 | 279 | 1.05 | 298 | 311 | 1.04 | 86 | 85 | 0.99 | 9 | 0.22 / 0.21 | 0.23 / 0.22 | 0.13 / 0.14 | +| small (64 MiB) | get | 8 | 10 | 291 | 285 | 0.98 | 287 | 154 | 0.54 | 292 | 267 | 0.91 | 9 | 0.22 / 0.21 | 0.23 / 0.22 | 0.14 / 0.15 | +| small (64 MiB) | get | 8 | 40 | 296 | 294 | 0.99 | 277 | 319 | 1.15 | 272 | 271 | 1.00 | 9 | 0.23 / 0.21 | 0.23 / 0.22 | 0.14 / 0.15 | +| small (64 MiB) | get | 40 | 10 | 293 | 293 | 1.00 | 277 | 322 | 1.16 | 294 | 260 | 0.89 | 9 | 0.24 / 0.21 | 0.23 / 0.22 | 0.14 / 0.16 | +| small (64 MiB) | get | 40 | 40 | 265 | 261 | 0.99 | 278 | 324 | 1.16 | 282 | 234 | 0.83 | 9 | 0.24 / 0.21 | 0.23 / 0.22 | 0.14 / 0.16 | +| small (64 MiB) | write | 8 | 10 | 168 | 179 | 1.07 | 178 | 184 | 1.04 | 63 | 64 | 1.01 | 9 | 0.17 / 0.19 | 0.16 / 0.19 | 0.12 / 0.12 | +| small (64 MiB) | write | 8 | 40 | 165 | 185 | 1.12 | 172 | 183 | 1.06 | 61 | 59 | 0.96 | 9 | 0.17 / 0.18 | 0.16 / 0.18 | 0.11 / 0.12 | +| small (64 MiB) | write | 40 | 10 | 174 | 179 | 1.03 | 173 | 165 | 0.96 | 56 | 64 | 1.15 | 9 | 0.17 / 0.18 | 0.17 / 0.18 | 0.11 / 0.13 | +| small (64 MiB) | write | 40 | 40 | 169 | 169 | 1.00 | 164 | 173 | 1.05 | 63 | 63 | 1.01 | 9 | 0.17 / 0.18 | 0.17 / 0.19 | 0.12 / 0.13 | +| small (64 MiB) | put | 8 | 10 | 163 | 171 | 1.05 | 176 | 143 | 0.81 | 190 | 183 | 0.97 | 9 | 0.17 / 0.19 | 0.17 / 0.19 | 0.11 / 0.12 | +| small (64 MiB) | put | 8 | 40 | 150 | 164 | 1.09 | 165 | 172 | 1.04 | 192 | 174 | 0.91 | 9 | 0.17 / 0.19 | 0.17 / 0.19 | 0.11 / 0.12 | +| small (64 MiB) | put | 40 | 10 | 165 | 174 | 1.06 | 178 | 161 | 0.91 | 183 | 182 | 1.00 | 9 | 0.17 / 0.18 | 0.17 / 0.19 | 0.11 / 0.12 | +| small (64 MiB) | put | 40 | 40 | 170 | 176 | 1.03 | 172 | 162 | 0.94 | 166 | 175 | 1.06 | 9 | 0.17 / 0.19 | 0.17 / 0.19 | 0.11 / 0.12 | +| medium (256 MiB) | read | 8 | 10 | 420 | 457 | 1.09 | 436 | 454 | 1.04 | 91 | 91 | 1.00 | 9 | 0.75 / 0.64 | 0.71 / 0.65 | 0.45 / 0.48 | +| medium (256 MiB) | read | 8 | 40 | 440 | 441 | 1.00 | 428 | 475 | 1.11 | 91 | 91 | 1.00 | 9 | 0.74 / 0.64 | 0.75 / 0.65 | 0.42 / 0.43 | +| medium (256 MiB) | read | 40 | 10 | 439 | 672 | 1.53 | 413 | 592 | 1.43 | 91 | 91 | 1.00 | 33 | 0.99 / 0.88 | 1.02 / 0.87 | 0.42 / 0.49 | +| medium (256 MiB) | read | 40 | 40 | 429 | 695 | 1.62 | 428 | 659 | 1.54 | 91 | 91 | 1.00 | 33 | 1.01 / 0.87 | 1.00 / 0.86 | 0.45 / 0.49 | +| medium (256 MiB) | get | 8 | 10 | 405 | 482 | 1.19 | 407 | 405 | 0.99 | 386 | 386 | 1.00 | 9 | 0.76 / 0.64 | 0.75 / 0.67 | 0.50 / 0.53 | +| medium (256 MiB) | get | 8 | 40 | 402 | 453 | 1.13 | 370 | 466 | 1.26 | 387 | 376 | 0.97 | 9 | 0.71 / 0.65 | 0.75 / 0.68 | 0.50 / 0.52 | +| medium (256 MiB) | get | 40 | 10 | 438 | 620 | 1.41 | 422 | 679 | 1.61 | 446 | 446 | 1.00 | 33 | 0.99 / 0.88 | 1.02 / 0.86 | 0.48 / 0.50 | +| medium (256 MiB) | get | 40 | 40 | 449 | 616 | 1.37 | 443 | 661 | 1.49 | 431 | 434 | 1.01 | 33 | 0.98 / 0.88 | 0.98 / 0.86 | 0.52 / 0.52 | +| medium (256 MiB) | write | 8 | 10 | 359 | 358 | 1.00 | 360 | 378 | 1.05 | 70 | 72 | 1.02 | 9 | 0.43 / 0.56 | 0.42 / 0.56 | 0.40 / 0.40 | +| medium (256 MiB) | write | 8 | 40 | 333 | 364 | 1.09 | 369 | 383 | 1.04 | 72 | 72 | 0.99 | 9 | 0.43 / 0.55 | 0.42 / 0.55 | 0.43 / 0.40 | +| medium (256 MiB) | write | 40 | 10 | 460 | 490 | 1.07 | 511 | 505 | 0.99 | 71 | 72 | 1.01 | 33 | 0.73 / 0.81 | 0.71 / 0.82 | 0.42 / 0.41 | +| medium (256 MiB) | write | 40 | 40 | 473 | 477 | 1.01 | 455 | 495 | 1.09 | 68 | 75 | 1.11 | 33 | 0.74 / 0.82 | 0.71 / 0.81 | 0.41 / 0.40 | +| medium (256 MiB) | put | 8 | 10 | 364 | 358 | 0.98 | 356 | 366 | 1.03 | 311 | 268 | 0.86 | 9 | 0.43 / 0.57 | 0.43 / 0.60 | 0.32 / 0.36 | +| medium (256 MiB) | put | 8 | 40 | 364 | 369 | 1.01 | 342 | 365 | 1.07 | 308 | 293 | 0.95 | 9 | 0.42 / 0.57 | 0.43 / 0.56 | 0.32 / 0.34 | +| medium (256 MiB) | put | 40 | 10 | 489 | 508 | 1.04 | 492 | 440 | 0.89 | 377 | 361 | 0.96 | 33 | 0.73 / 0.82 | 0.74 / 0.79 | 0.34 / 0.36 | +| medium (256 MiB) | put | 40 | 40 | 498 | 484 | 0.97 | 466 | 471 | 1.01 | 422 | 416 | 0.99 | 33 | 0.74 / 0.80 | 0.73 / 0.79 | 0.38 / 0.41 | +| large (1 GiB) | read | 8 | 10 | 518 | 550 | 1.06 | 516 | 547 | 1.06 | 92 | 93 | 1.00 | 9 | 2.69 / 2.29 | 2.66 / 2.35 | 1.71 / 1.82 | +| large (1 GiB) | read | 8 | 40 | 511 | 546 | 1.07 | 516 | 551 | 1.07 | 92 | 92 | 1.00 | 9 | 2.63 / 2.30 | 2.75 / 2.35 | 1.61 / 1.88 | +| large (1 GiB) | read | 40 | 10 | 556 | 1,173 | 2.11 | 567 | 1,131 | 1.99 | 92 | 93 | 1.00 | 41 | 3.58 / 2.89 | 3.49 / 2.94 | 1.62 / 1.86 | +| large (1 GiB) | read | 40 | 40 | 550 | 1,207 | 2.20 | 620 | 1,217 | 1.96 | 92 | 93 | 1.00 | 41 | 3.62 / 2.84 | 3.23 / 2.85 | 1.83 / 1.77 | +| large (1 GiB) | get | 8 | 10 | 453 | 540 | 1.19 | 464 | 484 | 1.04 | 472 | 418 | 0.88 | 9 | 2.75 / 2.38 | 2.74 / 2.47 | 1.74 / 1.96 | +| large (1 GiB) | get | 8 | 40 | 413 | 508 | 1.23 | 462 | 506 | 1.09 | 475 | 435 | 0.92 | 9 | 2.83 / 2.42 | 2.75 / 2.47 | 1.70 / 1.94 | +| large (1 GiB) | get | 40 | 10 | 517 | 769 | 1.49 | 520 | 759 | 1.46 | 535 | 517 | 0.97 | 41 | 3.77 / 3.10 | 3.70 / 3.12 | 1.77 / 1.87 | +| large (1 GiB) | get | 40 | 40 | 554 | 1,048 | 1.89 | 526 | 1,039 | 1.98 | 546 | 488 | 0.89 | 41 | 3.49 / 2.84 | 3.57 / 2.87 | 1.78 / 2.01 | +| large (1 GiB) | write | 8 | 10 | 524 | 512 | 0.98 | 517 | 516 | 1.00 | 74 | 75 | 1.02 | 9 | 1.42 / 2.00 | 1.36 / 2.05 | 1.66 / 1.59 | +| large (1 GiB) | write | 8 | 40 | 506 | 510 | 1.01 | 509 | 517 | 1.02 | 73 | 74 | 1.01 | 9 | 1.40 / 1.95 | 1.40 / 1.99 | 1.60 / 1.56 | +| large (1 GiB) | write | 40 | 10 | 852 | 1,201 | 1.41 | 820 | 1,199 | 1.46 | 73 | 74 | 1.01 | 41 | 2.13 / 3.18 | 2.21 / 3.18 | 1.60 / 1.57 | +| large (1 GiB) | write | 40 | 40 | 823 | 1,212 | 1.47 | 812 | 1,142 | 1.41 | 74 | 76 | 1.04 | 41 | 2.20 / 3.00 | 2.22 / 3.14 | 1.61 / 1.62 | +| large (1 GiB) | put | 8 | 10 | 522 | 501 | 0.96 | 523 | 506 | 0.97 | 383 | 350 | 0.91 | 9 | 1.46 / 2.07 | 1.42 / 2.08 | 1.16 / 1.24 | +| large (1 GiB) | put | 8 | 40 | 502 | 522 | 1.04 | 515 | 512 | 1.00 | 345 | 331 | 0.96 | 9 | 1.45 / 2.07 | 1.47 / 2.13 | 1.18 / 1.24 | +| large (1 GiB) | put | 40 | 10 | 841 | 1,163 | 1.38 | 842 | 1,156 | 1.37 | 480 | 480 | 1.00 | 41 | 2.21 / 3.03 | 2.26 / 3.19 | 1.18 / 1.20 | +| large (1 GiB) | put | 40 | 40 | 825 | 1,157 | 1.40 | 831 | 1,154 | 1.39 | 587 | 588 | 1.00 | 41 | 2.22 / 3.07 | 2.23 / 3.16 | 1.22 / 1.27 | diff --git a/docs/usage.md b/docs/usage.md index 27ebd7efb..95847bc48 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -830,6 +830,10 @@ Those PutObject and UploadPart requests then include the SHA-256 hash of their b Over HTTPS, the client leaves the hash out of a request that sets `ContentMD5`, which S3 checks instead, unless its `s3` options set `payload_signing_enabled` to `True`. It also leaves the hash out if its `s3` options set `payload_signing_enabled` to `False` or if it sends unsigned requests, such as `S3FileSystem(anon=True)`. +In the [benchmark run of 2026-11-15](https://github.com/pyathena-dev/PyAthena/blob/master/benchmarks/history/2026-11-15-1d9e5039-filesystem.md), on one `c8gn.2xlarge` host with 40 workers and 8 MiB parts, `S3FileSystem` wrote a 1 GiB object at 836 MiB/s with the defaults, at 1,002 MiB/s with `request_checksum_calculation="when_required"`, and at 1,216 MiB/s when its `s3` options also set `payload_signing_enabled` to `False`. +It wrote a 6 GiB object at 1,119, 1,623, and 1,836 MiB/s with the same settings, taking 11.0, 10.8, and 7.1 seconds of CPU time. +Its writes of a 256 MiB object and its reads and downloads ran within 5% of the defaults with either setting. + With `response_checksum_validation="when_supported"`, the client requests the checksum of the object with every GetObject request. It validates the body it reads when the response carries a full-object checksum of an algorithm that botocore supports, and reads the body without validation otherwise, such as with the composite checksum of an object uploaded in parts. botocore supports CRC32, SHA-1, SHA-256, and SHA-512, and with `botocore[crt]` also CRC32C, CRC64NVME, XXHASH64, XXHASH3, and XXHASH128.