Smart cache configuration under Netware 6

Before we begin

Audience

This set of notes have been arranged to help you configure Smart Cache on a netware box.  Although those steps may (and in many cases should) work on netware 5.1, I currently have no way to verify it.  Bear also in mind that while I try to make those steps as easy as possible, some discussions about netware implementation and design views require a minimal understanding of how the thing actually works.  It is also assumed that you know reasonably well how to operate Smart Cache.  There's nothing more boring for someone than to read something that he or she already knows, so I won't repeat what's already written in other FAQ or manual except to stress an important point.

Architectural considerations

There're several things to consider when installing a product like Smart Cache on a Netware Server.  First, there's the version required.  From my personal experience, versions prior to .84 wouldn't cache anything, and this is due to the way the program was checking about FS write ability.

On another hand, unlike other operating systems, I'd strongly suggest to dedicate a fixed-size volume to the dynamic cache files.  The reason for this is simple: if you have misconfigured garbage collection and you have smart cache running on the SYS: volume, you're basically trying to assassinate your server.  In Unix/linux, folders are most of the time mount points of different partition/slices, and in the NT world, at least on 2000/xp, you can make the JVM act as a service user and hence enable quota on a volume.  This could also be done in Netware if SCache had a way to authenticate to NDS without chewing a connection licence AND was using the FS as this entity: in that case quotas could be used to prevent volume clogging.  But it's currently not the case, and will most probably never be.

So now, here we are.

Preparing the server to host Smart Cache

File system preparation

Make sure you have a volume having enough space to hold dynamic cache files.  You have the choice between creating a new fixed-size volume in an existing pool, create a new pool & new volume, or simply use an existing volume and resort to aggressive garbage collection and proper configuration to prevent the cache to inflate too much.

You should also decide at this point if you're to keep the program files and the dynamic cache files on different volumes or not.  From the program's point of view, it doesn't matter, but to the administrator, it may. ;-)

IP Stack configuration

As you most probably know, Smart Cache can be bound to a specific ip address.  If you'd like to bind the service to its own ip address without adding a network card, use the add secondary ipaddress ww.xx.yy.zz directive at the server console before starting the program.  Also, of course, make sure you add it after your real network cards bindings in sys:system\autoexec.ncf .

Installation proper

Extract a current archive on your favorite workstation, and then send it over to your netware server.  If you are feeling like a courageous soul, you may even try to inflate the archive using the console unzip utility, although I never managed to make it work properly.

Once the extracted files are where you want them to be, copy the "samples" configuration files at the root of the program folder and edit them according to your needs.

########################################################
#DO NOT USE ROOT directory!!! (for example c:\)
# unless you have a dedicated partition for Smart Cache
# and removed check for that from source code.
########################################################
CacheRoot scratchvol:/scache

Exert from scache.conf, showing how to declare FS paths in scache.  Take note that the backslash can also be used.

To make the thing to work, I'd suggest the reader to create a .ncf file which would be located within the search path of your server and would contain instructions to:
    -    Make Java use the folder in which scache is in as the current directory,
    -    Launch Smart Cache,
    -    Launch Smart Cache garbage collection repeatedly.
ENVSET CWD=APPS:\Java\SCache
JAVA -cp . -ms4m scache -cfgdir APPS:\Java\scache
JAVA -cp . -ms4m scache -gc 1440 -cfgdir APPS:\Java\scache

Typical Smart Cache startup file.  Please note that the -cfgdir is used in both cases, which in my experience was required.  Your mileage may vary.


If everything went well, you'd see something similar to the following on the server console logger screen:

Symantec Java! JustInTime Compiler Version 3.10.110(x) for the Java 2 Platform 
Copyright (C) 1996-99 Symantec Corporation                                     
                                                                               
Symantec Java! JustInTime Compiler Version 3.10.110(x) for the Java 2 Platform 
Copyright (C) 1996-99 Symantec Corporation                                     
                                                                               
