-
-
Save liuhualh/b0dd99723bc116228c4b45714aa015f9 to your computer and use it in GitHub Desktop.
simple wrk benchmark for posting binary file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Read the binary file, lua takes binary files with no difference to strings(all UNIX;https://www.lua.org/pil/21.2.2.html). But, use 'b' tag | |
local inp = assert(io.open("xxxx.xml.gz", "rb")) | |
local data = inp:read("*all") | |
--HTTP custom settings | |
--Remember to set the schema, host and port here otherwise it will use default. | |
wrk.scheme = "http" | |
wrk.host = "localhost" | |
wrk.port = 3000 | |
wrk.method = "POST" | |
wrk.path = "/" | |
wrk.headers["Content-Encoding"] = "gzip" | |
wrk.headers["Content-Type"] = "text/xml" | |
wrk.body = data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#4 threads, 10 connections, 10 secs duration, 30s timeout limit. | |
wrk -t4 -c10 -d10s -T30s --script=postFile.lua --latency http://localhost:3000/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment