info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Maximum connections to the server


From: Bill Biessman
Subject: RE: Maximum connections to the server
Date: Tue, 26 Mar 2002 14:11:43 -0500

I believe the standard NT workstation license limits you to 10 remote
connections.  The server licenses support as many connections as you pay
for.

I have a w2000 professional system that I use as a server and it also has a
10 connection limit. This was a big pain as more and more people started
working in parallel.  Whoever was number 11 got denied until one of the
connections timed out.  The default timeout on windows is huge (hours?) so
you couldn't simply get a cup of coffee and try again.  Efforts to change
the timeout by messing with the registry failed.

I ended up writing a script that uses some nt utilities to determine how
many connections there are and how long each has been connected but idle.
If it goes over a limit, I use another NT utility to kill the connection.
This has pretty much solved my problem for my team of about 20 developers.
I have not gotten the too many connections error or named pipe error in
months.

Here's the script if you are interested.  It's been hacked several times, so
please forgive the style.  Whenever I start the server I start this script
(it is an endless loop) in a window.

Bill
###########################################
#!/bin/bash


typeset deleted_one="no"
typeset -i max_session_time=10
typeset -i num_sessions=0

net session

get_num_sessions()
{
        num_sessions=$(net session | wc -l)
        let     num_sessions=$num_sessions-6
        if [ $num_sessions -le 0 ]
        then
                let     num_sessions=0
        fi

        echo num_sessions=$num_sessions
        if [ $num_sessions -ge 8 ]
        then
                let max_session_time=6
        fi
}

proc_line()
{
        typeset -i hours
        typeset -i seconds
        typeset -i t
        typeset computer

        let     hours=1$1
        let     hours=$hours-100

        let     minutes=1$2
        let     minutes=$minutes-100

        let     t=$hours*60
        let     t=$t+$minutes


        computer="$3"

        #       echo "proc_line( $* ) time=$t"

        if [ $t -ge $max_session_time ]
        then
                echo "connection time $t for $computer, kill "
                net session \\\\$computer /delete /y
                deleted_one=yes
        else
                echo "connection time $t for $computer, ok "
        fi
}
proc_session()
{
        typeset line
        while read line
        do
                proc_line $line
        done
}

kill_old_sessions()
{
        net     session
        net session     \
                | cut -c0-20,69-73      \
                | awk '/\\/''{print $2 " "$1}'  \
                | sed 's/\\\\//'        \
                | sed 's/:/ /'  \
                | proc_session
}

###############################################
top()
{
        echo "<html>"
        echo    "<meta http-equiv=Refresh content=30;
url=ServerSessions.html>"
        echo "<title>"
        echo "Server Connections Status"
        echo "</title>"
        echo "<body>"
}
middle()
{
        echo "<pre>"
        date +"Information gathered %D %T"
        net session
        echo "</pre>"
}
bot()
{
        echo "</body>"
        echo "</html>"
}
gen_html()
{
        top
        middle
        bot
}
###############################################
sleep_a_while()
{
        typeset -i x
        let x=$1
        while [ $x -ge 1 ]
        do
                printf "%3i\r" $x
                sleep 1
                let x=$x-1
        done
        echo
}


###############################################
#
# run at least one pass
# if an argument is passed, run continuously, once
# every five minutes
#

while true
do
        tput home
        tput clear
        get_num_sessions
        echo $num_sessions >> killsession.txt
        date
        kill_old_sessions
        rm -f  e:/tools/apache/apache/htdocs/ServerSessions.html
        gen_html > e:/tools/apache/apache/htdocs/ServerSessions.html
        if [ $deleted_one = yes ]
        then
                deleted_one=no
                net session
        fi
        echo
        echo
        echo "sleeping before next search for connections"
        if [ "$1" = "" ]
        then
                break
        else
                sleep_a_while 60
        fi
done
echo goodbye
sleep 5
###########################################


-----Original Message-----
From: address@hidden [mailto:address@hidden Behalf Of
Larry Jones
Sent: Tuesday, March 26, 2002 12:13 PM
To: jazzvale
Cc: address@hidden
Subject: Re: Maximum connections to the server


jazzvale writes:
>
> please give me an answer

I thought I had, but apparently not.

> > I'm wondering about connection timeout and connection limit.
> > So, the questions are: does the connection have a timeout (how long is
> > it?) and is there a
> > limit of maximum connections to the server?

There is no timeout for an established connection (although CVS does use
TCP/IP KEEPALIVEs to try to detect broken idle connections).  A CVS
server only supports a single connection -- [x]inetd is responsible for
starting a new server for each connection.  Please note that the CVS
client/server protocol was designed assuming a new connection for each
user-level command, so you probably can't use connection pooling in the
general case (and the standard server may not always work right even in
the cases where you could, theoretically, use connection pooling, since
it's never really been tested that way).

-Larry Jones

OK, there IS a middle ground, but it's for sissy weasels. -- Calvin

_______________________________________________
Info-cvs mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/info-cvs




reply via email to

[Prev in Thread] Current Thread [Next in Thread]