view config/blitz.ssl.config @ 34:6f68e94c1fb8 default tip

Add CondensedStats monitoring utility, equivalent to vmstat
author Dominic Cleal <dominic-cleal@cdo2.com>
date Thu, 05 Aug 2010 11:07:25 +0100
parents 3dc0c5604566
children
line wrap: on
line source

import net.jini.discovery.DiscoveryGroupManagement;

import java.util.logging.Level;

import net.jini.security.BasicProxyPreparer;

import net.jini.jeri.ssl.*;
import net.jini.jeri.*;

import net.jini.constraint.BasicMethodConstraints;
import net.jini.core.constraint.InvocationConstraints;
import net.jini.core.constraint.Integrity;

import net.jini.security.*;

import javax.security.auth.login.LoginContext;

import org.dancres.blitz.stats.Switch;
import org.dancres.blitz.stats.OpSwitch;

import org.dancres.blitz.config.Persistent;
import org.dancres.blitz.config.TimeBarrierPersistent;
import org.dancres.blitz.config.Transient;

org.dancres.blitz {
    // Default logging level
    //
    defaultLogLevel = Level.SEVERE;

    // Examples of setting log levels for specific components
    //
    // org_dancres_blitz_disk_SleeveCacheLogLevel = Level.ALL;
    // org_dancres_blitz_disk_StorageLogLevel = Level.INFO;
    // org_dancres_blitz_entry_SearchVisitorImplLogLevel = Level.FINE;
    // org_dancres_blitz_arc_cacheLogLevel = Level.INFO;

    // Published on the proxy as a Name attribute
    //
    name = "dancres";

    // Set this to a LoginContext instance when you wish to run the server
    // as a particular principle
    //
    loginContext = new LoginContext("org.dancres.blitz.Server");

    users = KeyStores.getKeyStore("file:lib/truststore", null);

    serverId = KeyStores.getX500Principal("server", users);
    serverUser = Collections.singleton(KeyStores.getX500Principal("server",
                                        users));

    // Location to store meta info and entrys.
    // NOTE: Each concurrent Blitz instance should use a different directory
    // for it's logs and persistent state - if this isn't done
    // "bad things will happen" (TM)
    //
    persistDir = "/home/dan/src/jini/space/dbfiles_dancres/";

    // Location of log files - SHOULD BE DIFFERENT FROM ABOVE
    //
    logDir = "/sdalog/danlogs/prevlog/";
    // logDir = "/blitzlog/";
    // logDir = "/home/dan/src/jini/space/dbfiles_dancres/prevlog/";

    // Maximum number of async write threads
    // DO NOT CHANGE THIS - BLITZ DOESN'T SUPPORT MORE THAN ONE WRITE THREAD
    // (YET!)
    //
    maxWriteThreads = 1;

    // How long to keep write threads alive in the pool
    //
    threadKeepalive = 15;

    // The preferred queue size for pending writes
    //
    desiredPendingWrites = 20;
    // desiredPendingWrites = 0;

    // Size of the berkeley DB cache
    //
    // dbCache = 33554432;
    dbCache = 16777216;
    // dbCache = 8388608;

    // Configures the maximum number of concurrent Db transactions
    // Bigger is better!  This value has been validated for 64 concurrent
    // JavaSpace operations
    //
    maxDbTxns = 256;

    // Dump Db statistics after every checkpoint if this is true
    // WARNING: dumping stats is broken in 4.1.25 - 
    // ask Dan (dan@dancres.org) for a patch.  This should be fixed in Db 4.2,
    // will test and then post an update to the website
    //
    dumpDbStats = new Boolean(false);
    // dumpDbStats = new Boolean(true);

    // Dump statistics for write queue usage
    // When tuning/configuring Blitz for various systems, these stats help
    // to determine I/O performance requirements and required memory
    //
    dumpWQStats = new Boolean(false);
    // dumpWQStats = new Boolean(true);

    // Turn this on to get reports on checkpointing behaviour - useful for
    // tuning
    logCkpts = new Boolean(true);

    // Maximum number of entry instances to cache for a particular Entry type
    //
    // entryReposCacheSize = 2000;
    // entryReposCacheSize = 1000;
    // entryReposCacheSize = 1;
    // entryReposCacheSize = 200;
    entryReposCacheSize = 5000;

    // Non-blocking transactions are used within the entry package to
    // prevent deadlock.  Such transactions can fail and require aborting
    // should they fail to get a lock.  When this happens, the thread
    // attempting the transaction will backoff by an amount of time dictated
    // by base_backoff + Random(jitter) ms which should allow the conflicting
    // transaction time to complete.  Format is {base_backoff, jitter}
    loadBackoff = new int[] {50, 50};

    // The maximum allowable lease time for entries and notify registrations
    // To permit Lease.FOREVER, set the LeaseBound = 0.
    // To deny Lease.FOREVER and set an upper limit on lease time set the
    // LeaseBound to a positive non-zero value in milliseconds
    //
    entryLeaseBound = 0;
    notifyLeaseBound = 0;

    // How often to do an active cleanup of lease expired resources
    // Value should be ms - 0 disables active cleanup
    //
    leaseReapInterval = 0;
    // leaseReapInterval = 60000;
    // leaseReapInterval = 10000;
    // leaseReapInterval = 1800000;

    // Number of OID allocators to use for entries
    maxOidAllocators = 512;

    // How often to log event allocation to disk
    //
    eventgenSaveInterval = 50;

    // How big a jump in notify sequence numbers there should be following
    // restart/crash
    //
    eventgenRestartJump = 1000;

    // Maximum number of task threads to be used in posting remote events
    // and dispatching blocked takes or reads
    //
    maxTaskThreads = 10;

    // storageModel = new Transient();
    storageModel = new Persistent(false, false, 20, true, 10000, 8192);
    // storageModel = new TimeBarrierPersistent(false, false, 10000, 65536, 10000);

    // debugPort = 0;
    debugPort = 12345;

    // Default Stats to make available
    // stats = new Switch[] {new OpSwitch(OpSwitch.ALL_TYPES,
    // 		OpSwitch.TAKE_OPS, true),
    // 		new OpSwitch(OpSwitch.ALL_TYPES, OpSwitch.READ_OPS, true),
    // 		new OpSwitch(OpSwitch.ALL_TYPES, OpSwitch.WRITE_OPS, true)};

    // The initial lookup groups to register with - after first boot
    // this information is held in a meta database and should be configured
    // via JoinAdmin
    //
    initialGroups = new String[]{"JERI_Group1"};
    // initialGroups = DiscoveryGroupManagement.ALL_GROUPS;


    // The initial lookup locators to register with - after first boot
    // this information is held in a meta database and should be configured
    // via JoinAdmin
    //
    // initialLocators = new LookupLocator[] {new LookupLocator("jini://yakuza/")};

    // The initial attributes to register with - note that these need to be
    // available as part of the codebase.
    // This information is held in a meta database and should be configured
    // via JoinAdmin
    //
    // initialAttrs = new Entry[] {};

    // The exporter to use - see the JINI documentation
    //
    ILFactory = new ProxyTrustILFactory(new BasicMethodConstraints(
	new InvocationConstraints(Integrity.YES, null)), null);
    serverExporter = new BasicJeriExporter(SslServerEndpoint.getInstance(0),
                        ILFactory, false, true);

    // Blitz provides a suitable default for all these but this is how you'd
    // configure them explicitly
    //
    notifyPreparer = new BasicProxyPreparer();
    recoveredNotifyPreparer = new BasicProxyPreparer();
    txnPreparer = new BasicProxyPreparer();
    recoveredTxnPreparer = new BasicProxyPreparer();
    activationIdPreparer = new BasicProxyPreparer();
    activationSysPreparer = new BasicProxyPreparer();
}