Opened 16 years ago

Closed 16 years ago

Last modified 12 years ago

#9106 closed Uncategorized (wontfix)

django.views.static.serve reads entire file in to memory

Reported by: Michael Manfre Owned by: nobody
Component: Uncategorized Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

django.views.static.serve eats a lot of memory when serving large files in a dev environment. Instead of doing open(fullpath, 'rb').read(), it would be friendlier if it passed an iterator to HttpResponse.

Attached is a patch.

Attachments (1)

django-static-serve-chunks.diff (1.1 KB ) - added by Michael Manfre <mmanfre@…> 16 years ago.

Download all attachments as: .zip

Change History (5)

by Michael Manfre <mmanfre@…>, 16 years ago

comment:1 by Matt McClanahan, 16 years ago

Triage Stage: UnreviewedDesign decision needed

This is a small part of a much larger issue. See #7581 for some discussion of the various subtle challenges to streaming HttpResponses.

comment:2 by Malcolm Tredinnick, 16 years ago

Resolution: wontfix
Status: newclosed

I don't think this is worth it. We're not guaranteeing that HttpResponse won't read the contents into memory either (which might be necessary to fix some other bugs). This is the development server. If things are getting that tight memory-wise, you can fairly rapidly switch to using a real webserver for serving the static data.

It's fairly borderline, but things like this that are trying to extend the envelope for the development server "just a bit further" usually feel like cases where you should just configure Apache or something and use that. It's not that hard.

comment:3 by (none), 16 years ago

milestone: post-1.0

Milestone post-1.0 deleted

comment:4 by Aymeric Augustin, 12 years ago

Easy pickings: unset
Severity: Normal
Type: Uncategorized
UI/UX: unset

Well, this was reported again as #15281 and fixed.

Note: See TracTickets for help on using tickets.
Back to Top