[tor-commits] [nyx/master] Bump connection cache size

atagar at torproject.org atagar at torproject.org
Sun Sep 24 17:12:43 UTC 2017


commit b18c46772c21ef643e06d61809b448302057a102
Author: Damian Johnson <atagar at torproject.org>
Date:   Sun Sep 24 10:09:36 2017 -0700

    Bump connection cache size
    
    Finally got it! The connection panel's performance relies on heavily reusing
    cached resources. However, on my moderately busy relay I have 2000 connections
    whereas lur_cache's default size is only 250. This caused us to constantly
    evict and recreate resources every five seconds. This change drops the nyx cpu
    usage for me from 28% to 16%.
---
 nyx/panel/connection.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nyx/panel/connection.py b/nyx/panel/connection.py
index 39a99b6..670486c 100644
--- a/nyx/panel/connection.py
+++ b/nyx/panel/connection.py
@@ -82,7 +82,7 @@ CONFIG = conf.config_dict('nyx', {
 
 class Entry(object):
   @staticmethod
-  @lru_cache()
+  @lru_cache(maxsize = 10000)
   def from_connection(connection):
     return ConnectionEntry(connection)
 



More information about the tor-commits mailing list