From 02f129b1bb1fc17f17b2fbca43bd997aa8b28d09 Mon Sep 17 00:00:00 2001 From: Amy Fong Date: Fri, 28 Mar 2014 15:58:45 -0400 Subject: Memory leak from timings Memory leak happens when the dynamic list times grows without anything to reset it. In ceilometer and cinder configuration files, the new option is created: [nova_client] max_timing_buffer= In all clients found that uses extends the HTTPClient and uses the times list, we limit the size of the list by popping off the oldest item in the list to maintain a maximum size. A default size of 200 is chosen, configurable by the above configuration option. Signed-off-by: Amy Fong Signed-off-by: Bruce Ashfield --- .../python/python-cinder/cinder.conf | 3 +++ .../python-cinder/fix_cinder_memory_leak.patch | 28 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 meta-openstack/recipes-devtools/python/python-cinder/fix_cinder_memory_leak.patch (limited to 'meta-openstack/recipes-devtools/python/python-cinder') diff --git a/meta-openstack/recipes-devtools/python/python-cinder/cinder.conf b/meta-openstack/recipes-devtools/python/python-cinder/cinder.conf index fff6910..99a0fc7 100644 --- a/meta-openstack/recipes-devtools/python/python-cinder/cinder.conf +++ b/meta-openstack/recipes-devtools/python/python-cinder/cinder.conf @@ -1218,3 +1218,6 @@ rbd_user=cinder-volume volume_backend_name=RBD_CEPH # Total option count: 255 + +# [nova_client] +# max_timing_buffer=100 diff --git a/meta-openstack/recipes-devtools/python/python-cinder/fix_cinder_memory_leak.patch b/meta-openstack/recipes-devtools/python/python-cinder/fix_cinder_memory_leak.patch new file mode 100644 index 0000000..2566531 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-cinder/fix_cinder_memory_leak.patch @@ -0,0 +1,28 @@ +--- + cinder/compute/nova.py | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/cinder/compute/nova.py ++++ b/cinder/compute/nova.py +@@ -57,6 +57,13 @@ + CONF = cfg.CONF + CONF.register_opts(nova_opts) + ++nova_client_opts = [ ++ cfg.IntOpt('max_timing_buffer', ++ default=200, ++ help='The max number of the timing objects to keep'), ++] ++cfg.CONF.register_opts(nova_client_opts, group="nova_client") ++ + LOG = logging.getLogger(__name__) + + +@@ -106,6 +113,7 @@ + insecure=CONF.nova_api_insecure, + cacert=CONF.nova_ca_certificates_file, + extensions=extensions) ++ c.set_timings_max_len(cfg.CONF.nova_client.max_timing_buffer) + # noauth extracts user_id:project_id from auth_token + c.client.auth_token = context.auth_token or '%s:%s' % (context.user_id, + context.project_id) -- cgit v1.2.3-54-g00ecf