Prosthetic Conscience

Jason McBrayer's weblog; occasional personal notes and commentary

Wed, 19 Apr 2006

A very useful patch to django

The photo gallery application I’m working with allows you to upload batches of photographs as zip files, to populate a gallery all at once. As it stands in django, this zipfile is temporarily held entirely in memory. For substantially large zipfiles, as one might expect to upload to a photogallery, this will drive memory usage up quite a bit. An example file I was testing from here actually OOM-ed on the little server I’m running it on. Even for a file that does not OOM, it may easily cause the FastCGI connection to time-out (and I imagine the consequences could be even worse in mod_python).

While looking for a solution, I found this patch, which solves the issue. Moderately large files are processed reasonably quickly now, and server memory usage is much closer to what would normally be expected.

Consider this a vote for inclusion of this patch in trunk.

[ Posted: 15:43] | [ Category: ] | Permalink | Comments: 0 ]

 


Powered by PyBlosxom