You will find below my WSGI script. But how can I fix the number of
processes/thread wsgi is handling. As mentionned earlier, when I stress test
the application, the parser we are using is preloading again and again. This
is what we would like to preload. And we also would like to avoid new
processes/thread to start. Is this a wrong approach?
import os, sys
# django site WSGI handler
# project root dir
project_root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),
'../../..'))
project_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),
'../..'))
#site_packages_dir = os.path.abspath(os.path.join(project_root_dir,
'site-packages'))
os.environ['PYTHON_EGG_CACHE'] = os.path.join(project_root_dir, 'tmp')
# This is because portable WSGI applications should not write to sys.stdout
or
# use the 'print' statement without specifying an alternate file object
# besides sys.stdout as the target.
sys.stdout = sys.stderr
sys.path.append(project_root_dir)
sys.path.append(project_dir)
sys.path.append("%s/_vendors" % project_dir)
sys.path.append("%s/_lib" % project_dir)
import logging
from drlog import RequestLogger
logging.setLoggerClass(RequestLogger)
from django.core.handlers.wsgi import WSGIHandler
_application = WSGIHandler()
def application(environ, start_response):
os.environ['USER'] = environ['USER']
os.environ['DJANGO_SETTINGS_MODULE'] = environ['DJANGO_SETTINGS_MODULE']
return _application(environ, start_response)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---