[server] use a LifoQueue in _CnxSetPool draft
authorPhilippe Pepiot <ph@itsalwaysdns.eu>
Mon, 30 Mar 2020 15:30:02 +0200
changeset 12961 01810941a4be
parent 12960 2c3a8a4f5a02
child 12962 fa0cd558d829
[server] use a LifoQueue in _CnxSetPool In postgresql, some cache is attached to the connection. Using a LifoQueue (last-in, first-out) makes a few connections to get the most load which give best performance.
cubicweb/server/repository.py
--- a/cubicweb/server/repository.py	Mon Mar 30 15:23:56 2020 +0200
+++ b/cubicweb/server/repository.py	Mon Mar 30 15:30:02 2020 +0200
@@ -173,7 +173,7 @@
     def __init__(self, source, size):
         super().__init__(source)
         self._cnxsets = []
-        self._queue = queue.Queue()
+        self._queue = queue.LifoQueue()
 
         for i in range(size):
             self._queue.put_nowait(self._new_cnxset())