Last active
December 31, 2020 19:15
-
-
Save davekaro/d5327431eabac1d4e17a079342dc1b74 to your computer and use it in GitHub Desktop.
Falcon performance
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
require "securerandom" | |
response = SecureRandom.hex(100_000) | |
run lambda { |env| | |
[200, {"Content-Type" => "text/plain"}, [response.dup]] | |
} |
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
require "securerandom" | |
response = SecureRandom.hex(10) | |
run lambda { |env| | |
[200, {"Content-Type" => "text/plain"}, [response.dup]] | |
} |
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
require "securerandom" | |
response = SecureRandom.hex(8_116) | |
run lambda { |env| | |
[200, {"Content-Type" => "text/plain"}, [response.dup]] | |
} |
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
require "securerandom" | |
response = SecureRandom.hex(8_117) | |
run lambda { |env| | |
[200, {"Content-Type" => "text/plain"}, [response.dup]] | |
} |
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
for config in 10_response.ru 8116_response.ru 8117_response.ru 100000_response.ru; do | |
echo | |
echo | |
echo "Running $config..." | |
falcon --quiet serve --forked --count 1 --bind http://localhost --port 9292 -c $config 2>/dev/null & | |
PID1=$! | |
sleep 5 | |
wrk -c 1 -t 1 -d 10 --latency http://localhost:9292 | |
kill $PID1 | |
sleep 1 | |
done |
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
for config in 10_response.ru 8116_response.ru 8117_response.ru 100000_response.ru; do | |
echo | |
echo | |
echo "Running $config..." | |
falcon --quiet serve --forked --count 1 -c $config 2>/dev/null & | |
PID1=$! | |
sleep 5 | |
wrk -c 1 -t 1 -d 10 --latency https://localhost:9292 | |
kill $PID1 | |
sleep 1 | |
done |
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
for config in 10_response.ru 8116_response.ru 8117_response.ru 100000_response.ru; do | |
echo | |
echo | |
echo "Running $config..." | |
puma -w 1 -t 1 $config 2>/dev/null & | |
PID1=$! | |
sleep 5 | |
wrk -c 1 -t 1 -d 10 --latency http://localhost:9292 | |
kill $PID1 | |
sleep 1 | |
done |
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
for config in 10_response.ru 8116_response.ru 8117_response.ru 100000_response.ru; do | |
echo | |
echo | |
echo "Running $config..." | |
puma \ | |
-w 1 -t 1 -b "ssl://localhost:9292?key=puma_keypair.pem&cert=cert_puma.pem&verify_mode=none" \ | |
$config 2>/dev/null & | |
PID1=$! | |
sleep 5 | |
wrk -c 1 -t 1 -d 10 --latency https://localhost:9292 | |
kill $PID1 | |
sleep 1 | |
done |
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
results = { | |
http: { | |
puma: { | |
10: { | |
avg_latency: 174.38us, | |
requests_per_second: 5748.07 | |
}, | |
8116: { | |
avg_latency: 187.36us, | |
requests_per_second: 5578.54 | |
}, | |
8117: { | |
avg_latency: 177.11us, | |
requests_per_second: 5620.24 | |
}, | |
100000: { | |
avg_latency: 216.78us, | |
requests_per_second: 4589.71 | |
} | |
}, | |
falcon: { | |
10: { | |
avg_latency: 173.19us, | |
requests_per_second: 5760.95 | |
}, | |
8116: { | |
avg_latency: 189.70us, | |
requests_per_second: 5378.63 | |
}, | |
8117: { | |
avg_latency: 188.96us, | |
requests_per_second: 5280.85 | |
}, | |
100000: { | |
avg_latency: 274.23us, | |
requests_per_second: 3646.60 | |
} | |
} | |
}, | |
https: { | |
puma: { | |
10: { | |
avg_latency: 197.01us, | |
requests_per_second: 5085.95 | |
}, | |
8116: { | |
avg_latency: 410.53us, | |
requests_per_second: 2438.79 | |
}, | |
8117: { | |
avg_latency: 436.11us, | |
requests_per_second: 2289.53 | |
}, | |
100000: { | |
avg_latency: 2.62ms, | |
requests_per_second: 382.10 | |
} | |
}, | |
falcon: { | |
10: { | |
avg_latency: 323.99us, | |
requests_per_second: 4731.39 | |
}, | |
8116: { | |
avg_latency: 392.89us, | |
requests_per_second: 4283.91 | |
}, | |
8117: { | |
avg_latency: 50.80ms, | |
requests_per_second: 19.60 | |
}, | |
100000: { | |
avg_latency: 50.21ms, | |
requests_per_second: 19.89 | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment