#[RESOLVED] Mystery disk write

1 messages ยท Page 1 of 1 (latest)

humble pine
#

Hey all,
I'm running in a weird issue that is almost definitely my own fault.

I have an echo golang project with swaggo. From what I can tell from the attached screenshot most of my layers are cached.

But on the layer that starts the server there's a 200 mb disk write. The built bin of the server is about 11mb.

I'm not sure how to investigate this issue further. Any guidance on what I should do to hunt this down would be much appreciated

slender marlin
#

Hi @humble pine ๐Ÿ‘‹
I wonder if Echo is doing some logging to local disk (inside the container) that accounts for the writes?

I grabbed this example https://docs.dagger.io/api/services/#bind-services-in-functions and changed the args to AsService like this:

AsService(dagger.ContainerAsServiceOpts{Args: []string{"bash", "-c", "python -m http.server 8080 > server.log 2>&1"}})

Then in another window:

while true; do
curl http://localhost:8080
done

I see my Disk Write: number going up steadily but slowly from 1.9 MB to 2.7 MB over a couple of minutes.

When I used the previous invocation without logging, I didn't see that number move.
AsService(dagger.ContainerAsServiceOpts{Args: []string{"python", "-m", "http.server", "8080"}})

Dagger Functions support service containers, enabling users to spin up additional long-running services (as containers) and communicate with those services from Dagger Functions.

brisk totem
#

love seeing people find unexpected behavior the new telemetry ๐Ÿ™‚

humble pine
#

@slender marlin Thanks for the response. I think I may have found where it's coming from. It's the go build cache that I'm seeing because I'm starting the container with go run . . Fixed it by building before entrypoint so it gets cachced properly.

But for future explorers I found this using ncdu to by just running it before and after the regular entry point

humble pine