You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hasjob stores jobpost stickie impressions per session but displays statistics per unique user. This stat is cached in Redis but needs to be recalculated after every impression, ie after anyone visits the home page. This is obviously a huge drain on the database, and precise up-to-the-second counts are not necessary for anyone.
Hasjob should instead:
When saving an impression, mark the jobpost's count as dirty and save this dirty flag to Redis. Do not recalculate.
In JobPost.viewcounts, recalculate as usual only if the count is missing in Redis, and also remove from the dirty set.
Add a new periodic job to manage.py (alongside sweep) that runs every five minutes, recalculates totals for all items in the dirty list, repopulates cache in redis, and removes each item from the dirty set.
In #309 we discuss the possibility of removing past JobImpression and EventSession data, requiring these totals to be stored somewhere more permanent than Redis. This exercise is left for a future issue.
The text was updated successfully, but these errors were encountered:
Hasjob stores jobpost stickie impressions per session but displays statistics per unique user. This stat is cached in Redis but needs to be recalculated after every impression, ie after anyone visits the home page. This is obviously a huge drain on the database, and precise up-to-the-second counts are not necessary for anyone.
Hasjob should instead:
JobPost.viewcounts
, recalculate as usual only if the count is missing in Redis, and also remove from the dirty set.sweep
) that runs every five minutes, recalculates totals for all items in the dirty list, repopulates cache in redis, and removes each item from the dirty set.In #309 we discuss the possibility of removing past
JobImpression
andEventSession
data, requiring these totals to be stored somewhere more permanent than Redis. This exercise is left for a future issue.The text was updated successfully, but these errors were encountered: