Roundup Tracker - Issues

Message7059

Author tttech-klonner
Recipients tttech-klonner
Date 2021-02-02.14:45:21
Message-id <1612277121.45.0.147538139226.issue2551112@roundup.psfhosted.org>
In-reply-to
As discussed with Ralf Schlatterbeck we should add the tracker 
initialization to the init function of the class RoundupDispatcher. 
Otherwise compilation of TAL templates and loading of python modules 
and libraries happends during the first request to Roundup.

This issue poped up during experimentation with pre-loading and lazy 
loading of WSGI processes with Apache. With this patch the request time 
for a rest api call from the first request dropped down from 2 seconds 
to 450ms.

diff --git a/roundup/cgi/wsgi_handler.py b/roundup/cgi/wsgi_handler.py
index 767221ac..ef4547a1 100644
--- a/roundup/cgi/wsgi_handler.py
+++ b/roundup/cgi/wsgi_handler.py
@@ -84,6 +84,9 @@ class RequestDispatcher(object):
                 tracker_home=home)
         else:
             self.translator = None
+        # trigger pre-loading of imports and templates
+        with self.get_tracker():
+            pass
 
     def __call__(self, environ, start_response):
         """Initialize with `apache.Request` object"""
History
Date User Action Args
2021-02-02 14:45:21tttech-klonnersetrecipients: + tttech-klonner
2021-02-02 14:45:21tttech-klonnersetmessageid: <1612277121.45.0.147538139226.issue2551112@roundup.psfhosted.org>
2021-02-02 14:45:21tttech-klonnerlinkissue2551112 messages
2021-02-02 14:45:21tttech-klonnercreate