Newbie: Check for overloaded connections

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 ...


Go Back   Usenet Forums > Mail Servers and Related > alt.comp.mail.qmail

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-12-2004
Raja
 
Posts: n/a
Default Newbie: Check for overloaded connections

****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
Reply With Quote
  #2 (permalink)  
Old 02-13-2004
Dave Sill
 
Posts: n/a
Default Re: Newbie: Check for overloaded connections

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.
Reply With Quote
  #3 (permalink)  
Old 02-14-2004
Raja
 
Posts: n/a
Default Re: Newbie: Check for overloaded connections

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.

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:42 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0