简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM