Skip to content

Excessive RAM consumption #3733

Answered by bernejorge
bernejorge asked this question in Q&A
Discussion options

You must be logged in to vote

I detected that graphs are added to a pool, but never removed, except when the prediction is aborted. The pool accumulates the chatflow by session id. Furthermore, this pool is not used as a cache since the nodes need to be reprocessed for each request to resolve the interpolated variables with double braces{{ }}.
Also, rebuilding the graph for each request takes a lot of memory and CPU resources


I solved the problem by creating a cache and forgoing using variable interpolation with double braces that must be resolved before creating the langgraph node and using state variables instead.
I did stress testing and it is now working in production.
So far so good.


Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@bernejorge
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by bernejorge
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants