Django Sitemap Best Practice

That indicates something seriously wrong with your configuration.

In the absence of more detailed information, my best guess for this is that this is being caused by using too much memory.

What’s the actual size of the sitemap file(s)?

Does it come back eventually, or do you need to reboot the instance?

What size instance is this? Do you have a swap file allocated?

Are you running the database in that same instance?

Are you using something like cgroups or docker to set an upper limit on memory allocation by your Python processes? (I know that uwsgi has some settings to help facilitate that, I don’t know about gunicorn.)

Have you run this in a test environment such that you can determine a memory usage profile from it?

Is it possible for you to divide this large number of urls into sections?