On Jan 12, 2013, at 10:41 AM, Roberto De Ioris <[email protected]> wrote:

> Ok, let'see if it is a gevent-plugin problem. Are this requests generated
> by uploads ?

I was using uploads, but I managed to simplify the problem. It definitely seems 
related to wsgi.input. The following results were obtained doing small POST 
requests (just a form parameter) and my django view simply accesses 
request.POST and returns a result, no other subsystem is involved:

Simple POST request (10k)
weakref                    41831
dict                       25607
list                       21980
callback                   20001
function                   11854
builtin_function_or_method 11213
io                         10015
deque                      10003
Greenlet                   10001
_Host                      10000
timer                      10000
tuple                      4806
cell                       2798
wrapper_descriptor         1363
getset_descriptor          1330
type                       1266
method_descriptor          926
member_descriptor          524
module                     499
property                   455

Then I tried the exact same request but 20000 times:

Simple POST request (20k)
weakref                    81831
dict                       46186
list                       41980
callback                   40001
builtin_function_or_method 21213
io                         20015
deque                      20003
Greenlet                   20001
_Host                      20000
timer                      20000
function                   11854
tuple                      4808
cell                       2798
wrapper_descriptor         1363
getset_descriptor          1330
type                       1266
method_descriptor          926
member_descriptor          524
module                     499
property                   455

We can definitely see a correlation between the number of requests and the top 
objects. Then I tried a GET request, again my view just accessed request.GET 
and returned:

Simple GET request(10k)
function                   11854
tuple                      4805
dict                       3494
cell                       2798
list                       1977
weakref                    1831
wrapper_descriptor         1363
getset_descriptor          1330
type                       1266
builtin_function_or_method 1213
method_descriptor          926
member_descriptor          524
module                     499
property                   455
classobj                   279
set                        206
instancemethod             191
ColumnDef                  155
staticmethod               146
FieldDescriptor            126


The top objects are gone. Then I tried again the POST request but with the 
Gevent plugin disabled:

Simple POST request without GEvent plugin (10k)
function                   11854
tuple                      4799
dict                       3691
cell                       2798
list                       2063
weakref                    1833
wrapper_descriptor         1363
getset_descriptor          1330
type                       1266
builtin_function_or_method 1206
method_descriptor          926
member_descriptor          524
module                     499
property                   455
classobj                   279
set                        206
instancemethod             190
ColumnDef                  155
staticmethod               146
FieldDescriptor            126


Again, the top objects previously seen are gone. Then I tried massive downloads 
from my application, this touches several external systems:

1GB download of data
function                   11865
tuple                      4824
dict                       3676
cell                       2798
list                       2214
weakref                    1830
wrapper_descriptor         1360
getset_descriptor          1330
type                       1266
builtin_function_or_method 1213
method_descriptor          925
member_descriptor          524
module                     499
property                   455
classobj                   279
set                        206
instancemethod             191
ColumnDef                  155
staticmethod               146
instance                   137

So GET requests with the Gevent plugin don't seem to exhibit the same problems….

I hope this helps.

André


_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to