openrijal
openrijal

Reputation: 583

502 Bad Gateway for Large Requests (nginx + django)

I have a site running django with nginx. It is running good, but there are some sections where I get 502 Bad Gateway.

After a bit of analysis, I figure out the pages to be the ones with large contents in them while loading.

For Example: I have "college" app and "course" app. A college can have many courses, now if I try to edit a college with less than 10 courses, it works well, if I try to edit a college with more than 10 courses, it gives me 502 Bad Gateway. This has happened with all such colleges.

Any kind of help would assist. I have already tried increasing server limits.

Upvotes: 3

Views: 2062

Answers (1)

skyl
skyl

Reputation: 11

Try select_related in your FKs:

This can limit the number of round-trips to the database which can be the biggest performance problem for Django.

Upvotes: 1

Related Questions