thoughtarray

thoughtarray

Stress testing: doing something as quickly as possible at the "same time"

Hello, this is my first post, and I hope it isn’t already obviously answered in another post. I did my best to look.

Problem statement

I want to do something as quickly as possible at the “same time” (as possible). To simplify the realm of possibilities, let’s say I’m using :gen_tcp to send a packet.

What I do and don’t know

I know:

  • :gen_tcp is process-less and returns a Port
  • Some strategies for spawning large numbers of processes such as using PartitionSupervisor to spawn a DynamicSupervisor per CPU core

I don’t know:

  • How to handle ports (or what they are really in the context of a network socket)
    • Should I make one per CPU core, one per worker process, or something in-between?
    • Is NimblePool relevant here (can’t tell from the README)
    • Can I have multiple TCP connections/session per port?
  • How to signal to all workers to do something at the same time
    • How can I do this without causing a signal sender bottleneck? Can Phoenix PubSub cover this? Is there a simpler approach without building a bespoke pubsub myself?

Additional notes on what I want:

  • To make as many TCP socket connections as possible to more closely represent independent client connections

Context (not required reading)

I want to build a stress testing tool in Elixir that will be used against transports HTTP1.x and websockets. The point is to test the efficiency/throughput differences between the two approaches.

I know there’s a difference between the two transports in that the former is non-stateful and latter stateful, but I do want to be fair to HTTP1.x and use keep-alive; so maybe my request implementation can be similar-ish for a more apples-to-apples comparison.

Where Next?

Popular in Questions Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
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
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
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

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36654 110
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49084 226
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42533 114
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement