Re: [Zope] ClientDisconnected - how to prevent this from showing up?
Dieter Maurer <dieter@handshake.de> on 5/22/04 wrote:
george donnelly wrote at 2004-5-21 19:22 -0500:
I've got a 7-client ZEO cluster. The client machines are Celeron's and the ZEO server is on a dual XEON. All communication is over a private network with a switch in the middle.
Lately I have been getting ClientDisconnected errors more often than I would like. restarting the offending client or the zeo server is a temp solution.
We have had similar problems.
Someone on the list asked whether we have some NAT (Network Address Translation) agent in between. We had... Such NAT agents close connections when unused for some time in order to protect their resources. The timeout of our NAT agent was 30 min.
Our solution: send a keep alive message every 20 min.
i see, thanks. the keep ailve messages, are these nat rules, http requests? something else? I already send an HTTP Options request every second to each of the clients but this does not seem to be doing the trick. I found this email that mentions sending a noop across the client - storage connection. http://mail.zope.org/pipermail/zope-dev/2002-February/015280.html is this something that has to go across zrpc? thanks for your help :) <--> george donnelly ~ http://www.zettai.net/ ~ "Quality Zope Hosting" Shared and Dedicated Zope Hosting ~ Zope Servers ~ Zope Websites Yahoo, AIM: zettainet ~ ICQ: 51907738 ~ Sales (USA): 1-866-967-3669
george donnelly wrote at 2004-5-24 00:05 -0500:
...
Our solution: send a keep alive message every 20 min.
i see, thanks. the keep ailve messages, are these nat rules, http requests? something else?
The are generated like this: from thread import start_new_thread from time import sleep from zLOG import LOG, INFO, PROBLEM, ERROR from sys import exc_info from os import environ from App.config import getConfiguration KeepPeriod= int(environ.get('ZEO_KEEP_ALIVE')) * 60 Storage = getConfiguration().dbtab.getDatabase('/')._storage def keepAlive(): LOG("CustomZODB",INFO,"Keep alive thread started") while 1: sleep(KeepPeriod) if Storage._ready.isSet(): LOG("CustomZODB",INFO,"Sending keep alive message") Storage._lock.acquire() try: try: Storage._server.get_info() LOG("CustomZODB",INFO,"Sent keep alive message") except: LOG("CustomZODB",ERROR,".... failed", error=exc_info()) finally: Storage._lock.release() else: LOG("CustomZODB",PROBLEM,"Connection is down") start_new_thread(keepAlive,()) The code is executed during initialization of one product. -- Dieter
participants (2)
-
Dieter Maurer -
george donnelly