Emulating Large -scale Video Playback

February 5, 2014

One key feature of JunctionTV OTT Platform is its fine-grained video analytics. All our apps are instrumented with ability to report complete playback event sequence (Start/Pause/Resume/Stop). Naturally the Platform must support an ability to log and process this data at large scale. This led us to the question of how to test the functionality and limits of the Video Analytics system.

We quickly converged on the core requirement – to build a system that emulates subscriber behavior. We also needed an ability to tune the subscriber load as well as the playback behavior to be able to test and benchmark the Analytics system. During the initial design phases, it became clear that this system can serve as the core for large-scale testing of all our APIs. So not just tuning, but flexibility to model arbitrary subscriber behavior became crucial.

To facilitate the above requirements, the system models two key independent entities: Subscriber and Behavior (which in generic terms translate to Actor and Action). This separation enables us to work with arbitrary Subscriber-related properties (like Arrival patterns, Activity duration, Geographic distribution, etc) and Behavior models (like video playback sequence).

With the core design in place, the immediate task at hand was to add Video Playback Event Generation capability. For this, an event scheduler is added to the system. Again, with flexibility in mind, the scheduler framework works with arbitrary event types and arbitrary schedule generators. Specifically, for video playback sequence emulations, the scheduler takes as input the hourly average subscribers in a day with flexibility to provide date-time range when the events should be fired.

As a base case, the scheduler chooses the subscriber arrival times as a Poisson process. The inter-arrival delay is chosen from an exponential distribution. For this the following Probability density function (pdf) of an exponential distribution is

formu1

The quantile function (inverse cumulative distribution function) for Exp(λ) is

Formula

i.e., we can get the inter-arrival time between two events from its quantile function.

We take the subscriber inter-arrival time from this distribution and let the subscriber choose a video from our library (uniformly chosen). Using the duration of the video as the activity period, now we can generate several events for the subscriber – whether the video is watched to the end, the number of pause/resumes, the duration of pauses, etc. A complete subscriber session can be automatically be generated with the ability to tune the system to simulate arbitrary load and playback behavior.

Armed with this module, we can now deploy it on multiple servers and stress test like never before!