I'm developing a mapping application that utilizes a WSGI service and requires another config apply for each map. Presently, I launch the service with:

import os, sys
tilecachepath = '/usr/local/lib/python2.6/dist-packages/TileCache-2.10-py2.6.egg/TileCache'
sys.path.append(tilecachepath)
from TileCache.Service import Service, wsgiHandler
from paste.request import parse_formvars

theService = {}
def wsgiApp (environ, start_response):
    global theService
    fields = parse_formvars(environ)
    cfgs  = fields['cfg']
    theService = Service.load(cfgs)
    return wsgiHandler(environ, start_response, theService)

application = wsgiApp

This really is clearly starting too many handlers! How do i determine whether a particular handler has already been running? Can there be anything within the apache config that I have to adjust to ensure that handlers break correctly?

WSGI itself offers not a way of understanding what layers happen to be wrapping a particular application, nor does Apache learn about that. I would suggest getting the wsgiHandler record its presence, to ensure that you are able to stay away from it multiple occasions. If you cannot affect the existing code, it can be done with your personal wrappers for your code's layer (and employ the atmosphere, directly or not directly, to complete it of what is already active).