Thanks for the explanations but i'm still confused by the numbers shown by
my ns_pools:

ns pool config:
ns_pools set procmsgmgr -maxconns 150 -maxthreads 500 -minthreads 300
-timeout 60

At peak times when i look at the pools it shows that idle=1 and current=1

nspools=minthreads 300 maxthreads 500 idle 1 current 1 maxconns 150 queued
57036 timeout 60

Does this mean all threads are busy except 1? Also the values for idle and
current remains the same even under non-peak hours.?


Answering Dossy question:
>>So, the question is ... what ns_limits does Shedi have configured?
I didn't know about this parameter. and currently not used in my config.tcl.

>>How are you closing the socket?
Following code block uses ns_conn write and ns_conn close command to
terminate the connection:

   # Sent response quickly
        set retstring "HTTP/1.0 201 Created\nContent-Type:
application/x-tcl-list\nConnection: close\n\nSUCCESS"
        set sockwrite [ns_write $retstring];
        ns_conn close
        if {!$sockwrite} {
            incrstat recd_error;
            ns_log warning "$proc Client connection: ABNORMAL-TERMINATION"
            return -code ok;
        }
        incrstat recd_success;
        ns_log debug "$proc Client connection: NORMAL-TERMINATION";
        set msgbytes [ns_conn contentlength];
        incrstat msgin_bytes $msgbytes;
       .......
       ......... Further processing of client's data continues.
      .......... Typically client data is validated and written to  a text
file here.


Perhaps i shall start a new thread to process the client's data. This way i
can return the connection thread back to connection pool much faster. Any
suggestions?

kind regards,
Shedis










On 9/15/07, Dossy Shiobara <[EMAIL PROTECTED]> wrote:
>
> On 2007.09.14, Shedi Shedi <[EMAIL PROTECTED]> wrote:
> > I check the docs and previous posts regarding maxconns, that it is the
> > number of connections that will be served by a single thread before
> > it dies.
>
> Yes, I was incorrect about this.  Thanks for the correction.
>
> > also the queued value always increases, when a new request arrives the
> > queue value is incremented. But it never goes downwards.
>
> Based on a quick scan of the source, this appears to be correct: the
> queued counter is only incremented.
>
> > Does this mean the queue contains that many number of request or the
> > number of request which have been served?
>
> It appears to count the number of requests queued to the pool.
>
> > Both current and idle, when server is started their value is set from
> config
> > file. e.g. if i set min to 100 then the current and ilde has 100. But at
> > that point there's no request why does current returns 100?
>
> current indicates the current number of threads in the pool.  Current
> should never drop below min and never exceed max.  If current == idle,
> then all threads are idle.  If idle == 0, then all current threads are
> busy servicing a request.
>
> > Note: I have a proc that handles the incoming message and as soon as the
> > message is received, client is sent a success code followed by socket
> > closure. Next the proc performs the rest of the work and return.
>
> How are you closing the socket?
>
> Until the thread is returned to the pool, it's considered "active" even
> if there's no client connected on the other end.  Until the thread's
> processing is complete, it isn't returned back to the pool, and
> therefore cannot handle another request.
>
> -- Dossy
>
> --
> Dossy Shiobara              | [EMAIL PROTECTED] | http://dossy.org/
> Panoptic Computer Network   | http://panoptic.com/
>   "He realized the fastest way to change is to laugh at your own
>     folly -- then you can let go and quickly move on." (p. 70)
>
>
> --
> AOLserver - http://www.aolserver.com/
>
> To Remove yourself from this list, simply send an email to <
> [EMAIL PROTECTED]> with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the
> Subject: field of your email blank.
>


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to