[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit b18c46772c21ef643e06d61809b448302057a102
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
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)
 

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits