Hacker News new | ask | show | jobs
by yjgyhj 3325 days ago
I have been working on a Clojure (so JVM) program that I run in Docker for Mac.

It requires some data on disk, which is about 100GB. Since my laptop has a pathetic 250GB SSD I got an external drive for this. All well.

But I get the problem that the Mac shuts down after doing IO from inside the VM for about 10-20 minutes. Just a black screen and a second later reboot.

Has anyone on this forum had the same issue? I have the same when running in VirtualBox, and after wiping the Mac totally and reinstalling the OS. Happens using both USB and Thunderbolt.

3 comments

Docker for mac has absolutely dreadful filesystem performance for mounted volumes (Docker toolbox with the extra virtualbox indirection actually ends up being faster if you're doing filesystem reads even remotely frequently). If you need to work with 100GB on disk you're going to have a lot of problems.

https://github.com/docker/for-mac/issues/77

For this reason I went out to buy a Intel NUC and am now running NixOS on there. Developing on that machine, with a Clojure nRepl connected via SSH. Works great, especially since my service can now be running and fetching data from the internet when my laptop is closed, so that next time I work I don't have to wait for my service to catch up with the world.
Out of curiosity, what are some reasons to run the Clojure program inside of docker? Could you bypass the issue by just running it locally?
I do so because my Clojure app I'm writing also depends on other programs from 3rd party vendors (open source stuff). I'm too old to spend time setting shit up on every develop machine, server etc. If I can just write one declarative file (docker-compose.yml) and then be done that's nice, so that is what I do.

Deploying on Linux anyways, so Docker isn't a performance overhead.

> It requires some data on disk, which is about 100GB

As someone who develops on a Macbook with a 128 GB drive, this is completely crazy to me. How is it taking up 100 GB? I use Docker for Mac for most of my day-to-day development, mostly for running docker-compose environments so I have separated Redis/Postgres environments for each app. They take up nowhere near 100 GB. Something sounds very wrong, but I can't imagine how it would be caused by the JVM running Clojure.

> Something sounds very wrong

How can it be wrong to simply have 100 GB of data that you need to operate on? If that's how much data you have then that's how much you have.

Sometimes applications have to read and process data from the filesystem. I have several ~100gb datasets 9f large amounts of sensor data.
> How is it taking up 100 GB?

A couple of blockchains. As said, it's the data of my app, not Clojure or Docker.

Oh, I read it as "Yeah it takes up some space on my drive, like 100 GB". Having it as actual data the program is processing makes way more sense, sorry about that.
it sounds like OP's program reads some dataset, and it is 100GB in size.