dezmathio

dezmathio

I have a concept for a distributed cluster wide task system and I’m looking for advice on what implementation strategies I could build this with.

the high level case:

I want to spin up an “infinite” number of workers to perform some headless browser tasks using phantomjs/wallaby
they will all report back to a main supervisor and i can aggregate/parse the results there

my real use case:

I want to determine the impact a large email blast linking to one of our servers would have from a “full asset standpoint”
(loading js, images, assets, etc using a headless browser)
e.g:
10k users opening a page within the same minute
1k authenticated users performing the same action, etc

my thought process:

  • There is a central supervisor that has a known hostname and can “distribute” method calls to it’s children.
  • There is an unlimited/indefinite number of child nodes that all listen to the supervisor
  • Once a supervisor sends a function (e.g. fn → visit page and return the results you are looking for ), the child that receives the function will then report back up the chain with the result
  • The supervisor receives the result and adds it to some form of log (db/redis/txt file/???).

Some notes:

when running phantomjs/wallaby there are memory limitations per instance, hence the idea of having this distributed across a number of instances all watching a common supervisor

I am interested in some architecture suggestions on implementing this, do I use Flow? Is this Docker compatible? What are some options for logging/generating a report based on the activity of all the child nodes?

Appreciate your time & look forward to your suggestions.

Showing Posts 1 to 1

Azolo

Azolo

One supervisor per node, make that supervisor a simple supervisor.

Use a pubsub that is optimized to be distributed. phoenix_pubsub would work fine.

Alternatively you can setup a GenStage pipeline where each process registers 1 demand to the producer.

The pubsub is going to faster execution but only once per process. The GenStage solution the dispatch isn’t going to be distributed but is going to be more tunable. Or just mix and match as you please.

You’ll have a listener of some kind to receive your input for the test. Just have that process emit a pubsub message or register events with the GenStage producer.

Have another process, I would do one per node, that receives the data. If you can, just write to whatever datastore in that process. If you have a lot of backpressure use a GenStage pipeline to accumulate and batch write.

I don’t think you would want to use Flow. You’re going to need your processes spun up before hand.

What isn’t Docker compatible? Just depends on how you want to architect things.

No idea, but I’m sure there are tools that will do all of this for you. If you want to write your own it probably means that none of those options work for you and you decided to make something that does work for you.

— All posts loaded —

Where Next? Top

Trending in Questions Top

itzmidinesh
Hi all, I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
yarrichar
I’m very new to Elixir, so sorry if this is a silly question: I am wondering what happens to the mailbox of a process when the machine i...
New
pragdave
How do I tell Hologram not to escape HTML when substituting into templates? {Textile.render(@product.long_description)} escapes the HTM...
New
Fl4m3Ph03n1x
Background When trying to execute mix release on a Windows 11 machine for a Phoenix project I get the following error: * assembling mark...
New
rlipscombe
I’d like to create a file with 600 permissions (rw-------), but there’s a race condition if I create it and then change the permissions. ...
New
saleyn
Is there a way to import record definitions in the iex shell for pretty printing (similar to the rr command in the erl shell)? This woul...
New
rlipscombe
When I use Mix.install with a git dependency, using git@github.com:... how do I change the SSH identity used? I’ve got two Github accoun...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
raa-ziq
Hi everyone :waving_hand: I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New
kip
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews