Thursday, January 10, 2013

AW: Execution time of a long process results in an Internal Server Error 500

I've had the exact same problem a couple of weeks ago.

There is a timout that you can define for apache however it somehow didn't take when i tried it.

You really should consider a background task, as Bill suggested.

 

For me it was a query that took forever. I was able to cut the time in half by going through this:

https://docs.djangoproject.com/en/1.1/topics/db/optimization/

 

Especially select_related() helped a lot !

https://docs.djangoproject.com/en/1.1/ref/models/querysets/#select-related

 

 

Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im Auftrag von Bill Freeman
Gesendet: Donnerstag, 10. Jänner 2013 14:47
An: django-users@googlegroups.com
Betreff: Re: Execution time of a long process results in an Internal Server Error 500

 

Maybe.  But it's generally considered a bad idea to tie up a request thread for that long.

A more common solution is to arrange for a background task to do the heavy lifting.

If the user must know when the task is done, you can poll in JavaScript.

Bill

On Thu, Jan 10, 2013 at 8:21 AM, Mauro Sánchez <mauroka@gmail.com> wrote:

Hello, I have a process that takes about 2 or 3 minutes to execute. The problem is that sometimes (not always) it results in an Internal Server Error 500 because of the time it takes.
Is there a way to configure Apache or mod_wsgi to prevent this? Let's say, that even if the process takes 10 or 15 minutes it just keeps running until it finish?
Thanks a lot for the help.
Cheers,
Mauro.

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

 

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

 

. . . . . . . . . . . . . . . . . . . . . . . . . .

Ing. Patrick Szabo

Developer

LexisNexis

A-1030 Wien, Marxergasse 25

 

Patrick.Szabo@lexisnexis.at

Tel.: +43 1 53452 1573

Fax.: +43 1 534 52 146

. . . . . . . . . . . . . . . . . . . . . . . . . .

 

No comments:

Post a Comment