Open strcrzy opened 10 years ago
On Tue, Feb 18, 2014 at 04:40:18PM -0800, jamie brim wrote:
when only the registry is hosted on AWS and docker is not, docker is able to pull from the registry, but at very slow speeds (20k/s).
I don't know much about Flask, but it would be nice to use sendfile to stream image layers if the kernel supports it. Unfortunately, native sendfile support only landed in Python 3.3 1. It looks like there is some Flask-side support though 2, so maybe it wouldn't be too difficult to do. The current storage.local.LocalStorage.stream_read reads the file into local memory before passing it on to Flask, which seems inefficient.
@wking sendfile is perfect when you deliver your object from a local storage (from the local disk for instance). However since docker-registry supports a set of storage backend (s3, google storage, etc...), objects are served from those remote sources. Sendfile is useless unless we would buffer on the disk first.
To answer @strcrzy problem, I think it looks like a configuration issues. Have you tried with the registry container[1]?
If you use s3, I recommend configuring a LRU cache[2] on the front, it will cache most of the calls to S3.
[1] https://index.docker.io/_/registry/ [2] https://github.com/dotcloud/docker-registry#performance-on-prod
@samalba - thanks for the suggestion!
i haven't tried the registry container, how would i configure it? there doesn't seem to be a default config.yml bundled with it.
the only way i could figure out to bundle my own config was to build a container for myself with the dockerfile. is there a config provided at some later stage somehow that i am interfering with?
On Wed, Feb 19, 2014 at 10:26:00AM -0800, jamie brim wrote:
i haven't tried the registry container, how would i configure it? there doesn't seem to be a default config.yml bundled with it.
It should use config_sample.yml because of this Dockerfile line 1. You can use environment variable to tune the config to match your local setup.
thank you that makes sense now.
so switching to the registry container and passing in env vars appropriately, including redis vars, does fix my speed issue pulling remotely, but i still have a problem with pulling from AWS machines. it does not appear to be a connectivity issue, as both pushing and the GET requests for both the /v1/_ping
and the /v1/images
calls make it to the server, but then it just hangs again.
i'm at a loss really, any more hints would be greatly appreciated
Have you tried the prod setup on AWS + S3? After you set the right config fields, you can switch the registry to prod flavor by setting the env var SETTINGS_FLAVOR=prod before starting the registry. If the registry runs in a docker container, you can specify the env var using the docker cli as an argument to 'run'.
Note that you can also use the container and provide your own config by mounting the config directory in a volume.
this is how i currently invoke the registry container:
docker run \
-e STORAGE_PATH=/registry \
-e SETTINGS_FLAVOR=prod \
-e AWS_ACCESS_KEY_ID=<key> \
-e AWS_SECRET_KEY=<secret> \
-e S3_BUCKET=sra-registry \
-e CACHE_REDIS_HOST=172.17.42.1 \
-e CACHE_LRU_REDIS_HOST=172.17.42.1 \
-e CACHE_REDIS_PORT=6379 \
-e CACHE_LRU_REDIS_PORT=6379 \
-e CACHE_REDIS_PASSWORD=password \
-e CACHE_LRU_REDIS_PASSWORD=password \
-p 5000:5000
registry
this configuration still stalls on docker pull unfortunately :(
i am able to start the registry, and push to it, but pulling seems to fail miserably. when both the registry and docker are hosted on AWS, things hang at the
Pulling fs layer
part. when only the registry is hosted on AWS and docker is not, docker is able to pull from the registry, but at very slow speeds (20k/s).i am able to push to the registry from both of these locations without incident the registry config, and logs for one of the pulls are below. i have tried using both the prod and dev flavors, with no luck with either. i feel like i'm missing something, but i can't seem to zero in on it.