I've been trying to get our jetspeed based portal up to acceptable response times (< 
1sec), and since the topic has come up several times on this list I thought I'd share 
some of what I've come up with.  Additionally, I'd love to hear any corrections or 
additional tips you might have. :-)

A quick overview of our app:  We're working with 1.4b1 still, using role based psml, 
stored in a db.  We use velocity almost exclusively.  Content is grouped and organized 
by tabs; e.g. Home, For Staff, Employment, etc...  Some of these tabs have sub-tabs.  
Each pane has one or more portlets associated with it.

Customization is controlled by a turbine permission called PortletConfig. If you have 
it you can customize everything, otherwise you can customize nothing.  Our main 
slowdown was caused by checking for this permission.  For each tab, page, pane, and 
portlet we were checking the user for this permission using a helper function that 
would return a list of all a user's permissions given a username.  The function was 
written to be a convenience, and to be used sparingly; it takes a username, retrieves 
all the roles associated w/ said name, and iterates through those roles, building a 
list of permissions.  This list, once retrieved, wasn't being stored in the session or 
anywhere so it was being called numerous times per page.  Obviously this was pretty 
damning. :-)

My quick fix was the simply change the PortletConfig permission to a Role since only 
"admin" had the permission anyway.  There are other solutions but this one was such a 
benefit it was good enough for now.

Attached is a document which is basically a checklist of things to make sure are set 
in various .property files before moving to production.  If your files are generated 
through ant/maven/whatever this will be of less use. If anyone notices something I 
have forgotten, or see something I shouldn't have changed please point it out:  I'm 
not an expert at configuring Jetspeed by any stretch of the imagination.  The jist of 
the file is this:

Turn on module and template caching.
set appropriate max # of db connections.
set appropriate modification check intervals.
Comment out stuff we don't use.

Some of the things I recommend commenting out break some of the admin only portlets we 
don't use.  FYI.  All these apply to 1.4b1; some things may have changed since then.

Cheers,
stu

-----------------
-- CHECK THESE --
-----------------

In TurbineResources.properties
        set module.cache=true           ##cache turbine modules
        database.default.maxConnections=20
        services.VelocityService.file.resource.loader.cache = true
        ##set this to zero to disable checking for new or modified templates, or 300 
to set it to every 5 minutes.
        services.VelocityService.file.resource.loader.modificationCheckInterval=300

        Comment out the following if they're not already:
                Everything under "W E B M A C R O  S E R V I C E"
                Everything under "F R E E M A R K E R  S E R V I C E"

In JetspeedResources.properties
        set daemon.feeddaemon.onstartup=false
        services.Registry.refreshRate=3600      ##how often we refresh the xreg entries
        Comment out the following if they're not already:
                #contentfeeds.feed.local.description=Sample local OCS Feed
                #contentfeeds.feed.local.url=/ocs/local.ocs

                #contentfeeds.feed.apache.description=ASF OCS Feed ( 
http://www.apache.org/ )
                
#contentfeeds.feed.apache.url=http://jakarta.apache.org/jetspeed/channels/apache.ocs

                
#services.URLManager.classname=org.apache.jetspeed.services.urlmanager.JetspeedURLManagerService
                #services.URLManager.url=/WEB-INF/conf/datasources.properties

                #daemon.entry=feeddaemon
                #daemon.entry=badurlmanagerdaemon

                #daemon.feeddaemon.classname=org.apache.jetspeed.daemon.impl.FeedDaemon
                #daemon.feeddaemon.interval=10800
                #daemon.feeddaemon.onstartup=false

                
#daemon.badurlmanagerdaemon.classname=org.apache.jetspeed.daemon.impl.BadURLManagerDaemon
                #daemon.badurlmanagerdaemon.interval=3600
                #daemon.badurlmanagerdaemon.onstartup=false

                
#services.StockQuoteService.classname=org.apache.jetspeed.webservices.finance.stockmarket.JetspeedStockQuoteService


In velocity.properties
        ## These properties get overwritten by the TurbineResources properties, but 
set them here anyway.
        ##
        set velocimacro.library.autoreload = false      ##disable reload of velocity 
macros.
        set template.loader.1.cache = true              ##cache velocity templates
        set template.loader.1.modificationCheckInterval = 300   ##how often we check 
the disk for modifications against cached values.


--------------------------------------------
-- PROPERTIES THAT PROBABLY NEED TWEAKING --
--------------------------------------------

In Torque.properties
        database.default.maxConnections=20      

In TurbineResources.properties
        ##set this to zero to disable checking for new or modified templates, or 300 
to set it to every 5 minutes.
        services.VelocityService.file.resource.loader.modificationCheckInterval=3600
        database.default.maxConnections=20      ## I don't know whether this or the 
one in Torque takes precedence.
        services.UploadService.size.max=10485760
        services.UploadService.size.threshold=10240
        services.PoolService.pool.capacity = 128
        services.PullService.tools.per.request.refresh=true

In JetspeedResources.properties
        Everything under the ThreadPool Service heading -- Setting these up to the 
default seemed to adversely affect performance.
        services.ThreadPool.init.count=5
        services.ThreadPool.max.count=20
        services.ThreadPool.minspare.count=5
        # Refresh rate, in seconds.  0 = no refresh.  Min value = 60.
        services.Registry.refreshRate=300
        services.PortletCache.TimeToLive.default=2700000        ##how long an unused 
portlet stays in the cache. (45 min default)
        #The following property is used for DatabasePsmlManagerService only. The 
default is false that is caching is
        #not allowed with DatabasePsmlManagerService, as the current implementation of 
caching does not work on a
        #distributed environment. It works only in a single server environment. 
        services.PsmlManager.caching-on=false

In velocity.properties
        set template.loader.1.modificationCheckInterval = 300   ##how often we check 
the disk for modifications against cached values.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to