diff --git a/README.md b/README.md index 70be53d53..53e7fbb3d 100644 --- a/README.md +++ b/README.md @@ -437,7 +437,7 @@ sudo python-pip install docker-registry[bugsnag] #### Run it ``` -gunicorn --access-logfile - --debug -k gevent -b 0.0.0.0:5000 -w 1 docker_registry.wsgi:application +gunicorn --access-logfile - -k gevent -b 0.0.0.0:5000 -w 4 --max-requests 100 docker_registry.wsgi:application ``` ### How do I setup user accounts? diff --git a/docker_registry/app.py b/docker_registry/app.py index 7d6297a1d..6e7c974e0 100644 --- a/docker_registry/app.py +++ b/docker_registry/app.py @@ -19,7 +19,8 @@ # logging has been configured cfg = config.load() logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s', - level=getattr(logging, cfg.loglevel.upper())) + level=getattr(logging, cfg.loglevel.upper()), + datefmt="%d/%b/%Y:%H:%M:%S %z") from .lib import mirroring from .server import __version__ diff --git a/docker_registry/run.py b/docker_registry/run.py index f60ea07f7..2171caed6 100644 --- a/docker_registry/run.py +++ b/docker_registry/run.py @@ -41,6 +41,7 @@ GUNICORN_GROUP: unix group to downgrade priviledges to GUNICORN_ACCESS_LOG_FILE: File to log access to GUNICORN_ERROR_LOG_FILE: File to log errors to +GUNICORN_OPTS: extra options to pass to gunicorn """ @@ -70,7 +71,6 @@ def run_gunicorn(): gunicorn_path, 'gunicorn', '--access-logfile', env.source('GUNICORN_ACCESS_LOG_FILE'), '--error-logfile', env.source('GUNICORN_ERROR_LOG_FILE'), - '--debug', '--max-requests', '100', '-k', 'gevent', '--graceful-timeout', env.source('GUNICORN_GRACEFUL_TIMEOUT'), diff --git a/docker_registry/wsgi.py b/docker_registry/wsgi.py index 3f174783e..2bef9f53f 100755 --- a/docker_registry/wsgi.py +++ b/docker_registry/wsgi.py @@ -22,9 +22,6 @@ port = env.source('REGISTRY_PORT') app.debug = True app.run(host=host, port=port) - # Or you can run: - # gunicorn --access-logfile - --log-level debug --debug -b 0.0.0.0:5000 \ - # -w 1 wsgi:application else: # For uwsgi app.logger.setLevel(logging.INFO) diff --git a/requirements/main.txt b/requirements/main.txt index b34717e90..7d3e6b409 100644 --- a/requirements/main.txt +++ b/requirements/main.txt @@ -2,7 +2,7 @@ blinker==1.3 Flask==0.10.1 Flask-cors==1.3.0 gevent==1.0.1 -gunicorn==18.0 +gunicorn==19.1 PyYAML==3.11 requests==2.3.0 rsa==3.1.4