1

想问 linux 大师 Chronicle 是否可以在一台主机上的 docker 容器之间共享状态(被使用)。只是一个假设:由于 Chronicle 使用内存映射文件,我们可以在容器之间共享(可能?)同一个主机的文件系统,我们可以使用 ChronicleMap 功能吗?虽然不确定容器间同步......有人有什么想法吗?

4

2 回答 2

1

I feel weird saying Peter Lawery is wrong, and perhaps it wasn't supported in 2015, but chronicle map works fine in docker. As long as you mount the directory on the host of your persisted map into the containers.

One thing to note, the memory limit of the docker container needs to be higher than the Xmx of a regular JVM for the same chronicle map.

From this post:

Note: file and shmem may be shared among other cgroups. In that case, mapped_file is accounted only when the memory cgroup is owner of page cache.

We found that filling the map was extremely slow (500x slower) if the memory limit of the container wasn't high enough for the whole off heap map. iostat would imply chronicle maybe has to read large portions of the file to page in a portion of it?

于 2020-10-25T19:37:44.067 回答
1

不支持 Docker,但理论上它可以提供。

因为 Chronicle 使用内存映射文件,我们可以在容器之间共享(可能?)同一个主机的文件系统,我们可能可以使用 ChronicleMap 功能?

它们必须在同一台物理机器上。机器之间的共享需要复制。

虽然不确定容器间同步......有人有什么想法吗?

如果支持,我会先使用复制并切换到单个副本。

于 2015-08-16T15:28:48.720 回答