0

I'm running a postgres 9.5 database in IBM Containers. I modified the DockerHub image so that it will work with the Volumes feature offered by the Containers service (had to work around permissions issues related to this questions: Can I change owner of directory that is mounted on volume in IBM containers?).

However, I'm now seeing very poor performance. For example, here is the latest output of running the removal of a newly initialized postgres db (~20MB), varies but I haven't seen anything faster than 3 minutes:

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

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

Is it possible that I need to configure something different in the image/container to get reasonable performance? Has anybody else had luck running a database on a Volume?

Community
  • 1
  • 1
krsyoung
  • 1,171
  • 1
  • 12
  • 24

1 Answers1

2

Check the performance specified for your filesystem underneath that volume.

For example, for volume 'pgdata' do cf ic volume inspect pgdata, and you'll get output something like:

# 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"
}

You can then get a list of your fs objects with cf ic volume fs-list, which will give you output like:

# 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

In this case, my file system object is specified for 0.25 IOPS/GB and 20GB - i.e. 4 IOPS. For something like a db, probably better to recreate it on a new faster fs:

cf ic volume fs-create myfastfs 20 4

wait for the new file space to show as READY:

cf ic volume fs-list

and then recreate your volume on that faster fs:

cf ic volume create pgdata myfastfs

krsyoung
  • 1,171
  • 1
  • 12
  • 24
N Fritze
  • 431
  • 3
  • 9
  • For the record I can confirm I'm running at the 0.25/IOPS via the output of `cf ic volume fs-list`. Unfortunately I'm having issues with Containers right now so I'm unable to test the proposed solution to increase to 4IOPS. – krsyoung Apr 27 '16 at 01:57
  • I'm marking this as the accepted answer because n-fritze provides the right approach to improving the performance. As a comparison, to initialize a postgres database took ~2hours with the original 0.25IOPS 20GB fie space. Using the 4IOPS 20GB file space makes for a significant improvement to ~5 minutes. Still not usable (takes about 3 seconds on my mac book) but might be helpful for other use cases. – krsyoung Apr 28 '16 at 20:55