2 years ago
It appears as though the V2 runtime is causing an increase in memory usage for my project. I am unsure if this is due to it being a .net project, or if it is something V2 will generally struggle with.
Reference Points from the image are the newest 2 deploys. The first being on V2, and the second on legacy. The spikes in both are due to roll-over issues where the previous deployment didn't exit yet and should be ignored.
Most pressing I think is the almost 100MB difference in initial memory consumption, which is very odd considering this app always has the same initial allocation.
In a previous deployment that I since removed, I also saw the single-instance memory usage grow significantly higher than 200MB, which is the hard limit I set the app to with DOTNET_GCHeapHardLimit.
111 Replies
I have also tested this locally using docker. The initial heap size should be around 100MB, not teetering near 200MB
2 years ago
So for clarity the more left side of the graph is the v2 runtime and the right portion of the graph is the legacy runtime?
2 years ago
are you building with a dockerfile?
2 years ago
are you running it locally with docker or podman?
dotnet 8 deployment with nixpacks currently does not work because the nixpkgs reference is too old
2 years ago
legacy is docker and V2 is podman
2 years ago
so there definitely could be some discrepancies there, but if so, it could be out of railways control
2 years ago
I'll see if I can reproduce, and either way I'll bring this up to the team
Deploying .net applications is a bit iffy anyway, I have to be able to rely on setting the GC heap limits or the app will grow to the container limit
2 years ago
yeah same issue with Java apps too
asp.net uses a GC that pefers allocating ram over doing GC and its currently very stubborn about it
2 years ago
can you use a different GC or am I thinking of a different language?
I have tried setting it to workstation gc and using the new DATAS dynamic gc
this might be a bug i the docker base image though, I saw a few reports indicating this
2 years ago
what's the image based on? I've heard of people having better memory usage just by switching to an alpine image, but that was node so probably not applicable but maybe worth trying?
2 years ago
couldn't hurt, I've seen stranger things be a solution
2 years ago
I'll still be trying to reproduce and will report to the team
2 years ago
haha same difference
2 years ago
legacy and v2 runtime both report the same mem, 499MB on legacy and 496MB on v2

oh speaking of nixpacks, not to hijack the issue but it still installs the preview version of dotnet 8.0 when using the c# provider
2 years ago
yeah that provider along with nixpacks in general needs some love
while I don't mind writing dockerfiles (my day job is as a cloud consultant) nixpacks is one of my favorite features of railway
2 years ago
nixpacks is nice when it works the way you want it to, but it doesn't create the best dockerfiles or the smallest final images, so I've never used it for any of my projects
the dotnet file I am using is utilizing the two-stage-build pattern, so the output docker container is as small as can be
2 years ago
you can do something similar with nixpacks using the final image directive but it's still a pain compared to writing a Dockerfile to do it
true, but for small hacked together weekend projects it is very nice to be able to just deploy them
2 years ago
I agree, hopefully one of these quarters they will set aside some time to nail down some of the outdated providers and the flaws with nixpacks
It would be nice if the nixpkgs ref would get more regular updates. The current snapshot is from september :X
2 years ago
it's quite scary when they update that, we get a wave of build failed help threads
2 years ago
the repo has a bunch of test apps, but it's not enough
I am guessing its a lot of apps that don't specify their target sdk version anywhere?
2 years ago
stuff like that, or I think last time I meant that nixpacks inadvertently dropped support for php 8.0
2 years ago
I can testify to that
2 years ago
that one was because php 8.0 just wasn't a package in the archive version it was updated to
I have quite a few stories from my previous job with a managed hosting company that do e-learning
2 years ago
anyone who wants older versions of php either use a Dockerfile or pin nixpacks to a really old version
Adventures like "no, we can't update to Ubuntu 18.04 because [software] needs [old php version]" 2 months before the EOL of 18.04
2 years ago
the fun world of software development and backend maintenance
2 years ago
that's why I have only done personal projects haha
it would have been fine if my ex-employer didn't also think docker was the plague
2 years ago
sounds costly
just before I left they were starting to pivot to private-clouds using openstack
2 years ago
if only they knew about railway
I heard some rumors that they are now migrating a lot of things to an HA K8S cluster
I'll keep an eye on the memory for a few hours and see if it obeys the GC limit I set now
2 years ago
sounds good, I've sent this thread in a thread I have with the team thats for the v2 dents
fingers crossed, but I think you might be right with this being a podman issue
2 years ago
it might be
2 years ago
I've seen a user report increased network usage on the v2 runtime, but I also couldn't reproduce that
2 years ago
or maybe the v2 runtime now counts shm space as memory
if the ram reporting is done using the runtime's monitoring functions, the reported values could differ depending on implementation too
2 years ago
indeed
2 years ago
shm space is not counted as memory
2 years ago
gotta love alpine
happy to report that the container's ram usage appears to be what it should be now
2 years ago
metrics reporter?
considering the deployment exists, this seems more like a UI issue than a backend issue though
2 years ago
what time is where you are?
Someone should take a look at how my app can be running with no 1h metric available though
2 years ago
your CEST right? can you send a link to your service?
2 years ago
i meant like
2 years ago
!t
2 years ago
This thread has been escalated to the Railway team.
Status changed to Awaiting Railway Response brody • over 1 year ago
2 years ago
can you login in there for good measure?
2 years ago
perfect!
2 years ago
Sorry trying to read through this but unsure exactly where you all landed. Is the issue that in the environment labeled V2, services deployed using the V2 runtime, metrics graphs indicate increased usage? (Similar to the other one we're looking into @ Brody?)
2 years ago
if I understand correctly, memory is fine now, but the graphs have the date scale wrong
Status changed to Solved Railway • over 1 year ago
2 years ago
This thread has been marked as solved automatically due to a lack of recent activity. Please open a new thread if you require further assistance. Thank you!

