python - Django localmem size -
what default size of local memory cache django. https://docs.djangoproject.com/en/1.8/ref/settings/ not mention any. https://docs.djangoproject.com/en/1.8/topics/cache/#cache-arguments says 300, following code returns different value:
for in range(0, 10000): cache.set(i, i) first = cache.get(0) if first none: print break
i have seen values ranging 150ish 1500ish.
thanks!
the default cache size 300, according code.
your snippet won't tell useful size of cache. when locmem cache full, subsequent set cause evict items based solely on modulus of key's position in dict, unpredictable. there no attempt evict based on lru, fifo or other algorithm.
this yet reason not use backend n production.
Comments
Post a Comment