You cannot be mistaken in any of the proposed solutions if you do not have a ginourmous number of sessions. And what I am saying is what you must compare.
The timer module is implemented as an ordered table ets, where ets: first you can efficiently find the first timer, which should expire and sleep until this happens. Thus, there is no problem adding many thousands of timers through the timer module. One per session.
If you have so many sessions, the fault-tolerant design problem is probably the more serious problem. You will need to distribute your session database so that the requests can be load balanced and you are not vulnerable to any one web server machine.
And that’s how I feel that it can be without functional requirements.
Christian
source share