Streaming algorithms are fundamental in the analysis of large and online datasets. A key component of many such analytic tasks is \emph{\qMAX}, which finds the largest $q$ values in a number stream. Modern approaches attain a constant runtime by removing small items in bulk and retaining the largest $q$ items at all times. Yet, these approaches are bottlenecked by an expensive quantile calculation. This work introduces a quantile-sampling approach called SQUID and shows its benefits in multiple analytic tasks. Using this approach, we design a novel weighted heavy hitters data structure that is faster and more accurate than the existing alternatives. We also show SQUID's practicality for improving network-assisted caching systems with a hardware-based cache prototype that uses SQUID to implement the cache policy. The challenge here is that the switch's dataplane does not allow the general computation required to implement many cache policies, while its CPU is orders of magnitude slower. We overcome this issue by passing just SQUID's samples to the CPU, thus bridging this gap. In software implementations, we show that our method is up to 6.6x faster than the state-of-the-art alternatives when using real workloads. For switch-based caching, SQUID enables a wide spectrum of data-plane-based caching policies and achieves higher hit ratios than the state-of-the-art P4LRU.
翻译:流式算法是分析和处理大规模在线数据集的基础。许多此类分析任务的核心组件是\emph{\qMAX},其目标是在数据流中找出最大的$q$个值。现有方法通过批量移除较小数据项并始终保持最大的$q$个数据项,实现了恒定运行时间。然而,这些方法受限于昂贵的分位数计算过程。本研究提出了一种名为SQUID的分位数采样方法,并展示了其在多种分析任务中的优势。基于该方法,我们设计了一种新颖的加权高频项数据结构,其速度更快且精度优于现有方案。我们还通过基于硬件的缓存原型验证了SQUID在改进网络辅助缓存系统中的实用性,该原型使用SQUID实现缓存策略。此处的挑战在于交换机的数据平面无法支持实现多数缓存策略所需的通用计算,而其CPU性能又存在数量级差距。我们通过仅向CPU传递SQUID的采样数据来突破这一瓶颈。在软件实现中,采用真实工作负载测试表明,本方法比现有最优方案的运行速度提升最高达6.6倍。对于基于交换机的缓存场景,SQUID支持广泛的数据平面缓存策略,并实现了比当前最优的P4LRU更高的缓存命中率。