On Sat, Apr 16, 2011 at 7:10 AM, Toni Milovan <tmilo...@gmail.com> wrote:
> I'm getting 20-30 seconds delay when trying to bind request.POST data > to form. > > ----- > CompanyFormset = modelformset_factory(Company, > form=EditCompanyForm, extra=0) > > if request.method == 'POST': > formset = CompanyFormset(request.POST, request.FILES) > if formset.is_valid(): > formset.save() > > ------- > > It just happens on one server, and on this line: "formset = > CompanyFormset(request.POST, request.FILES)". I have tried without > request.FILES and without multipart data and always getting the same > delay. I have also tried runing development server and mod_wsgi and > results are the same. > > Delay only happens when binding request data, if I just try to save > formset everything is fast as it should be. Also, on my development > laptop there is no delay whatsoever. On the same server I have other > sites and everything works well so I just have no idea where else I > could look for solution. > > Does anyone have any idea what can cause such behavior? > No clue. How have you determined that that line of code is taking 20 seconds to run? Since you say you can recreate with the dev server on this machine, I would probably tackle this with pdb by putting a breakpoint before that code, stepping into the execution of CompanyFormset(request.POST, request.FILES), and then stepping through the code to narrow down where the big delay is. Karen -- http://tracey.org/kmt/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.