summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-cinder
diff options
context:
space:
mode:
authorAmy Fong <amy.fong@windriver.com>2014-03-28 15:58:45 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-03-31 13:14:49 -0400
commit02f129b1bb1fc17f17b2fbca43bd997aa8b28d09 (patch)
treea125ec774f2054684ddd364aeb6caceb8c1bf637 /meta-openstack/recipes-devtools/python/python-cinder
parent984c2d69f51824a4c1e7b3a448fe24759e594026 (diff)
downloadmeta-cloud-services-02f129b1bb1fc17f17b2fbca43bd997aa8b28d09.tar.gz
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=<value> 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 <amy.fong@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-cinder')
-rw-r--r--meta-openstack/recipes-devtools/python/python-cinder/cinder.conf3
-rw-r--r--meta-openstack/recipes-devtools/python/python-cinder/fix_cinder_memory_leak.patch28
2 files changed, 31 insertions, 0 deletions
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
1218volume_backend_name=RBD_CEPH 1218volume_backend_name=RBD_CEPH
1219 1219
1220# Total option count: 255 1220# Total option count: 255
1221
1222# [nova_client]
1223# 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 @@
1---
2 cinder/compute/nova.py | 8 ++++++++
3 1 file changed, 8 insertions(+)
4
5--- a/cinder/compute/nova.py
6+++ b/cinder/compute/nova.py
7@@ -57,6 +57,13 @@
8 CONF = cfg.CONF
9 CONF.register_opts(nova_opts)
10
11+nova_client_opts = [
12+ cfg.IntOpt('max_timing_buffer',
13+ default=200,
14+ help='The max number of the timing objects to keep'),
15+]
16+cfg.CONF.register_opts(nova_client_opts, group="nova_client")
17+
18 LOG = logging.getLogger(__name__)
19
20
21@@ -106,6 +113,7 @@
22 insecure=CONF.nova_api_insecure,
23 cacert=CONF.nova_ca_certificates_file,
24 extensions=extensions)
25+ c.set_timings_max_len(cfg.CONF.nova_client.max_timing_buffer)
26 # noauth extracts user_id:project_id from auth_token
27 c.client.auth_token = context.auth_token or '%s:%s' % (context.user_id,
28 context.project_id)