Given a large log file where each line is "timestamp,user,action", compute the number of sessions per user. Assume a session ends if the gap between consecutive events for the same user exceeds a configurable timeout T minutes. The file may not be sorted; define the expected input format (e.g., ISO 8601 timestamps), describe how you would parse and group events by user, handle out-of-order records, and process data that does not fit in memory (e.g., streaming or external sort). Provide time and space complexity, discuss optimizations (e.g., indexing, windowing), and outline test cases and edge conditions (empty users, single event, boundary at exactly T, malformed lines).