Fork me on GitHub
#onyx
<
2018-06-12
>
lmergen07:06:31

on that note, do people run the aeron driver in a separate docker container, or on a different process within the same container ?

lmergen07:06:42

https://github.com/onyx-platform/onyx-template/tree/0.13.x/src/leiningen/new/onyx_app runs it as a separate process within the same container, but i am not sure whether that's the best practice.. ?

chrisblom11:06:23

we run it in the same container, i’ve tried running it in a separate container but ran into issues

chrisblom11:06:32

i don’t remember the specifics though

mccraigmccraig12:06:39

@lmergen separate process in the same container, using https://github.com/just-containers/s6-overlay

👍 4
lmergen12:06:25

@mccraigmccraig first time i'm seeing s6, looks great!

mccraigmccraig12:06:10

from the comments in my onyx peer Dockerfile it was originally from @gardnervickers ... i'm guessing there is an onyx example Dockerfile somewhere ?

Travis12:06:04

I have done it both ways, in the same container and a separate container in a pod

gardnervickers14:06:37

It’s recommended that you run a single process per docker container. For the Peer/MediaDriver case, you want to setup communication over shared memory (`/dev/shm`).

gardnervickers14:06:25

S6 is just a process monitor from what I recall to make sure child processes are correctly reaped.

gardnervickers14:06:00

Back when those scripts were created it wasn’t easy/possible to spawn two containers with shared memory between them but now the examples would be much better served by using /dev/shm on the host and mounting it in two separate containers.

lmergen14:06:43

so that would probably mean creating a tmpfs volume in docker and sharing it between multiple containers ?

lmergen14:06:53

(that's what i was thinking about)

lmergen14:06:57

and mounting it to /dev/shm

gardnervickers14:06:10

Yea that would be even better

lmergen14:06:03

because that would also get rid of the whole --shm_size issue afaict

gardnervickers14:06:43

It also more directly maps to docker orchestrator abstractions like Kubernetes "Memory" volumes

lmergen14:06:11

what about performance ? i assume it doesn't suffer ?

lmergen14:06:38

intuitively you would think there's a performance hit, but i can't think of any

gardnervickers14:06:04

If any I doubt it’s enough to notice

lmergen14:06:24

i just read on the docs that you cannot share a tmpfs volume between docker containers

gardnervickers14:06:18

Alright yea then just mounting the hosts /dev/shm should be fine