summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-09-07 16:45:48 +0100
committerMark Haines <mark.haines@matrix.org>2015-09-07 16:45:48 +0100
commit9e4dacd5e7e560bae614ddf390a9f02c2c19a25d (patch)
tree0f4291d18f1a884cbfdeae5d9e0229f3337c3262 /synapse
parentMerge branch 'master' into develop (diff)
downloadsynapse-9e4dacd5e7e560bae614ddf390a9f02c2c19a25d.tar.xz
The maxrss reported by getrusage is in kilobytes, not pages
Diffstat (limited to 'synapse')
-rw-r--r--synapse/metrics/__init__.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/synapse/metrics/__init__.py b/synapse/metrics/__init__.py
index d7bcad8a8a..3f7b7158aa 100644
--- a/synapse/metrics/__init__.py
+++ b/synapse/metrics/__init__.py
@@ -17,7 +17,7 @@
 from __future__ import absolute_import
 
 import logging
-from resource import getrusage, getpagesize, RUSAGE_SELF
+from resource import getrusage, RUSAGE_SELF
 import functools
 import os
 import stat
@@ -100,7 +100,6 @@ def render_all():
 # process resource usage
 
 rusage = None
-PAGE_SIZE = getpagesize()
 
 
 def update_resource_metrics():
@@ -113,8 +112,8 @@ resource_metrics = get_metrics_for("process.resource")
 resource_metrics.register_callback("utime", lambda: rusage.ru_utime * 1000)
 resource_metrics.register_callback("stime", lambda: rusage.ru_stime * 1000)
 
-# pages
-resource_metrics.register_callback("maxrss", lambda: rusage.ru_maxrss * PAGE_SIZE)
+# kilobytes
+resource_metrics.register_callback("maxrss", lambda: rusage.ru_maxrss * 1024)
 
 TYPES = {
     stat.S_IFSOCK: "SOCK",