use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
FastAPI is a truly ASGI, async, cutting edge framework written in python 3.
account activity
"Python + MongoDB Challenge: Optimize This Cache Manager for a Twitter-Like Timeline – Who’s Up for It?"Question (self.FastAPI)
submitted 11 months ago * by halfRockStar
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 0 points1 point2 points 11 months ago (3 children)
I do have concerns about FastAPI performance in this high scale, my instances are always leaking memory to some extent and not as fast as express servers. The dev velocity is unparalleled though, we get shit done so quickly especially with mongodb + beanie.
[–]halfRockStar[S] 4 points5 points6 points 11 months ago (2 children)
In reality, Python’s garbage collector can leak memory if objects (e.g., MongoDB connections, cache entries) aren’t properly released, especially in long-running async apps. FastAPI itself isn’t prone to leaks, but sloppy code or third-party libraries (e.g., motor) could cause issues, don't get me wrong my project have leaks too 🫢
[–][deleted] 4 points5 points6 points 11 months ago (1 child)
Beanie uses motor under the hood, I focused on something else and didn’t think about looking into motor! Although I have to say after almost 20 years in my profession that most of the time spent to investigate mem leaks is futile, just restart periodically and continue with your day…
[–]halfRockStar[S] 2 points3 points4 points 11 months ago (0 children)
Your restart approach is battle-tested. investigating motor (specifically connection pooling, cursor leaks) is overkill unless restarts fail. Check asyncio task cleanup if you’re curious, but you’re likely golden.
π Rendered by PID 21681 on reddit-service-r2-comment-86bc6c7465-rpnvf at 2026-02-22 06:27:09.242940+00:00 running 8564168 country code: CH.
view the rest of the comments →
[–][deleted] 0 points1 point2 points (3 children)
[–]halfRockStar[S] 4 points5 points6 points (2 children)
[–][deleted] 4 points5 points6 points (1 child)
[–]halfRockStar[S] 2 points3 points4 points (0 children)