I've been running Courier and in the past weeks it started getting time out errors intermittently. I wrote a Python script to test it (runs every minute):
Code:
import poplib, time, urllib, socket, getpass
socket.setdefaulttimeout(30)
from datetime import date
if True:
try:
#print "1/2\n"
o = open('output.txt', 'a')
opener = urllib.FancyURLopener({})
f = opener.open("http://www.myserver.com/up.php")
strn = f.read()
ok = time.strftime("%a %b %d %H:%M:%S %Y") + "- 1/2 Site Status:"+strn+"\n"
o.write(ok)
o.close()
except Exception, er:
pr = time.strftime("%a %b %d %H:%M:%S %Y")+"- 1/2 URL error: "+er+"\n"
o.write(pr)
o.close()
try:
#print "2/2\n"
o = open('output.txt', 'a')
M = poplib.POP3('myserver.com', 110, 30)
M.user('me@myserver.com')
M.pass_('pass')
numMessages = len(M.list()[1])
k = time.strftime("%a %b %d %H:%M:%S %Y")+"- 2/2 POP Okay. Messages: "+str(numMessages)+"\n"
o.write(k)
o.close()
except Exception, e:
prnt = time.strftime("%a %b %d %H:%M:%S %Y")+"- 2/2 (Site Status:"+strn+") POP Error:"+str(e)+"\n"
o.write(prnt)
o.close()
I see things like this:
Code:
Mon May 18 13:48:01 2009- 2/2 POP Okay. Messages: 0
Mon May 18 13:49:01 2009- 1/2 Site Status:okay
Mon May 18 13:49:02 2009- 2/2 POP Okay. Messages: 0
Mon May 18 13:50:01 2009- 1/2 Site Status:okay
Mon May 18 13:50:01 2009- 2/2 POP Okay. Messages: 0
Mon May 18 13:51:02 2009- 1/2 Site Status:okay
Mon May 18 13:51:02 2009- 2/2 POP Okay. Messages: 0
Mon May 18 13:52:02 2009- 1/2 Site Status:okay
Mon May 18 13:52:04 2009- 2/2 POP Okay. Messages: 0
Mon May 18 13:53:09 2009- 1/2 Site Status:okay
Mon May 18 13:53:39 2009- 2/2 (Site Status:okay) POP Error:timed out
Mon May 18 13:54:24 2009- 1/2 Site Status:okay
Mon May 18 13:54:54 2009- 2/2 (Site Status:okay) POP Error:timed out
Mon May 18 13:55:03 2009- 1/2 Site Status:okay
Mon May 18 13:55:33 2009- 2/2 (Site Status:okay) POP Error:timed out
Mon May 18 13:56:06 2009- 1/2 Site Status:okay
Mon May 18 13:56:36 2009- 2/2 (Site Status:okay) POP Error:timed out
Mon May 18 13:57:06 2009- 1/2 Site Status:okay
Mon May 18 13:57:36 2009- 2/2 (Site Status:okay) POP Error:timed out
Mon May 18 13:58:37 2009- 1/2 Site Status:okay
What would be causing this? The logs show that the web server is up and running just fine during these times.
I've submitted a ticket to my support for the server, but they keep saying it's fine (they telnet to it once, it connects and they report it is fine).