PeterDavidCarter

PeterDavidCarter

If Nginx can only handle 10K connections and Cowboy 2M

Shouldn’t there be something additional configurable as a reverse proxy that handles 2M connections? Especially since there are complexities about properly supporting Content Security Policy headers with Safari and Nginx. Not that Nginx is bad; it’s fine. But just wondering.

Most Liked

OvermindDL1

OvermindDL1

Who said nginx can only handle 10k connections? I’m pretty sure that is configurable…

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Everyone is talking past each other here. Whether or not NGINX can respond to more regular HTTP requests per second than cowboy I don’t think is a useful metric. NGINX is very fast, nobody is disputing that.

However, the ability to get a new connection, reply quickly, and then drop it (regular HTTP) does not imply that it will hold several hundred thousand connections open indefinitely with reasonable RAM usage. Maybe it will! My point is simply that the wrk benchmark offers no evidence of that behaviour, because it doesn’t test that behaviour.

@NobbZ NGINX can definitely reverse proxy web socket connections, but I too don’t know about what the resource consumption of doing so is.

All in all it’s a good question, although notably you could just cut NGINX out of the picture entirely by not using a reverse proxy. For our production servers for example we just run cowboy on 8080, and then the AWS load balancer routes port 80 traffic to 8080.

NobbZ

NobbZ

wrk is known to have problems with cowboy and applications based on that.

Running the tool to measure on the same host as the thing you measure is a bad idea as well.

PeterDavidCarter

PeterDavidCarter

My understanding is that Cowboy can handle 2 million concurrent connections on a single server – using very powerful but still commercially available hardware.

Of course, connections aren’t everything, and there’s matters such as database storage and access speed that in the real world would be likely to take precedence at that sort of scale.

NobbZ

NobbZ

And therefore irrelevant in this discussion.

Because of the issues between wrk and cowboy this not-test doesn’t even show an order of magnitude. It just confirms that wrk and cowboy don’t play well.

The real benchmark that had to be done to answer the original question, is one that stresses a reverse-proxying nginx to an phoenix application.

Also we have to remember that the 2M for phoenix are establish websocket connections, while those 10k connections for cowboy probably are meant as concurrent requests that need to be handled by it. Serving files and stuff. I’m not sure how we can compare those.

I’m not sure how websocket connections which are only passed through via reverse-proxy do affect the ability to handle further incomming requests of NGINX. I’m not even sure if we can reverse-proxy Websocket connections.

You are really talking about the wrong things here.

Where Next?

Popular in Questions Top

Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
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
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
dokuzbir
Hello, I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these buyer = %{ id: ...
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
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
Codball
Mix format works fine if run from the cmd. I’ve followed this to facilitate the implementation into VSC which involves downloading an ext...
New
wernerlaude
In AR this is so simple @articles = current_user.articles How to do in Ecto? def index(conn, _params) do current_user = conn.assig...
New

Other popular topics Top

dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
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
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
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
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New

We're in Beta

About us Mission Statement