Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to set TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES #2103

Merged
merged 1 commit into from Oct 25, 2017

Conversation

andymcc
Copy link
Contributor

@andymcc andymcc commented Oct 25, 2017

Use "ceph_tcmalloc_max_total_thread_cache" to set the
TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES value inside /etc/default/ceph for
Debian installs, or /etc/sysconfig/ceph for Red Hat/CentOS installs.

By default this is not set, so the default package value will be used,
if specified this value will be changed to match the variable, and ceph
services will be restarted.

line: "TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES={{ ceph_tcmalloc_max_total_thread_cache }}"
when:
- etc_default_ceph.stat.exists
- ansible_os_family == 'Debian'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably easier if you move the Debian condition above.

@@ -452,6 +452,9 @@ os_tuning_params:
- { name: vm.swappiness, value: 10 }
- { name: vm.min_free_kbytes, value: "{{ vm_min_free_kbytes }}" }

# For Debian & Red Hat/CentOS installs set TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES
#ceph_tcmalloc_max_total_thread_cache: 134217728
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please uncomment it otherwise the tasks above will fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d'oh - of course, initially i had wanted to use the package defaults - which arent necessarily 128MB - will fix.

include: configure_memory_allocator.yml
when:
- (ceph_origin == 'repository' or ceph_origin == 'distro')
- ceph_tcmalloc_max_total_thread_cache is defined
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, we need a condition on filestore only osd_objectstore: filestore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does bluestore not use tcmalloc? I thought it did - I havn't messed about with it to confirm - easy enough to fix this, just wanted to confirm.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, please leave it only for filestore.

- ansible_os_family == 'Debian'
notify:
- restart ceph mons
- restart ceph osds
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's restart the OSDs only since this is only affecting OSDs

Copy link
Member

@leseb leseb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also edit the container template like here: https://github.com/ceph/ceph-ansible/blob/master/roles/ceph-osd/templates/ceph-osd-run.sh.j2#L64 to add -e TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES={{ ceph_tcmalloc_max_total_thread_cache }}. Thanks!

Again only on filestore.

@andymcc
Copy link
Contributor Author

andymcc commented Oct 25, 2017

Fixed those up.

1 note, I used a default of 0 (which will basically mean it gets skipped) - I'm trying to avoid a situation where existing clusters (on upgrades) run this and have their osds restarted for no reason, or worse they have tuned that value to a different setting and it gets force changed, and osds restarted - happy to change that but I'd rather not cause impact to running/existing clusters without the deployer/operator making a distinct choice (e.g. setting the var to non-default value).

@@ -62,6 +62,9 @@ expose_partitions "$1"
{% endif -%}
-e CLUSTER={{ cluster }} \
-e OSD_DEVICE=/dev/${1} \
{% if (ceph_tcmalloc_max_total_thread_cache | int) > 0 -%}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and osd_objectstore == 'filestore'

Use "ceph_tcmalloc_max_total_thread_cache" to set the
TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES value inside /etc/default/ceph for
Debian installs, or /etc/sysconfig/ceph for Red Hat/CentOS installs.

By default this is set to 0, so the default package value will be used,
if specified this value will be changed to match the variable, and ceph
osd services will be restarted.
@andymcc
Copy link
Contributor Author

andymcc commented Oct 25, 2017

one of these days ;)

@leseb leseb merged commit 5f9e50d into ceph:master Oct 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants