Thursday, November 29, 2012

Re: 504 Gateway Timeout

On Thu, Nov 29, 2012 at 1:01 PM, Jirka Vejrazka
<jirka.vejrazka@gmail.com> wrote:
>> I'm just facing a problem with little longer runnig SQL select command,
>> and DJago framework returns a "504 Gateway Timeout" after aprox 10 seconds.
>> My sql command is executed on Oracle SQL database through
>> "django.db.backends.oracle" driver.
>
> You'd have to change multiple timeouts to make this work. There are several
> approaches in similar situations, pick what suits your situation (which you
> have not described in detail).

Not that many; django itself has no timeouts, so you only need to
adjust the timeouts on your http server. Normally there are several
that apply - a timeout between writes, a timeout for the total
response time, etc. This timeout is happening due to timeout between
writes, so adjusting that one first and seeing where you go would be a
start.

>
> - calculate data *before* user requests it and keep the calculated copy
> - caching of any data that takes long to compute (retrieve) - can and
> should be combined with above
> - using asyncronous queries, typically achived via celery (django-celery)
> and some AJAX calls
>

You missed 'just increase the timeouts', which is architecturally
simpler than any of those options, and may easily fit within the
desired performance for the app - only the OP can know that though.

It is also possible that your query could be optimised. Have you
analysed the query yet? Could additional indices be added to speed up
this particular query?

Cheers

Tom

--
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.

No comments:

Post a Comment