Phoenix 10k req/sec, ETS

Hi, I’m working on a USSD(*number#) application which will handle 10k concurrent request per second. Incoming request from the gateway will be converted to http request which will be handled by my phoenix application. I need advise on the below

  1. Can phoenix (cowboy) easily handle 10k concurrent request. (I don’t plan using nginx as a proxy, there won’t be any need for that)
  2. Can I use ETS for sessions - there’s no way to send a cookie to handset(USSD)
  3. Do I have to tune my linux kernel to handle 10k request. (I know feel kernel parameters for TCP)
  4. Which http client library will you recommend (1million request per day to 3PP servers) - I want something close to PHP curl/libcurl.

Thanks.

1 Like

This article (https://phoenixframework.org/blog/the-road-to-2-million-websocket-connections) covers websocket connections, but may give you some insights into the ability of Phoenix to scale.

4 Likes

Yes

In my opinion, not by itself. :ets is single node only, so when you’re running multiple nodes at the same time sessions on node A won’t appear on node B. What kind of information are you storing in the session?

No.

:hackney is sort of the standard, make sure to look at it’s pooling options, if you’re doing it all to the same server over and over you may want a pool per destination endpoint.

1 Like
  1. I plan running the app on a single node and hence :ets will suffice, I know of RIAK and Mnesia for multi-node/ cluster option.

  2. I will be storing MSISDN & basic information like the current MENU and selected option - basic stuff

  3. I prefer to setup and tear down the connection as and when I receive a request.

  4. Will a single node suffice for the above(10k connections with :ets) - 4core/16GB

This is a production scenario? Even if you plan to hot upgrade for deployments, single node guarantees unexpected downtime at some point.

You said you’re hitting 3 servers right? If you’re only hitting three servers, why avoid keep alive?

Phoenix will not be your bottleneck. Whether or not the code you write can do 10k req/ sec depends on the code you write.

4 Likes

This is a production scenario? Even if you plan to hot upgrade for deployments, single node guarantees unexpected downtime at some point.

Two servers, one active and a standby.

You said you’re hitting 3 servers right? If you’re only hitting three servers, why avoid keep alive?

The 3PP advise that we don’t hold on to the connection.

Phoenix will not be your bottleneck. Whether or not the code you write can do 10k req/ sec depends on the code you write.

I believe the underlying cowboy web server will spawn a new process for a new connection. The challenge here will be the response time of my application, correct me if I’m wrong.

Thanks a lot, most grateful - currently looking into hackney.

What is 3PP? Tried to Google for it but couldn’t find anything that looked relevant.

1 Like

My bad, 3PP → Third Party, we are consuming a service from a third party.

I believe the underlying cowboy web server will spawn a new process for a new connection. The challenge here will be the response time of my application, correct me if I’m wrong.

Any comment on the above. Thanks.

If what you mean is that the response time will depend on your application code, then I agree.

If what you mean is that the response time will depend on your application code, then I agree.

Ok, I went through the WebSocket link, it’s awesome. One more clarification, does hackney honour the connect_timeout if it’s set below the default of 8000 milliseconds. It doesn’t seem to work for me.


(Http client) - new hottness, expected to work better. See " Dependents" for a list of handful wrappers, e.g “tesla”.
P.S. Tesla does support switching between different underlying http low level libs, so you should be okay trying something else later

I checked mint out and as a newbie I was discouraged by the streaming bit, fetch data in chunks, wait and merge after the done tag. I couldn’t find any option to fetch the data directly. I understand it’s a low level api and hence the design. I will take a look at tesla - any example outside the docs. Any reason why tesla might be a better option compared to hackney as the fact that it provides a level of abstraction(nice to work with) and the ability to use different adapters. I’m learning a lot from the community. Thanks.

1 Like

IMO by providing handy access to mint

Tesla.get("http://httpbin.org/ip")