Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save geosmart/8836115ad2f402704e76cce0cc336400 to your computer and use it in GitHub Desktop.
Save geosmart/8836115ad2f402704e76cce0cc336400 to your computer and use it in GitHub Desktop.
Stress testing a file-upload with Apache Bench
$ab -n 10 -c 2 -p /Users/post_file.txt -T "multipart/form-data; boundary=1234567890" http://localhost/upload
post_file.txt (use CRLF line-endings):
--1234567890
Content-Disposition: form-data; filename="file.png"
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
<base64 encoded file>
--1234567890--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment