Recently, I was asked "is or will AOLserver be 64-bit capable?"  I know
this subject has come up on this list before (with regards to 64-bit
builds for Opteron64 hosts), but to satisfy my own curiousity, I decided
to see what it would take to get a 64-bit build on Solaris.

Luckily, it was pretty straightforward.  The important steps involve
ensuring you use the Sun Forte compiler (in my case, I used Forte 6.2)
as Tcl's "configure" script currently doesn't understand how to make gcc
do 64-bit yet.  There's a patch submitted to Tcl (#1021871) and it even
looks like Jeff Hobbs committed a variation on the patch to Tcl to the
8.4 branch and 8.5 -- yay.

Once you have the Sun Forte compiler set up (or, wait for the next
release of Tcl that will build with gcc 3.3 or newer), you simply add
"--enable-64bit" to the arguments that you pass to Tcl's "configure"
script.  That's it!

Since AOLserver uses Tcl's build-time settings to drive its own build,
building AOLserver that's pointed to the Tcl build using --with-tcl will
produce a 64-bit AOLserver build.  However, there's two minor "changes"
that need to be made before it'll compile cleanly.  I'm attaching the
patch to this email.

Once built, I started a "vanilla" AOLserver using the supplied
sample-config.tcl (only modified to enable the control port) and
performed a very simple test:  I executed a command from the control
port that would create ~5 GB worth of NSV variable data.  In a 32-bit
build, this would typically run the nsd process out of memory (as the
limit is anywhere from 2.75GB to 3.75GB per process), but with the
64-bit build, it grew quite happily.  Here's the proof:


    server1:nscp 1> for {set i 0} {$i < 5000} {incr i} { nsv_set $i data 
[string repeat x 1000000] }

    [28/Jan/2005:16:02:37][29549.9][-nscp:1-] Notice: nscp: nsadmin 1: for {set 
i 0} {$i < 5000} {incr i} { nsv_set $i data [string repeat x 1000000] }

    [28/Jan/2005:16:05:28][29549.9][-nscp:1-] Notice: nscp: nsadmin 1: done


Meanwhile, in another shell:


    bash-2.05b$ date; ps -Ao pid,rss,vsz,args | grep nsd
    Fri Jan 28 16:02:33 EST 2005
    29549 4896 5768 bin/nsd -ft test-config.tcl

    bash-2.05b$ date; ps -Ao pid,rss,vsz,args | grep nsd
    Fri Jan 28 16:02:43 EST 2005
    29549 198416 199232 bin/nsd -ft test-config.tcl

    bash-2.05b$ date; ps -Ao pid,rss,vsz,args | grep nsd
    Fri Jan 28 16:02:50 EST 2005
    29549 435784 436608 bin/nsd -ft test-config.tcl

    bash-2.05b$ date; ps -Ao pid,rss,vsz,args | grep nsd
    Fri Jan 28 16:03:32 EST 2005
    29549 1721368 1722192 bin/nsd -ft test-config.tcl

    bash-2.05b$ date; ps -Ao pid,rss,vsz,args | grep nsd
    Fri Jan 28 16:04:12 EST 2005
    29549 2847680 2848496 bin/nsd -ft test-config.tcl

    bash-2.05b$ date; ps -Ao pid,rss,vsz,args | grep nsd
    Fri Jan 28 16:04:31 EST 2005
    29549 3351744 3352560 bin/nsd -ft test-config.tcl

    bash-2.05b$ date; ps -Ao pid,rss,vsz,args | grep nsd
    Fri Jan 28 16:04:48 EST 2005
    29549 3763024 3764816 bin/nsd -ft test-config.tcl

    bash-2.05b$ date; ps -Ao pid,rss,vsz,args | grep nsd
    Fri Jan 28 16:05:06 EST 2005
    29549 4174272 4176064 bin/nsd -ft test-config.tcl

    bash-2.05b$ date; ps -Ao pid,rss,vsz,args | grep nsd
    Fri Jan 28 16:05:27 EST 2005
    29549 4845392 4846208 bin/nsd -ft test-config.tcl

    bash-2.05b$ date; ps -Ao pid,rss,vsz,args | grep nsd
    Fri Jan 28 16:05:32 EST 2005
    29549 4890320 4891136 bin/nsd -ft test-config.tcl


The point here is the nsd starts up at 5.7 MB in size, and in 2m 51s, it
grew to 4.89 GB in size.


The caveat here is that no one single Tcl_Obj can exceed 4 GB as it
still uses "int" instead of "size_t" in places.  However, the overall
process can now exceed 4 GB -- yay!

I don't know how interesting this is to most folks, but I know it's
important to a few of us.  To us, this is fantastic news, I think.


-- Dossy

--
Dossy Shiobara                       mail: [EMAIL PROTECTED]
Panoptic Computer Network             web: http://www.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.

Reply via email to