我可以在swarm中为docker服务设置内存交换吗?

时间:2020-08-06 08:08:02

标签: php docker docker-api

我想通过php从api运行api服务,我想通过任务的内存交换设置内存限制,但是服务创建中没有用于内存交换的选项。

实际上,容器创建有更多选择,而服务创建则没有。

容器创建该服务创建的一些api选项不是:

"HostConfig": {
"Binds": [],
"Links": [],
"Memory": 0,
"MemorySwap": 0,
"MemoryReservation": 0,
"KernelMemory": 0,
"NanoCPUs": 500000,
"CpuPercent": 80,
"CpuShares": 512,
"CpuPeriod": 100000,
"CpuRealtimePeriod": 1000000,
"CpuRealtimeRuntime": 10000,
"CpuQuota": 50000,
"CpusetCpus": "0,1",
"CpusetMems": "0,1",
"MaximumIOps": 0,
"MaximumIOBps": 0,
"BlkioWeight": 300,
"BlkioWeightDevice": [],
"BlkioDeviceReadBps": [],
"BlkioDeviceReadIOps": [],
"BlkioDeviceWriteBps": [],
"BlkioDeviceWriteIOps": [],
"DeviceRequests": [],
"MemorySwappiness": 60,
"OomKillDisable": false,
"OomScoreAdj": 500,
"PidMode": "",
"PidsLimit": 0,
"PortBindings": {},
"PublishAllPorts": false,
"Privileged": false,
"ReadonlyRootfs": false,
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"VolumesFrom": [],
"CapAdd": [],
"CapDrop": [],
"GroupAdd": [],
"RestartPolicy": {},
"AutoRemove": true,
"NetworkMode": "bridge",
"Devices": [ ],
"Ulimits": [],
"LogConfig": {},
"SecurityOpt": [ ],
"StorageOpt": { },
"CgroupParent": "",
"VolumeDriver": "",
"ShmSize": 67108864
},

这些选项我应该怎么做?

0 个答案:

没有答案