Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/Add child processes #111

Merged
merged 1 commit into from
May 18, 2023
Merged

Feature/Add child processes #111

merged 1 commit into from
May 18, 2023

Conversation

HenryHengZJ
Copy link
Contributor

Context: Allow users to run multiple API requests in parallel. https://python.langchain.com/en/latest/modules/agents/agent_executors/examples/async_agent.html

As Flowise is written in NodeJS, and using async await to run prediction, it is equivalent to Python asyncio. So API requests are run in parallel by default. Read more here

To further increase performance, we can use child process from NodeJS to spawn multiple processes, with each process running its own prediction. Read more here

By default, it will use NodeJS main thread to run prediction.
To enable child process mode, go to .env file in packages/server and add this:

EXECUTION_MODE=child

You can also specify timeout to stop the child process:

EXECUTION_TIMEOUT=5000

@chungyau97 chungyau97 self-requested a review May 18, 2023 11:26
@chungyau97 chungyau97 merged commit 0c16bca into main May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants