I'm in the process of choosing a technology for my high-throughput web server. I've created two naive implementations, one in Go and one in Elixir, using Phoenix.
I've deployed these versions on an extra large machine on AWS, and used siege to benchmark their performance.
I've managed to increase Go's performance after setting the GOMAXPROCS
, but running the Elixir version seems to reach its peak performance long before it fully utilizes the machine's CPU or memory.
I couldn't seem to find any documentation or explanation on how I can fine-tune cowboy's behavior in production settings, so it will properly utilize the machine it runs on, and produce the performance everybody talks about...
I'm pretty sure that there is a simple place (file or environment variable) where I can tweak a value or two to produce much better results.
Can anyone tell me where that place may be?
Following the suggestions in the comments, I've re-implemented my project using plug instead of phoenix.
With the same functionality (parsing post body to JSON, calling DynamoDB, reading from an Amnesia table and formatting a JSON response) I've received a much better performance, with far more resource utilization.
I guess I can still "milk" a few more requests per second (currently I get around 500 requests per second), but it is now on-par with the Go implementation of the same thing...
I don't have enough rep to comment directly, so I'll answer here. I'd love to see the numbers you got with Phoenix. Were you running in prod mode? Perf will be much slower if you were running in dev (the default) since code reloading is enabled and checking on every request. Vanilla Plug is going to be doing less work than Phoenix, but not much less. A standard Phoenix Router/Controller should be more or less inline with the Plug code you end up with.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With