|
I have a forum (http://forum.hudsonbelfast.com) written in Django/Python that essentially consists of the following model setup:
Reply is specifically structured like this:
The views are fairly simple, viewing posts, viewing profiles, registration/authentication flows, etc. However it is beginning to hit a few limits with regards to memory. I've investigated a bit with
To clarify, I understand how to cache when it comes to Django, however I'm finding it tricky to imagine a good way to cache my views and maintain a real-time feel to the forum (which tends to have quite a fast turnover in new posts). Caching views involving posts or replies seems like it would inhibit that real-time action. Ultimately I could start archiving old posts, however this would be a last resort. |
|
If you need to figure out where Django is using memory, then use a memory profiler. Here's one: Profiling Django object size and memory usage with Pympler |
Hi,
Have you tried adding an index to your database table? This by itself should help a lot.
I tried creating one on (id, post_id) in the model (that I've just now added to my original post), but it didn't really help a noticeable amount.