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

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
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
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
New
Werner
Hi, I’m using Ubuntu 18.04 and after updating to OTP-24.0 yesterday i have this warning when I run “mix local.hex”: 14:57:30.512 [warn] ...
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
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New

Other popular topics Top

sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

We're in Beta

About us Mission Statement