When to use parallel action?

Hi!

I just saw the “parallel” action in server connect, never noticed it before.

I couldn’t find any information regarding this action in the community. I assume that it does what the name suggests by executing stuff in parallel, which I assume speeds up things.

What are the best practises in using this? Are there any cons? Can it be overused / overloaded?

You can do stuff like doing 3 API Actions in parallel - all steps inside it are executed in parallel

However, it’s missing a critical feature to make it really usable:

Thank you,

So if I put 10 different conditions in the parallel, it will check all the conditions at once?
Is it possible to overload by doing too many stuff in parallel? If yes, how to “know” the limit of this?

Yes, all conditions will run in parallel, and the steps inside the conditions (a.k.a. inside the Group) will run sequentially. It’s like you tell 10 people to go to the store and buy eggs - they’ll all follow their instructions sequentially (enter store, grab eggs, pay, exit store).

Yes, there’s no built-in safety against overloading. You might exceed the CPU limit or OS limits such as the number of open files for outgoing connections. An open file may be an outgoing socket in Unix terms.

Research about open files limit and/or ephemeral ports

I wouldn’t execute more than 50 things in parallel, and would preferably stay at 10. A realistic OS limit would be 1024 by default (usually lower due to other processes using resources as well)

2 Likes

JavaScript is single threaded, the parallel action is only useful for actions that are actual async and run outside the JavaScript thread. This works for database queries, external API calls or file operations. So it will not do always run all actions in parallel.

The limit depends on the OS, but like @Apple already says I wouldn’t do to much parallel.

2 Likes