Timing the opening of network ports
Hi, a while ago I realized that I liked the initial opening of network ports immediately on server start. After working on a busy site with ZEO in the summer I wished that this feature would be configurable. There are different scenarios that ask for opening the network ports early or late: Situation 1: You are a developer and restart your server frequently. You want the ports to be open as soon as possible, even if the site takes a while to load, because your browser accepts a reload immediately. If you use tabbed browsing this also notifies you when the server is ready and you can read /. while waiting ... Situation 2: You are have a site with only a single application server (w/ or w/o ZEO) and have to restart your server. You want to minimize proxy errors (via Apache) and connection losses experienced by people visiting your site/using your application. So opening the ports early is good here. Situation 3: You are have a site that uses a ZEO cluster. You have to restart the application servers while people are using the site. As you have a load balancer, there are always some application servers around that can answer the queries. Now you want to open the network ports as late as possible. In the ideal case, when the complete server is ready. This avoids that people's connections go onto a still booting server and have to wait for several seconds which results in a even more loaded queue on the booting server ... Does this sound reasonable to make the behaviour of opening the ports configurable? Does anybody have an idea how hard this would be to do? Cheers, Christian -- gocept gmbh & co. kg - schalaunische str. 6 - 06366 koethen - germany www.gocept.com - ct@gocept.com - phone +49 3496 30 99 112 - fax +49 3496 30 99 118 - zope and plone consulting and development
+1 on the general goals, however I have no idea if it's easy to implement. Florent Christian Theune wrote:
Hi,
a while ago I realized that I liked the initial opening of network ports immediately on server start.
After working on a busy site with ZEO in the summer I wished that this feature would be configurable. There are different scenarios that ask for opening the network ports early or late:
Situation 1:
You are a developer and restart your server frequently. You want the ports to be open as soon as possible, even if the site takes a while to load, because your browser accepts a reload immediately. If you use tabbed browsing this also notifies you when the server is ready and you can read /. while waiting ...
Situation 2:
You are have a site with only a single application server (w/ or w/o ZEO) and have to restart your server. You want to minimize proxy errors (via Apache) and connection losses experienced by people visiting your site/using your application. So opening the ports early is good here.
Situation 3:
You are have a site that uses a ZEO cluster. You have to restart the application servers while people are using the site. As you have a load balancer, there are always some application servers around that can answer the queries. Now you want to open the network ports as late as possible. In the ideal case, when the complete server is ready. This avoids that people's connections go onto a still booting server and have to wait for several seconds which results in a even more loaded queue on the booting server ...
Does this sound reasonable to make the behaviour of opening the ports configurable? Does anybody have an idea how hard this would be to do?
Cheers, Christian
-- Florent Guillaume, Nuxeo (Paris, France) Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com
2005/11/12, Florent Guillaume <fg@nuxeo.com>:
+1 on the general goals, however I have no idea if it's easy to implement.
Does this sound reasonable to make the behaviour of opening the ports configurable? Does anybody have an idea how hard this would be to do?
I was curious and tried it. Sadly the patches are against 2.7.8, but the patches itself are relative small and should be easy to apply. I did not write unittests. I just wanted to invest 5 minutes to see how it can be done, and suddenly could not stop finishing it. If somebody reminds me of it in two or three weeks, I will make patches against current with unit tests. I am not happy with how I implemented the listening delay. patching the listen method to only listen when the configuration says fast_listen is not good. but otherwise I would have to patch the medusa sources itself. If this is feasible I can do it, is medusa maintained here or in another project? To configure it, add a fast_listen False to the <http-server> section in your config. Patrick
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Patrick Gerken wrote:
2005/11/12, Florent Guillaume <fg@nuxeo.com>:
+1 on the general goals, however I have no idea if it's easy to implement.
Does this sound reasonable to make the behaviour of opening the ports configurable? Does anybody have an idea how hard this would be to do?
I was curious and tried it. Sadly the patches are against 2.7.8, but the patches itself are relative small and should be easy to apply. I did not write unittests. I just wanted to invest 5 minutes to see how it can be done, and suddenly could not stop finishing it. If somebody reminds me of it in two or three weeks, I will make patches against current with unit tests.
Wonderful. I've opened a collector issue for this: can you upload your patches there, please: http://www.zope.org/Collectors/Zope/1948
I am not happy with how I implemented the listening delay. patching the listen method to only listen when the configuration says fast_listen is not good. but otherwise I would have to patch the medusa sources itself. If this is feasible I can do it, is medusa maintained here or in another project?
The medusa we use in Zope is the only "live" version I know of; we have made changes to it (a very few) since Sam Rushing quit updating the canonical version.
To configure it, add a fast_listen False to the <http-server> section in your config.
Very nice hack! Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDefNQ+gerLs4ltQ4RAiwKAKCOdXsSW/lDnj+ppVxKsJlZF2NQpQCeLF9O vDXP/k8HfoZM83cM1Kb1WIs= =RFcf -----END PGP SIGNATURE-----
Hi, Am Dienstag, den 15.11.2005, 11:14 +0100 schrieb Patrick Gerken:
To configure it, add a fast_listen False to the <http-server> section in your config.
Just a short note on naming: I'd prefer a more "speaking" nomenclature, e.g.: open_ports [early|late] or early_listen True I don't like both that much. I'll try to find a better name, and I'll look into the patches for Zope 2.8, as I've been the one thinking loudly about it. I should do some work too. Cheers, Christian -- gocept gmbh & co. kg - schalaunische str. 6 - 06366 koethen - germany www.gocept.com - ct@gocept.com - phone +49 3496 30 99 112 - fax +49 3496 30 99 118 - zope and plone consulting and development
participants (4)
-
Christian Theune -
Florent Guillaume -
Patrick Gerken -
Tres Seaver