Zesky665

Zesky665

Hi,

I need to run an js script 500 times at once and collect the outputs from each execution. Is this something that can easily be done with elixir, at least in comparison to other languages?

I’m also interested (if the above is true) if It is possible to have a separate process track the execution of each of the scripts and update the results on a drab page like in the async tasks example?

Just in case it is important the script that I plan to run is a automated e2e test using selenium.

Thanks in advance

Showing Posts 1 to 9

grych

grych

Creator of Drab

Will you run this 500 js in the same browser? I assume you want to use the browser, as you’re refering to Drab.

Yes, exactly like in the async example - run the separate task for each process and collect results as it finishes.

Zesky665

Zesky665 OP

Will you run this 500 js in the same browser? I assume you want to use the browser, as you’re refering to Drab.

This is how I was imagining the workflow:

  1. User opens the drab page with the different tests listed on their comp.
  2. User presses ‘Run Tests’ button
  3. A script runs on the server where the drab page is hosted, firing of 500 seperate headless chrome instances.
  4. The users gets a list of reports from each test instance as the tests finish.
grych

grych

Creator of Drab

This part might be a little bit tricky, if you want to do it in parallel :wink:

Zesky665

Zesky665 OP

Any suggestions?

grych

grych

Creator of Drab

I have never measured it, but I believe RAM would be a bottleneck for 500 chromes. You may want to run it on the multiple machines, and yes - this is a case for Elixir.

Also, be prepared to have a small number of random bugs occasionally. I am using chromedriver with hound in Drab’s tests, and from time to time it just fails with the different browser errors. Re-running the same test fixes the issue.

grych

grych

Creator of Drab

There is a service for this, https://www.browserless.io, but they are charging something like 5$ per browser, so probably it would be cheaper to provide your own infrastructure.

Zesky665

Zesky665 OP

I’ll try and work that out somehow. Maybe I’ll just have to rent a beefy server.

I’m quite familiar with those :stuck_out_tongue:

mgwidmann

mgwidmann

Use Task.async_stream/3 and toy with the limit until you get a maximum that fits the hardware you’re on. Once you get that functioning your test will run (which is valuable in itself). Then if that number is unacceptable and runtime is too long, get a bigger box and see what it will give you. Selenium is slow and uses a lot of CPU as well. So its best to get something working as is first before springing to another box so you’ll have something to compare against when you do decide to increase the hardware (not to mention being able to justify or not justify the cost of doing so).

mgwidmann

mgwidmann

Also, consider starting with number of cores. Don’t try 100 or something crazy like that at first because it will never complete. Start with something with few resource constraints and inefficient and move up to efficient and max resources because once you go past that its just likely to waste your time.

— All posts loaded —

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews