Skip to content

Commit

Permalink
Allow the number of max requests to be configured.
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-allan committed Aug 10, 2012
1 parent 4fab0d2 commit 999fc83
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
18 changes: 12 additions & 6 deletions components/tools/OmeroPy/src/omero/plugins/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,17 +422,23 @@ def start(self, args):
cmd = "python manage.py runfcgi workdir=./"
cmd += " method=prefork socket=%(base)s/var/django_fcgi.sock"
cmd += " pidfile=%(base)s/var/django.pid daemonize=true"
cmd += " maxchildren=5 minspare=1 maxspare=5 maxrequests=400"
django = (cmd % {'base': self.ctx.dir}).split()
cmd += " maxchildren=5 minspare=1 maxspare=5"
cmd += " maxrequests=%(maxrequests)d"
django = (cmd % {
'maxrequests': settings.APPLICATION_SERVER_MAX_REQUESTS,
'base': self.ctx.dir}).split()
rv = self.ctx.popen(args=django, cwd=location) # popen
elif deploy == settings.FASTCGITCP:
cmd = "python manage.py runfcgi workdir=./"
cmd += " method=prefork host=%(host)s port=%(port)s"
cmd += " pidfile=%(base)s/var/django.pid daemonize=true"
cmd += " maxchildren=5 minspare=1 maxspare=5 maxrequests=400"
django = (cmd % {'base': self.ctx.dir,
'host': settings.APPLICATION_SERVER_HOST,
'port': settings.APPLICATION_SERVER_PORT}).split()
cmd += " maxchildren=5 minspare=1 maxspare=5"
cmd += " maxrequests=$(maxrequests)d"
django = (cmd % {
'maxrequests': settings.APPLICATION_SERVER_MAX_REQUESTS,
'base': self.ctx.dir,
'host': settings.APPLICATION_SERVER_HOST,
'port': settings.APPLICATION_SERVER_PORT}).split()
rv = self.ctx.popen(args=django, cwd=location) # popen
else:
django = [sys.executable,"manage.py","runserver", link, "--noreload"]
Expand Down
1 change: 1 addition & 0 deletions components/tools/OmeroWeb/omeroweb/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ def leave_none_unset(s):
"omero.web.application_server": ["APPLICATION_SERVER", DEFAULT_SERVER_TYPE, check_server_type],
"omero.web.application_server.host": ["APPLICATION_SERVER_HOST", "0.0.0.0", str],
"omero.web.application_server.port": ["APPLICATION_SERVER_PORT", "4080", str],
"omero.web.application_server.max_requests": ["APPLICATION_SERVER_MAX_REQUESTS", 0, int],
"omero.web.ping_interval": ["PING_INTERVAL", 60000, int],
"omero.web.static_url": ["STATIC_URL", "/static/", str],
"omero.web.staticfile_dirs": ["STATICFILES_DIRS", '[]', json.loads],
Expand Down

0 comments on commit 999fc83

Please sign in to comment.