Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create benchmark harness using a stubbed HTTP client #9239

Open
wants to merge 2 commits into
base: benchmarks
Choose a base branch
from

Conversation

aemous
Copy link
Contributor

@aemous aemous commented Jan 21, 2025

Description of changes:

  • Adds a script that runs and benchmarks CPU and memory usage of AWS CLI commands in a configurable environment with a stubbed HTTP client.
  • Adds a default JSON file containing benchmark definitions of high-level S3 commands.

Description of tests:

  • Ran the script with the following arguments and produced the output below.
    ./scripts/performance/run-benchmarks --result-dir ~/Desktop/results --num-iterations 5 --summarize-script ~/s3transfer/scripts/performance/summarize
{
   "results":[
      {
         "name":"s3.cp.upload",
         "dimensions":[
            {
               "FileSize":"32MB"
            },
            {
               "S3TransferClient":"Classic"
            }
         ],
         "measurements":[
            {
               "total_time":0.19600677490234375,
               "max_memory":84574208.0,
               "average_memory":55284167.11111111,
               "average_cpu":1.961111111111111
            },
            {
               "total_time":0.18697285652160645,
               "max_memory":84197376.0,
               "average_memory":58062004.705882356,
               "average_cpu":2.3823529411764706
            },
            {
               "total_time":0.17623305320739746,
               "max_memory":84164608.0,
               "average_memory":56813568.0,
               "average_cpu":2.24375
            },
            {
               "total_time":0.18334007263183594,
               "max_memory":84344832.0,
               "average_memory":56881152.0,
               "average_cpu":2.4125000000000005
            },
            {
               "total_time":0.18292975425720215,
               "max_memory":82771968.0,
               "average_memory":57585664.0,
               "average_cpu":2.28125
            }
         ]
      },
      {
         "name":"s3.cp.upload",
         "dimensions":[
            {
               "FileSize":"32MB"
            },
            {
               "S3TransferClient":"CRT"
            }
         ],
         "measurements":[
            {
               "total_time":0.7381091117858887,
               "max_memory":81051648.0,
               "average_memory":73861220.72131148,
               "average_cpu":0.5508196721311477
            },
            {
               "total_time":0.5885429382324219,
               "max_memory":81002496.0,
               "average_memory":71688192.0,
               "average_cpu":0.728
            },
            {
               "total_time":0.6710991859436035,
               "max_memory":80363520.0,
               "average_memory":72948179.08771929,
               "average_cpu":0.612280701754386
            },
            {
               "total_time":0.6446530818939209,
               "max_memory":80330752.0,
               "average_memory":72164072.72727273,
               "average_cpu":0.6490909090909092
            },
            {
               "total_time":0.5529689788818359,
               "max_memory":79839232.0,
               "average_memory":71451306.66666667,
               "average_cpu":0.7020833333333334
            }
         ]
      },
      {
         "name":"s3.mv.upload",
         "dimensions":[
            {
               "FileSize":"32MB"
            }
         ],
         "measurements":[
            {
               "total_time":0.18601655960083008,
               "max_memory":88752128.0,
               "average_memory":58492928.0,
               "average_cpu":2.3937500000000003
            },
            {
               "total_time":0.18163800239562988,
               "max_memory":84180992.0,
               "average_memory":56345600.0,
               "average_cpu":2.19375
            },
            {
               "total_time":0.17676281929016113,
               "max_memory":81936384.0,
               "average_memory":57090048.0,
               "average_cpu":2.3125
            },
            {
               "total_time":0.1888139247894287,
               "max_memory":85901312.0,
               "average_memory":57637948.23529412,
               "average_cpu":2.347058823529412
            },
            {
               "total_time":0.2062389850616455,
               "max_memory":87932928.0,
               "average_memory":56902542.222222224,
               "average_cpu":2.4111111111111114
            }
         ]
      },
      {
         "name":"s3.mv.download",
         "dimensions":[
            {
               "FileSize":"32MB"
            },
            {
               "S3TransferClient":"Classic"
            }
         ],
         "measurements":[
            {
               "total_time":0.17099285125732422,
               "max_memory":76251136.0,
               "average_memory":55942621.86666667,
               "average_cpu":2.02
            },
            {
               "total_time":0.18117499351501465,
               "max_memory":75808768.0,
               "average_memory":54671360.0,
               "average_cpu":1.9624999999999997
            },
            {
               "total_time":0.1732323169708252,
               "max_memory":74956800.0,
               "average_memory":55810048.0,
               "average_cpu":1.9875
            },
            {
               "total_time":0.18622779846191406,
               "max_memory":76234752.0,
               "average_memory":55069696.0,
               "average_cpu":2.0000000000000004
            },
            {
               "total_time":0.16727495193481445,
               "max_memory":76300288.0,
               "average_memory":56316177.06666667,
               "average_cpu":1.9933333333333334
            }
         ]
      },
      {
         "name":"s3.sync.upload",
         "dimensions":[
            {
               "FileCount":"50,000"
            },
            {
               "FileSize":"4KB"
            },
            {
               "S3TransferClient":"Classic"
            }
         ],
         "measurements":[
            {
               "total_time":120.0992681980133,
               "max_memory":621543424.0,
               "average_memory":358155857.52866244,
               "average_cpu":2.3401370391815712
            },
            {
               "total_time":121.25057101249695,
               "max_memory":620511232.0,
               "average_memory":355238385.4328814,
               "average_cpu":2.3433167844184863
            },
            {
               "total_time":119.83541893959045,
               "max_memory":554975232.0,
               "average_memory":343282109.7854243,
               "average_cpu":2.3187318770538607
            },
            {
               "total_time":123.8040509223938,
               "max_memory":563593216.0,
               "average_memory":325523712.0,
               "average_cpu":2.343561746987928
            },
            {
               "total_time":120.31287503242493,
               "max_memory":548847616.0,
               "average_memory":314545011.41996527,
               "average_cpu":2.353427302568008
            }
         ]
      },
      {
         "name":"s3.sync.upload",
         "dimensions":[
            {
               "FileCount":"50,000"
            },
            {
               "FileSize":"4KB"
            },
            {
               "S3TransferClient":"CRT"
            }
         ],
         "measurements":[
            {
               "total_time":4.773425102233887,
               "max_memory":82460672.0,
               "average_memory":75557000.53333333,
               "average_cpu":1.4416666666666706
            },
            {
               "total_time":4.797473192214966,
               "max_memory":118210560.0,
               "average_memory":110808377.7672209,
               "average_cpu":1.4425178147268438
            },
            {
               "total_time":4.880110740661621,
               "max_memory":117719040.0,
               "average_memory":77055620.74074075,
               "average_cpu":1.3789351851851814
            },
            {
               "total_time":861.1851840019226,
               "max_memory":1074085888.0,
               "average_memory":508374436.747963,
               "average_cpu":0.7421759671344611
            },
            {
               "total_time":834.7199358940125,
               "max_memory":1075232768.0,
               "average_memory":578226398.3067687,
               "average_cpu":0.7524023440311297
            }
         ]
      }
   ]
}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@aemous aemous requested review from aws-sdk-python-automation and a team January 21, 2025 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant