Re: [XNAT Discussion] Shared memory in Container Service with swarm

13 views
Skip to first unread message

Kelsey, Matt

unread,
Jul 10, 2025, 11:24:36 AM7/10/25
to xnat_di...@googlegroups.com

Hi Dan,

I haven’t used this parameter in a while, but it is implemented in pretty much the same way as you noted for swarm mode in XNAT:

        if (toCreate.shmSize() != null) {

            final Mount tmpfs = new Mount()

                    .withType(MountType.TMPFS)

                    .withTarget("/dev/shm")

                    .withTmpfsOptions(new TmpfsOptions().withSizeBytes(toCreate.shmSize()));

            mounts.add(tmpfs);

 

 

So it should work in Swarm mode. I doubt this is the issue, since you said it was working in non-swarm mode, but the expected XNAT command parameter is “shm-size”, not “shm_size”.

 

Assuming you typed it correctly in your commend and there is an error in our implementation, you might be able to get around the issue by setting the default shm size on your swarm node, e.g.


> cat /etc/docker/daemon.json

{

    "default-shm-size": "4G"

}

 

In the meantime, I’ll investigate further on our end.

 

Thanks,

Matt

 

 

From: xnat_di...@googlegroups.com <xnat_di...@googlegroups.com> on behalf of Daniel Beasley <dgd...@gmail.com>
Date: Thursday, July 10, 2025 at 5:29
AM
To: xnat_discussion <xnat_di...@googlegroups.com>
Subject: [XNAT Discussion] Shared memory in Container Service with swarm

Hi all,

 

The json command has a shm_size option - however this seems to only work when swarm is not enabled. For swarm you would use, for example:

 

      - type: tmpfs
        target: /dev/shm
        tmpfs:
           size: 4096000000 

 

I got a container working without swarm - but that's definitely not ideal.

 

Any ideas?

 

Many thanks,

 

Dan

 

 

 

--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
xnat_discussi...@googlegroups.com.
To view this discussion visit
https://groups.google.com/d/msgid/xnat_discussion/b5fd5cc0-7de9-4f10-8976-fc50dcb68cecn%40googlegroups.com.

 


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

Reply all
Reply to author
Forward
0 new messages