Code

Opened 2 years ago

Closed 2 years ago

Last modified 2 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

Attachments (0)

Change History (5)

comment:1 Changed 2 years ago by carljm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

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 follow-up: Changed 2 years ago by anonymous

  • Resolution invalid deleted
  • Status changed from closed to reopened
  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 Changed 2 years ago by anonymous

Correction: Dec 10'

comment:4 Changed 2 years ago by anonymous

  • Resolution set to invalid
  • Status changed from reopened to closed

comment:5 in reply to: ↑ 2 Changed 2 years ago by aaugustin

Replying to anonymous:

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

There is.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.