Opened 7 years ago

Closed 5 years ago

#9232 closed (worksforme)

problems with streaming files uplod with Django 1.0

Reported by: faheem Owned by: nobody
Component: File uploads/storage Version: 1.0
Severity: Keywords: streaming file upload
Cc: faheem@… Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by ramiro)

Hi,

I just upgraded to Django 1.0, and I've just finished fixing all my
unit tests. However, streaming file uploads are still broken. The
behaviour I'm seeing is as follows:

When I start the upload of the file, a file which looks like
eg. /tmp/tmpGjWpee.upload appears almost immediately, but does not
change in size thereafter. The size is either empty or 16M - 16M most
of the time. I haven't seen any other values appear. The file upload
completes some of the time, regardless, but is very slow. For very
large files, like 1g, it took so long I stopped it.

I've seen this behavior on two independent installations of 1.0, with
the same project/application. I have a different installation with a
pre-1.0 snapshot with a patch from #2070 applied, and that works fine
with an earlier version of the same model/application, with the
temporary file in /tmp appearing and growing in size as the upload
progresses, as expected.

I've created a small test project which shows the behavior, which I
attach. This was used on Debian with a source installation of Django
1.0, and Apache 2 with the mod_wsgi module.

The apache config appears
below. This is on Debian etch, with the following installed.

faheem@wsgi:/var/django/testproj/testapp$ dpkg -l | grep apache
ii  apache2                         2.2.3-4+etch5                            Next generation, scalable, extendable web se
ii  apache2-mpm-prefork             2.2.3-4+etch5                            Traditional model for Apache HTTPD 2.1
ii  apache2-utils                   2.2.3-4+etch5                            utility programs for webservers
ii  apache2.2-common                2.2.3-4+etch5                            Next generation, scalable, extendable web se
ii  libapache2-mod-python           3.2.10-4                                 Apache 2 module that embeds Python within th
ii  libapache2-mod-wsgi             2.0-1~bpo40+1                            Python WSGI adapter module for Apache

Sincerely, Faheem Mitha.

*****************************************************************
# Testproj config.
Alias /media_testproj/ /var/django/media_testproj/
<Directory /var/django/media_testproj>
Order deny,allow
Allow from all
</Directory>

WSGIScriptAlias /testproj /var/django/testproj/apache/django.wsgi
<Directory /var/django/testproj/apache>
Order deny,allow
Allow from all
</Directory>
******************************************************************

Attachments (1)

testproj.tar.gz (5.4 KB) - added by faheem 7 years ago.
tarball of test project to reproduce problem

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by faheem

tarball of test project to reproduce problem

comment:1 Changed 7 years ago by ramiro

  • Description modified (diff)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Re-formatted Description field. Next time please remember to use the Preview button.

comment:2 Changed 7 years ago by faheem

  • Cc faheem@… added

I thought updates to the ticket would automatically be sent to the submitter, but
this doesn't appear to be the case. So, CCing myself.

comment:3 Changed 7 years ago by jacob

  • Triage Stage changed from Unreviewed to Design decision needed

I've never seen this behavior myself, and I can't replicate it with the attached test project. I have to wonder if it's something specific to your server. It's been some months: is this still going on with 1.0.2? How about trunk?

comment:4 Changed 6 years ago by faheem

Hi Jacob,

Thanks for the response, and apologies for the slow reply - I'm currently visiting India. I'll try to test with more recent versions of Django when I get a chance. As regards something specific to my server, the only thing I can think of is that I use linux vservers for testing. I run apache + django inside the vserver and contact it from the host. This enables me to run different setups on the same machine. However, this setup worked fine till now, so I can't imagine why it should now be a problem. I'll also try testing without the use of a vserver.

comment:5 Changed 6 years ago by faheem

Update. Back from India, and tested my setup in a normal server, and it appears to behave normally.
So, looks like this is a vserver issue. What is the attitude towards the project wrt running django inside a virtual machine?

Regards, Faheem Mitha.

comment:6 Changed 5 years ago by adamnelson

  • Resolution set to worksforme
  • Status changed from new to closed

Django should work in a VM, but by the same token, a VM shouldn't act any differently than a real machine at this level. If this is replicable now on a VM, feel free to reopen.

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