Comments (8)
To address the issue of the Langflow UI getting stuck on the loading page while running multiple flows, you can try the following steps to optimize performance:
-
Increase Worker Processes: Increase the number of worker processes to handle multiple flows concurrently.
langflow run --workers 4
Or set the
LANGFLOW_WORKERS
environment variable:export LANGFLOW_WORKERS=4
-
Use In-Memory Cache: Switch to using an in-memory cache for better performance.
langflow run --cache InMemoryCache
Or set the
LANGFLOW_LANGCHAIN_CACHE
environment variable:export LANGFLOW_LANGCHAIN_CACHE=InMemoryCache
-
Adjust Worker Timeout: Increase the worker timeout to ensure that processes have enough time to complete.
langflow run --timeout 120
-
Enable Logging: Set the logging level to monitor performance issues and identify potential bottlenecks.
langflow run --log-level info
Or set the
LANGFLOW_LOG_LEVEL
environment variable:export LANGFLOW_LOG_LEVEL=info
Additionally, consider upgrading to a version of Langflow after 1.0.5, as there have been performance improvements and bug fixes related to running multiple flows in subsequent versions [1].
Example command to run Langflow with optimized settings:
langflow run --workers 4 --cache InMemoryCache --timeout 120 --log-level info
These steps should help mitigate the issue of the UI getting stuck on the loading page when running multiple flows.
To continue talking to Dosu, mention @dosu.
from langflow.
Yes, you can configure these settings in the .env
file. After making these configurations, you need to restart Langflow for the changes to take effect.
Here are the relevant environment variables you can set in the .env
file:
# Worker processes
LANGFLOW_WORKERS=4
# Cache type
LANGFLOW_LANGCHAIN_CACHE=InMemoryCache
# Worker timeout in seconds
LANGFLOW_TIMEOUT=120
# Logging level
LANGFLOW_LOG_LEVEL=info
After updating the .env
file, restart Langflow to apply the changes [1][2][3].
To continue talking to Dosu, mention @dosu.
from langflow.
Yes, you can configure these settings in the .env
file. After making these configurations, you need to restart Langflow for the changes to take effect.
Here are the relevant environment variables you can set in the .env
file:
# Worker processes
LANGFLOW_WORKERS=4
# Cache type
LANGFLOW_LANGCHAIN_CACHE=InMemoryCache
# Worker timeout in seconds
LANGFLOW_TIMEOUT=120
# Logging level
LANGFLOW_LOG_LEVEL=info
After updating the .env
file, restart Langflow to apply the changes [1][2][3].
To continue talking to Dosu, mention @dosu.
from langflow.
Yes, the use of SQLite could be causing the issue where you can't run multiple flows in parallel in Langflow. SQLite has limitations with concurrent write operations, which can lead to database locks and prevent parallel execution of flows.
A potential solution is to switch to a more robust database system that supports better concurrency, such as PostgreSQL or MySQL. This would allow multiple flows to run in parallel without encountering the same locking issues.
Here is an example of how you might configure SQLAlchemy to use PostgreSQL instead of SQLite:
from sqlmodel import SQLModel, create_engine, Session
# Replace the SQLite URL with a PostgreSQL URL
DATABASE_URL = "postgresql://user:password@localhost/dbname"
engine = create_engine(DATABASE_URL)
def session_scope():
session = Session(engine)
try:
yield session
finally:
session.close()
# Ensure that your models and session management use the new engine
SQLModel.metadata.create_all(engine)
Additionally, Langflow's DatabaseService
class can be configured to use PostgreSQL:
class DatabaseService(Service):
name = "database_service"
def __init__(self, settings_service: "SettingsService"):
self.settings_service = settings_service
if settings_service.settings.database_url is None:
raise ValueError("No database URL provided")
self.database_url: str = settings_service.settings.database_url
self.engine = self._create_engine()
def _create_engine(self) -> "Engine":
settings_service = get_settings_service()
connect_args = {}
try:
return create_engine(
self.database_url,
connect_args=connect_args,
pool_size=self.settings_service.settings.pool_size,
max_overflow=self.settings_service.settings.max_overflow,
)
except sa.exc.NoSuchModuleError as exc:
if "postgres" in str(exc) and not self.database_url.startswith("postgresql"):
self.database_url = self.database_url.replace("postgres://", "postgresql://")
logger.warning(
"Fixed postgres dialect in database URL. Replacing postgres:// with postgresql://. To avoid this warning, update the database URL."
)
return self._create_engine()
raise RuntimeError("Error creating database engine") from exc
def get_session(self):
with Session(self.engine) as session:
yield session
By configuring the DatabaseService
to use PostgreSQL, you can leverage its better concurrency support to run multiple flows in parallel in Langflow [1][2][3].
To continue talking to Dosu, mention @dosu.
from langflow.
@dosu can i config these in the .env file . Do i need to restart langflow after config?
from langflow.
i still can't run other flow in paralell? is it because of sqlite? is there a solution to this?
from langflow.
Could you please share your flow?
from langflow.
@carlosrcoelho
355_Llama3.1_Demo.json
It's just a LLama 3.1 flow that makes API calls to VLLM. I've been running this flow through the LangFlow backend API three times simultaneously.
from langflow.
Related Issues (20)
- docker langflow ver1.0.15 not working HOT 3
- Cannot delete a flow with message history on Postgresql due to ForeignKeyViolation HOT 3
- Issue: Pydantic Deprecated HOT 2
- Issue: Pydantic - Portainer - Docker Swarm (PydanticDeprecatedSince20) HOT 11
- LANGFLOW_AUTO_SAVE is not work in 1.0.15 HOT 3
- Receba HOT 2
- Ai assistant
- cant connect to tool calling agent HOT 8
- The LLM's response is generator and cannot be pickle HOT 3
- How can I set a variable and use it in other components? HOT 11
- Method Not Allowed While Creating New Users HOT 4
- Authentication Loop HOT 3
- how to add Gemini API models/text-embedding-004 for RAG
- Cannot find file cdk.Dockerfile when using AWS CDK HOT 1
- Can we make TracingService optional, similar to LANGFLOW_DO_NOT_TRACK?
- how to use PythonCodeStructuredTool?? HOT 2
- Remove Langlflow setting/ Langflow Api ("ENABLE_API": false)
- Edge between Component and CrewAIAgentComponent has invalid handles - HELP HOT 1
- Building takes for ever HOT 3
- langflow and vllm/openai api HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from langflow.