sumanth balaji
sumanth balaji7mo ago

DB connections aren’t reused when self hosting Langfuse

on further inspection, this sharp increase of db connections from langfuse instance has occured in the past too. Only now have we realised the issue due to error logs
No description
11 Replies
Marc
Marc7mo ago
We’re investigating Thanks for the additional details, that helps Do you run a single instance of Langfuse?
sumanth balaji
sumanth balaji7mo ago
yes single instance running the docker file using AWS ECS. just one task
Marc
Marc7mo ago
Ok perfect
sumanth balaji
sumanth balaji7mo ago
Please update when you can if you are able to find the fix/recreate it. Thank you for the help
Marc
Marc7mo ago
Yes. Will do
Max
Max7mo ago
Sumanth, can you extend the history of the graph by any chance? Would be interesting to see whether we introduced this somewhere accidentially @sumanth balaji
sumanth balaji
sumanth balaji7mo ago
No description
sumanth balaji
sumanth balaji7mo ago
any luck ? @Max on further analysis, this issue seems to arise from LiteLLM proxy layer. I have informed the maintainer, shall coordinate with them to resolve this. Did further testing and seems to not be a problem caused by langfuse
Marc
Marc7mo ago
We tried a lot of things and weren’t yet able to reproduce Will keep trying to make sure Langfuse is safe in this regard
sumanth balaji
sumanth balaji7mo ago
LiteLLM has pushed a release for this bug following are the details Okay the error you were seeing is fixed here: https://github.com/BerriAI/litellm/pull/2363 - It only occurs when there is a fallback - It was caused because the metadata field had a previous_models field which had a circular ref - Pr fixes this error for Langfuse logging + using LiteLLM DB How we'll prevent this in the future - Adding testing to ensure we can run json.dumps() on the callbacks metadata field Thank you to the people at langfuse for looking into the issue
GitHub
(Fix) High Traffic Fix - handle litellm circular ref error by ishaa...
Proxy - High Traffic Fix When a fallback occurs Prisma + Langfuse hit circular ref errors This leads to Prisma retrying each request 5 times User hits Prisma DB limits
Marc
Marc7mo ago
Perfect, thanks for sharing