IBM Containers Volumes的性能

时间:2016-03-18 17:04:31

标签: postgresql docker containers ibm-cloud

我正在IBM Containers中运行postgres 9.5数据库。我修改了DockerHub映像,以便它可以使用Containers服务提供的Volumes功能(必须解决与此问题相关的权限问题:Can I change owner of directory that is mounted on volume in IBM containers?)。

然而,我现在看到的表现非常糟糕。例如,这是运行删除新初始化的postgres db(~20MB)的最新输出,但有所不同,但我没有看到任何超过3分钟的内容:

/tmp/vol/pgdata $ time rm -rf *

real    18m 1.38s
user    0m 0.00s
sys 0m 0.25s

我是否可能需要在图像/容器中配置不同的东西才能获得合理的性能?还有其他人在卷上运行数据库吗?

1 个答案:

答案 0 :(得分:2)

检查为该卷下面的文件系统指定的性能。

例如,对于音量'pgdata'执行cf ic volume inspect pgdata,您将获得如下输出:

# cf ic volume inspect pgdata
{
    "fsId": "long-fs-space-uuid-here",
    "hostPath": "/vol/long-fs-space-uuid-here/pgdata",
    "otherSpaceVisibility": [],
    "spaceGuid": "long-fs-space-uuid-here",
    "volName": "pgdata"
}

然后,您可以使用cf ic volume fs-list获取fs对象的列表,这将为您提供如下输出:

# cf ic volume fs-list
Name                          Size   IOPS/GB   Created               State
long-fs-space-uuid-here       20     0.25      2016-03-04 14:44:49   READY

在这种情况下,我的文件系统对象被指定为0.25 IOPS / GB和20GB - 即4 IOPS。对于像db这样的东西,可能最好在新的更快的fs上重新创建它:

cf ic volume fs-create myfastfs 20 4

等待新文件空间显示为READY:

cf ic volume fs-list

然后在更快的fs上重新创建你的音量:

cf ic volume create pgdata myfastfs

相关问题