Smart Cache 0.84 - full featured caching proxy server and web forwarder.       
Copyright (c) Radim Kolar 1998-2003. Opensource software; There is NO warranty.
See the GNU General Public License version 2 or later for copying conditions.  
                                                                               
"A person is said to be established in self-realization and is called a        
yogi [or mystic] when he is fully satisfied by virtue of acquired knowledge    
and realization. Such a person is situated in transcendence and is             
self-controlled. He sees everything--whether it be pebbles, stones or gold --  
 -- as the same."                                                              
                                - Bhagavad-gita 6.8                            
                                                                               
Smart Cache 0.84 - full featured caching proxy server and web forwarder.       
Copyright (c) Radim Kolar 1998-2003. Opensource software; There is NO warranty.
See the GNU General Public License version 2 or later for copying conditions.  
                                                                               
"The Supreme Personality of Godhead said: Son of Prtha, a transcendentalist    
engaged in auspicious activities does not meet with destruction either in this 
world or in the spiritual world; one who does good, My friend, is never        
overcome by evil."                                                             
                                - Bhagavad-gita 6.40                           
                                                                               
[INFO] New rule "*/ads*" made old rule "http://ads.*" obsolete.                
[INFO] New rule "*/ads*" made old rule "http://ads.*" obsolete.                
Checking filesystem (scratchvol:/scache)                                  
   Filesystem allows ending dot in filename: false                             
   Filesystem allows backslash in filename : false                             
   Filesystem reports real directory size  : false                             
                                                                               
Mon Apr 07 10:50:07 EDT 2003 Smart Cache 0.84 ready on 8080/10.192.0.81        
Checking filesystem (scratchvol:/scache)                                  
   Filesystem allows backslash in filename : false                             
   Filesystem reports real directory size  : false                             
                                                                               
Mon Apr 07 10:50:07 EDT 2003 running garbage collection.                       
Mon Apr 07 10:50:07 EDT 2003 Garbage collector version 0.22 initialized.       
Mon Apr 07 10:50:07 EDT 2003 Cache size watermarks:                            
Mon Apr 07 10:50:07 EDT 2003       High: 1195376640 B (95%)                    
Mon Apr 07 10:50:07 EDT 2003        Low: 1132462080 B (90%)                    
Mon Apr 07 10:50:07 EDT 2003 Block size: 1024 B, avg. directory size: 2048 B.  
Mon Apr 07 10:50:07 EDT 2003 File sizes: Min=0 B, Max=40960000 B.              
Mon Apr 07 10:50:07 EDT 2003 GC Array size: 5000, Max age: 365.0 d.            
Mon Apr 07 10:50:07 EDT 2003 Scanning cache directory. This takes some time... 
Mon Apr 07 10:51:26 EDT 2003 CACHE SCAN SUMMARY:                               
Mon Apr 07 10:51:26 EDT 2003      High watermark: 1195376640 B (95%)           
Mon Apr 07 10:51:26 EDT 2003      Disk storage: 111186944 Bytes used.          
Mon Apr 07 10:51:26 EDT 2003      Cache is 8.8 percent full.                   
Mon Apr 07 10:51:26 EDT 2003         (15052 files and 4659 dirs.)              
Mon Apr 07 10:51:26 EDT 2003          avg. file size: 7386 Bytes.              
Mon Apr 07 10:51:26 EDT 2003          avg. directory: 23864 B in 3 files.      
Mon Apr 07 10:51:26 EDT 2003      5000 of 5000 gc slots used.                  
Mon Apr 07 10:51:26 EDT 2003      Time marks: low=62.970886 middle=81.46025 high
=363.8706                                                                      
Mon Apr 07 10:51:26 EDT 2003 Cache size is bellow lowmark - No cleaning needed.
Mon Apr 07 10:51:26 EDT 2003 garbage collection ended.                         
Mon Apr 07 10:51:26 EDT 2003 waiting 1440 m for another run.      

If you get something like "Class scache exited with error level 1", something is wrong with your NCF or paths.