AstonJ

AstonJ

Which webserver do you use?

We had a thread here recently that mentioned webservers in PHP, and it got me curious about the options in the BEAM world and what everyone is using. Which webservers do you use or plan to use in your apps? :003:

You can select as many options as you like:

Which webserver/s do you use or plan to use? (Select as many as you like)
  • Ace
  • Bandit
  • Chatterbox
  • Cowboy
  • Elli
  • Erlang’s built in inets/httpd
  • Mist
  • Mochiweb
  • Yaws
  • Other - please say in thread!
0 voters

Ace (Elixir)

HTTP web server and client, supports http1 and http2.

Bandit (Elixir)

Bandit is an HTTP server for Plug and Sock apps.

Chatterbox (Erlang)

HTTP/2 Server for Erlang.

Cowboy (Erlang)

Small, fast, modern HTTP server for Erlang/OTP.

Elli (Erlang)

Simple, robust and performant Erlang web server.

Erlang’s built in inets/httpd

The HTTP server, also referred to as httpd, handles HTTP requests as described in RFC 2616 with a few exceptions, such as gateway and proxy functionality. The server supports IPv6 as long as the underlying mechanisms also do so.

Mist (Gleam)

A (hopefully) nice, pure Gleam web server.

MochiWeb (Erlang)

MochiWeb is an Erlang library for building lightweight HTTP servers.

Yaws (Erlang)

Yaws webserver

Most Liked

lpil

lpil

Creator of Gleam

Great idea, I’d love to see some benchmarks of all of them.

We have some slightly out-of-date ones for some of the above here.


Mist came out fastest of the BEAM servers, and could sometimes beat Go depending on request body size.

One thing that really surprised me was how badly Cowboy handled request bodies. JavaScript was beating it as soon as there was a reasonable amount of data to read!

10
Post #3
tristan

tristan

Rebar3 Core Team

I’d expect to see similar numbers in a benchmark for Bandit and Elli since they both use Erlang’s http parser – which also means Bandit will have the same scaling issue Cowboy hit years ago that resulted in cowlib being created.

But for many many use cases Elli (or Bandit I suppose) work great :slight_smile:

mtrudel

mtrudel

Creator of Bandit

Bandit author here. Late to the party, but a couple of things:

  1. I’ve looked for historical evidence of decode_packet’s supposed scalability issues but I can’t seem to find anything. Can you point me at some references?

  2. Performance numbers in (synthetic) benchmarks suggest quite the opposite regarding the scalability of cowlib vs. decode_packet. When I was building out GitHub - mtrudel/network_benchmark I had to give up on higher concurrency tests as I was unable to get Cowboy to complete them without massive error counts, whereas Bandit hummed along just fine (and indeed grew the performance gap even more on higher concurrency tests).

m.

mtrudel

mtrudel

Creator of Bandit

The only references I can find specifically to decode_packet being replaced by cowlib dates back to 2013: https://groups.google.com/g/erlang-programming/c/C9OYrllYkpI/m/DeKOVx3rqEAJ

Some perf assertions also from that era: https://groups.google.com/g/erlang-programming/c/tJnDTcgb9L8/m/zd2fpAnCIyYJ

Considering the vintage of those assertions (R16-era), I don’t think they’re terribly relevant any longer, at least not without being corroborated by more contemporary comparisons. This proverbial ‘best before’ date is even more apparent given that benchmarks done both by me and Rawhat (GitHub - rawhat/http-benchmarks: benchmarks for mist, and other webservers) indicate that Cowboy’s performance hasn’t kept up.

The 0.6 release train of Bandit is going to be focused entirely on observability, performance and reproducible benchmarking. I expect to get an additional 20% or so perf gains out of Bandit based on this work, which should make it the fastest game in OTP town by a pretty significant measure. Expect work to start late 2022.

m.

tristan

tristan

Rebar3 Core Team

There was a Plug but I don’t think it was ever updated for the last major release of Plug.

My understanding is it won’t work as a Plug anymore because it works different from Cowboy. I vaguely recall looking once, not too deeply, and think it was technically possible but would be a hack.

It also is “fast” because it isn’t completely general purpose – it only supports bodies up to a staticly defined size and requires a plugin to include the datetime in the response, things like that.

Other reason it is fast is it uses the builtin Erlang http parser (C code). But Cowboy replaced this with cowlib for a reason, scaling. cowlib will scale up on cores and keep better latency as concurrent requests go up.

Where Next?

Popular in Polls Top

AstonJ
Do you have any favourites? (You can pick up to three) poll See post below for details:
New
AstonJ
We had a thread here recently that mentioned webservers in PHP, and it got me curious about the options in the BEAM world and what everyo...
New
New
thojanssens1
In an attempt to figure out what are the preferred GraphQL clients for Elixir developers, I made this poll below. If you’re using GraphQL...
New
AstonJ
poll asdf Extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more Manage multiple runtime versions with a ...
New
AstonJ
What is your primary dev OS? And is there any software you’d like to recommend that could make development easier? (Apart from the code e...
New
AstonJ
Curious whether you remap your Caps Lock key.. Do you remap your Caps Lock key? poll I have no idea what Globe is btw, just seen it in t...
New
ryanswapp
I think it would be interesting to see how most people are using Phoenix in production. Do you use it as an API backend for a SPA? Or do ...
New
AstonJ
Polls are a great way to easily get a snapshot of things, and we’ve had some really interesting polls over the years! Here are some tips...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

We're in Beta

About us Mission Statement