Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#18147 closed Uncategorized (invalid)

High traffic block

Reported by: yrdnsa@… Owned by: nobody
Component: HTTP handling Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hello,
I am using django 1.3 on apache 2.* on windows server 2008. mysql 5.*

When i try to access a view that does this:
def view(request):
len(User.objects.all())
return HttpResponse()

i have about 9K results on that. i am doing len and not .count, because i want to test the server.

the server becomes reaally slow. i am trying to test how much weight my server could manage, but it seems that 10 parallel requests to that view, slows the response down to 15 seconds!!

THIS IS just an example. i will soon manage many requests, maybe not to that view always, but if 10 requests slows the server down that much, what would 1000 requests do?

Please help. i dont want to migrate fomr django.

is it the data to object proccess? or mysql throughput?

How can i make this to go to a normal speed?

BTW,
even without a view: only py files calling that len(User.objects.all()), slows it really down!

Yarden

Change History (5)

comment:1 by Carl Meyer, 13 years ago

Resolution: invalid
Status: newclosed

The ticket tracker is for specific bugs or proposals to improve Django, not for user support questions. Please see TicketClosingReasons/UseSupportChannels. In this case the database optimization documentation may be helpful. In your specific case, you should be using queryset.count() not len(queryset) - the latter fetches all data from all rows in the queryset. This is by design, and is not a bug.

comment:2 by anonymous, 13 years ago

Resolution: invalid
Status: closedreopened
  1. There is know way to ask questions - there is no forum or support mail.
  2. i have worked with django from Dec 11. i know the count method is better then the len method. counting the results is not the point.

Did you read my post?

comment:3 by anonymous, 13 years ago

Correction: Dec 10'

comment:4 by anonymous, 13 years ago

Resolution: invalid
Status: reopenedclosed

in reply to:  2 comment:5 by Aymeric Augustin, 13 years ago

Replying to anonymous:

  1. There is know way to ask questions - there is no forum or support mail.

There is.

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