This is a discussion on Newbie: Check for overloaded connections within the alt.comp.mail.qmail forums, part of the Mail Servers and Related category; ****Newbie Alert**** Hello All: Is there any way to check for overloaded connections in qmail. I have a python script ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
****Newbie Alert****
Hello All: Is there any way to check for overloaded connections in qmail. I have a python script that checks specified services before starting a related service. This one hangs when a check is being made to see if something is running at port 25. MY assumption is that since the connections are already exhausted, the new request for getting a connection is also placed in a queue and it gets into a deadlock. The code to check for connections is try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM); s.connect("localhost",25); s.close() except socket.error: #Do something Thisone hangs at s.connect if there are overloaded connections. IS there a good way to find out such a situation. TIA Raj |
|
|||
|
raja0576@yahoo.com (Raja) writes:
> Is there any way to check for overloaded connections in qmail. I have > a python script that checks specified services before starting a > related service. This one hangs when a check is being made to see if > something is running at port 25. MY assumption is that since the > connections are already exhausted, the new request for getting a > connection is also placed in a queue and it gets into a deadlock. If you exceed the tcpserver connection limit, further connections will block until an active connection closes and frees up a slot. Sounds to me like you've already found a way to detect this situation remotely...try to connect. On the local system, you can check tcpserver's log, assuming it's run with the -v option, to see how many connections are active. E.g.: @40000000402d2d830d95786c tcpserver: status: 4/20 shows that there are four active connections and a limit of 20 connections. -- Dave Sill Oak Ridge National Lab, Workstation Support Author, The qmail Handbook <http://web.infoave.net/~dsill> <http://lifewithqmail.org/>: Almost everything you always wanted to know. |
|
|||
|
Thanks for the response. I have 5 max connections and was able to
create a script that would block all the 5 connections. Now as you said, when i do connect with more clients, the connect call does go through. How can this happen? Shouldnt the connect call block and not return? This is my test python script try: timeoutsocket.setDefaultSocketTimeout(10) s = timeoutsocket.timeoutsocket(timeoutsocket.AF_INET, timeoutsocket.SOCK_STREAM) s.connect(("localhost", 25)) s.close() except timeoutsocket.Timeout: print "Timedout" when i run this the code just runs through without falling into the Timeout block. Any pointers? Is there any way to block and capture the timeout? Thanks again for ur help Raj Dave Sill <MaxFreedom@sws5.ornl.gov> wrote in message news:<wx0fzdeoife.fsf@sws5.ornl.gov>... > raja0576@yahoo.com (Raja) writes: > > > Is there any way to check for overloaded connections in qmail. I have > > a python script that checks specified services before starting a > > related service. This one hangs when a check is being made to see if > > something is running at port 25. MY assumption is that since the > > connections are already exhausted, the new request for getting a > > connection is also placed in a queue and it gets into a deadlock. > > If you exceed the tcpserver connection limit, further connections will > block until an active connection closes and frees up a slot. Sounds to > me like you've already found a way to detect this situation > remotely...try to connect. On the local system, you can check > tcpserver's log, assuming it's run with the -v option, to see how many > connections are active. E.g.: > > @40000000402d2d830d95786c tcpserver: status: 4/20 > > shows that there are four active connections and a limit of 20 > connections. |