okay, I shouldn't trust my feelings too much. I compared some startup times with and without the late binding change, and must admit that they look very similar. However, I believe that the late binding is a good thing for our load balanced setup - I don't want users to get blank pages only because zope opens a port while still not ready to handle it. Here is a improved patch which does the late binding only if there is no port <= 1024 configured:
Index: __init__.py
===================================================================
--- __init__.py (revision 30421)
+++ __init__.py (working copy)
@@ -86,10 +86,14 @@ self.setupLocale() self.setupSecurityOptions() self.setupPublisher()
- # Start ZServer servers before we drop privileges so we can bind to
- # "low" ports: self.setupZServer()
- self.setupServers()
+ self.setBindEarly()
+
+ if self.bind_early:
+ # Start ZServer servers before we drop privileges so we can bind to
+ # "low" ports:
+ self.setupServers()
+
# drop privileges after setting up servers self.dropPrivileges() self.makeLockFile()
@@ -100,6 +104,10 @@
# emit a "ready" message in order to prevent the kinds of emails
# to the Zope maillist in which people claim that Zope has "frozen"
# after it has emitted ZServer messages.
+
+ if not self.bind_early:
+ self.setupServers()
+ logger.info('Ready to handle requests') self.setupFinalLogging()
okay, I shouldn't trust my feelings too much. I compared some startup times with and without the late binding change, and must admit that they look very similar. However, I believe that the late binding is a good thing for our load balanced setup - I don't want users to get blank pages only because zope opens a port while still not ready to handle it. Here is a improved patch which does the late binding only if there is no port <= 1024 configured:
Index: __init__.py ======= ======= ======= ======= ======= ======= ======= ======= ====
self. setupLocale( )
self. setupSecurityOp tions()
self. setupPublisher( )
self. setupZServer( )
self. dropPrivileges( )
self. makeLockFile( )
logger. info('Ready to handle requests')
self. setupFinalLoggi ng()
=======
--- __init__.py (revision 30421)
+++ __init__.py (working copy)
@@ -86,10 +86,14 @@
- # Start ZServer servers before we drop privileges so we can bind to
- # "low" ports:
- self.setupServers()
+ self.setBindEarly()
+
+ if self.bind_early:
+ # Start ZServer servers before we drop privileges so we can bind to
+ # "low" ports:
+ self.setupServers()
+
# drop privileges after setting up servers
@@ -100,6 +104,10 @@
# emit a "ready" message in order to prevent the kinds of emails
# to the Zope maillist in which people claim that Zope has "frozen"
# after it has emitted ZServer messages.
+
+ if not self.bind_early:
+ self.setupServers()
+
@@ -208,6 +216,13 @@
% (server. servertype( ),e[1]) )
self. cfg.servers = servers
+ def setBindEarly(self): self): self.cfg)
+ self.bind_early = False
+ for server in self.cfg.servers:
+ if server.port <= 1024:
+ self.bind_early = True
+ return self.bind_early
+
def dropPrivileges(
return dropPrivileges(
Cheers, Sascha