Here are some notes on how to use Webware to gain maximum performance: * use Webware with Apache! * use mod_webkit, rather than the slower adaptors * keep the processing that actually occurs in WebKit_ to a minimum by serving all static requests directly from Apache / Squid. Only serve dynamic content from WebKit_. * follow the Apache tuning guidelines (http://httpd.apache.org/docs/misc/perf-tuning.html) * if you have a smp server(s), WebKit_ might scale better if you run one WebKit_ process per processor to overcome Python's global interpreter lock. This will require multiple ports and multiple mod_webkit entries in your httpd.conf file. You'll need extra RAM to do this. * Use absolute paths rather than doing relative path calculations instead of doing them in Python code. If you have site global directories for your stylesheets, images, etc., but you're using mod_rewrite to send all requests to WebKit_ do something like this:: ServerName www.calrudd.com ServerAlias calrudd.com DocumentRoot "/var/www/www.calrudd.com/public_html" WKServer localhost 8086 SetHandler webkit-handler RewriteEngine on RewriteRule .*/GlobalImages_/(.*)$ /GlobalImages_/$1 [L,PT] RewriteRule .*/spacer.gif$ /GlobalImages_/spacer.gif [L, PT] RewriteRule .*/GlobalStylesheets/(.*)$ /GlobalStylesheets/$1 [L, PT] RewriteRule .*/GlobalJavascript/(.*)$ /GlobalJavascript/$1 [L, PT] RewriteRule .*/ImageStore/(.*)$ /ImageStore/$1 [PT] This much easier and way more efficient than calculating these relative paths in your Servlet code. It allows you to do this:: rather than this:: * use aggressive caching wherever possible: * in your app code * in your db access * in your html generation * use URIs that can be cached outside of WebKit_ (using Squid or something like that) -- no query strings wherever possible * encourage client-side caching of static data; see ServingStaticFilesEfficiently_. * design your db schema and queries well * design your application well * use apache-bench and Steve Purcell's HTTPSession.py to profile your site and identify hotspots. * you'll probably identify a small number of URIs that eat up most of your processing time. If you really need to (and I doubt you will), you can achieve significant performance gains by hardwiring each of them to a particular WebKit_ port / process and bypassing all the URI-to-servlet mapping that WebKit_ usually does. To do this, you'll either need to hack WebKit_ yourself or use the experimental refactoring of Webware that I've been working on (search for WebwareExpRefactoring_ on the Wiki). If you use WebwareExpRefactoring_, these hard-wired servlets can be run in the same process as your normal servlets. * keep the Python performance tips in mind while developing (http://manatee.mojam.com/~skip/python/fastpython.html) Some helpful strategies are * use shortcut namebinding like this:: def __init__(self): self._lock = lock = Lock() self._lock_acquire = lock.acquire self._lock_release = lock.release def doSomething(self): self._lock_acquire() ... self._lock_release() * always convert globals to locals by using default args: def doSomething(self, arg1, arg2, currTime=time.time): ... # do something with currTime() -- TavisRudd_ - 30 Mar 2002