I would recommend killing them, just in case there is some memory leak or other 
glitch which causes problems.  

For example, I had an issue with threads when I used a filter to process 
requests, the filter would use ns_adp_parse to parse an adp which would either 
fill the buffer with HTML or the adp would call ns_returnredirect.  Well as it 
turned out this (the redirect) actually infected the thread by setting the 
state to 'abort' but never actually clearing that state after the thread was 
done process the request.  The result was the next time this particular (now 
infected) thread would get called up to handle a request, it would see the 
'abort' state and not process the next adp from within the filter, which 
resulted in just a blank page being returned.

If you are just serving HTML pages and not doing anything remotely dynamic or 
fancy you may be safe with leaving the threads to handle an infinite number of 
requests, but why take the risk that something similar won't crop up over time? 
 I have fixed the issue I mentioned above and typically have my threads handle 
several thousand requests before exiting, so its not like you have to set it to 
a low number so that you are always destroying and creating threads.


Date: Tue, 15 Feb 2011 17:20:27 -0500
From: [email protected]
Subject: Re: [AOLSERVER] What does 'exiting: exceeded max connections per 
thread' mean?
To: [email protected]



  


    
  
  
    Hi there,

    

    Is there any wisdom in this community about whether it's better to
    let these threads run forever, or whether it makes more sense to
    kill them off after they process a number of connections? 

    

    Thanks,

    Haig

    

    On 2/15/2011 2:18 PM, Scott Goodwin wrote:
    The code that each connection thread runs to service a
      connection is wrapped within a while loop that starts at whatever
      you set ns/threads -> maxconns to and counts down to zero. When
      it reaches 0, a connection thread exits. If ns/threads ->
      maxconns is set to 0, then your connection threads don't have a
      limit on how many connections each one can handle and don't exit
      because they've serviced a given number of connections. See the
      NsConnThread function in queue.c.
      

      
      /s.
      

      
      

        
          On Feb 15, 2011, at 9:49 AM, Levy Bajamundi wrote:
          
          Hi,

            

            Since we moved to Aolserver 4.5.1, we've been getting alot
            of these on our logs: 'Notice: exiting: exceeded max
            connections per thread'. Does that mean that Aolserver is
            receiving more connections than it can handle? If so, what
            would you recommend us do? Our servers are running on Debian
            Lenny 64bit with 3gb ram.

            

            Here's our configurations file:

            

            set nsthread_stacksize     [expr 10*128*1024]

            set adp_cachesize          [expr 512*1024]

            set threads_maxthreads     18

            set threads_minthreads     1

            ...

            ns_section "ns/server/${servername}"

            ns_param   directoryfile  
"index.tcl,index.tct,index.vuh,index.atcl,index.adp,index.html,index.htm"

            ns_param   pageroot        $pageroot

            ns_param   enabletclpages  true     ;# Parse *.tcl files in
            pageroot.

            ns_param   maxthreads      $threads_maxthreads        ;#
            Tune this to scale your server

            ns_param   minthreads      $threads_minthreads         ;#
            Tune this to scale your server

            ns_param   maxconnections  [expr $threads_maxthreads *
            7]       ;# Max connections to put on queue

            

            ns_section "ns/threads"

            ns_param   stacksize         $nsthread_stacksize

            ns_param   mutexmeter      true

            ns_param   maxthreads      $threads_maxthreads        ;#
            Tune this to scale your server

            ns_param   minthreads       $threads_minthreads         ;#
            Tune this to scale your server

            ns_param   maxconnections  [expr $threads_maxthreads *
            7]       ;# Max connections to put on queue

            

            

            Here's our pools.tcl file:

            

            if {[info commands ns_pools] ne ""} {

                set cfgsection "ns/threads"

                set minthreads [ns_config $cfgsection minthreads 0]

                set maxthreads [ns_config $cfgsection maxthreads 10]

                set maxconns   [ns_config $cfgsection maxconns
            [ns_config $cfgsection ConnsPerThread 100]]

                set timeout    [ns_config $cfgsection threadtimeout 120]

                set spread     [ns_config $cfgsection spread 20]

                

                ns_pools set default -minthreads $minthreads -maxthreads
            $maxthreads -maxconns $maxconns -timeout $timeout -spread
            $spread

             

                set cfgsection "ns/server/[ns_info server]"

               

                ns_log notice "default thread pool: [ns_pools get
            default]"

                    

                set minbusythreads      [ns_config $cfgsection
            MinBusyThreads 0]

                set maxbusythreads      [ns_config $cfgsection
            MaxBusyThreads 10]

                

                ns_pools set error -minthreads $minbusythreads
            -maxthreads $maxbusythreads -timeout $timeout -maxconns
            $maxconns -spread $spread

                

                ns_log notice "error thread pool: [ns_pools get error]"

                    

                if {[info commands ns_limits] ne ""} {

                    if {[set maxinput [ns_config
            $cfgsection/module/nssock maxinput]] ne ""} {

                        ns_limits set default -maxupload $maxinput

                    }

                

                    set maxwait         [ns_config $cfgsection MaxWait
            100]

                    set maxwaittime     [ns_config $cfgsection
            MaxWaitTime 60]

                

                    ns_limits set default -maxrun $maxthreads -maxwait
            $maxwait -timeout $maxwaittime

                    ns_log notice "default limits: [ns_limits get
            default]"

                }

            }

            

            

            Any help would be greatly appreciated.

            

            

            Thanks,

            

            Levy Bajamundi

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

    
    

  


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