Hi all,

I activated last week the TTrace package on my production server.
I stopped it after a few days. It is working great and is really terrific to
keep AOLServer process memory low !

BUT... with the same traffic as before my processor (%CPU and load balancing)
is multiplied by about 8 !
After few searches, I realised a nsv lock contention was very high (checked in
nstelemetry.adp).

So it is not directly the TTrace package that is slowing the process in my
opinion but its use of the nsv_ commands that generate lock contentions.

I had a lock contention problem a long time ago and increased the nsvbucket to
30 and it solved the problem.
I tried to increase it more with the TTrace package, but it didn't work. (I
think this is due to 1 shared array with nsv_ so this array cannot be splitted
into different buckets).

Then.. I remember another problem I had with a tcl script that can be related
to slow nsv_ commands.

Using the syntax "set myvar(mykey)" to retrieve a value from an array is
really fast, but using the syntax "array get myvar mykey" is really slow !!
Try the script :

-------------------------
package require md5

unset t

array set t [list]

for { set i 0 } { $i < 100000 } { incr i } {
        set tmp [md5::md5 $i]
        array set t [list $tmp $tmp]
}
--------------------------

Then the commands :

time { array get t d10906c3dac1172d4f60bd41f224ae75 } 100
--> 37897 microseconds per iteration

time { set t(d10906c3dac1172d4f60bd41f224ae75) } 1000
--> 1 microseconds per iteration

the "set ..." syntax is more than 30000 times faster !!!

So I wonder what is the internal implementation of the nsv_ command, so if it
uses the C related commands to "array" it can be a slow implementation.

Am I all wrong ? Am I missing something ? Any tip will be welcome !

Thanks for reading my long post ;-)

Best Regards.

Jean-Fabrice RABAUTE.
http://www.core-services.fr


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