Skip to content

Commit

Permalink
src/daemon: enforce ceph-{disk,volume} ulimit
Browse files Browse the repository at this point in the history
The ceph-disk and ceph-volume commands perform badly in container when
using the default max open files ulimit value (1048576).
Setting this to 1024:4096 (soft:hard) solves the performance issue.
Note that it won't by applyied to the ceph-osd process because we
also enforce a specific value.

Signed-off-by: Dimitri Savineau <[email protected]>
(cherry picked from commit 64b9597)
  • Loading branch information
dsavineau committed Oct 30, 2019
1 parent d348339 commit eaea6a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/daemon/osd_scenarios/osd_disk_activate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ function osd_activate {
exit 1
fi

ulimit -Sn 1024
ulimit -Hn 4096

CEPH_DISK_OPTIONS=()

if [[ ${OSD_FILESTORE} -eq 1 ]] && [[ ${OSD_DMCRYPT} -eq 0 ]]; then
Expand Down
3 changes: 3 additions & 0 deletions src/daemon/osd_scenarios/osd_volume_activate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ set -e
function osd_volume_activate {
: "${OSD_ID:?Give me an OSD ID to activate, eg: -e OSD_ID=0}"

ulimit -Sn 1024
ulimit -Hn 4096

CEPH_VOLUME_LIST_JSON="$(ceph-volume lvm list --format json)"

if ! echo "$CEPH_VOLUME_LIST_JSON" | python -c "import sys, json; print(json.load(sys.stdin)[\"$OSD_ID\"])" &> /dev/null; then
Expand Down

0 comments on commit eaea6a2

Please sign in to comment.