django-storages
実行時に S3Boto バックエンドを使用すると、メモリ リークのような現象が発生します。default_storage.exists()
ここのドキュメントに従っています: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html
私の設定ファイルの関連部分は次のとおりです。
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
問題を繰り返すために私がすることは次のとおりです。
./manage.py shell
from django.core.files.storage import default_storage
# Check default storage is right
default_storage.connection
>>> S3Connection:s3.amazonaws.com
# Check I can write to a file
file = default_storage.open('storage_test_2014', 'w')
file.write("does this work?")
file.close()
file2 = default_storage.open('storage_test_2014', 'r')
file2.read()
>>> 'does this work?'
# Run the exists command
default_storage.exists("asdfjkl") # This file doesn't exist - but the same thing happens no matter what I put here - even if I put 'storage_test_2014'
# Memory usage of the python process creeps up over the next 45 seconds, until it nears 100%
# iPython shell then crashes
>>> Killed
私が考えた唯一の潜在的な問題は、私の S3 バケットに 93,000 個のアイテムがあることです。もしそうなら、きっと別の方法があるに違いない?残念ながら、sorl-thumbnail は新しいサムネイルを生成するときにこの .exists() 関数を使用するため、サムネイルの生成が非常に遅くなります。