SF-sketch: slim-fat-sketch with GPU assistance

Tong Yang, Lingtong Liu, Yibo Yan, Muhammad Shahzad, Yulong Shen, Xiaoming Li, Bin Cui, Gaogang Xie

Abstract

A sketch is a probabilistic data structure used to record frequencies of items in a multi-set. Sketches are widely used in various fields, especially those that involve processing and storing data streams. In streaming applications with high data rates, a sketch "fills up" very quickly. Thus, its contents are periodically transferred to the remote collector, which is responsible for answering queries. In this paper, we propose a new sketch, called Slim-Fat (SF) sketch, which has a significantly higher accuracy compared to prior art, a much smaller memory footprint, and at the same time achieves the same speed as the best prior sketch. The key idea behind our proposed SF-sketch is to maintain two separate sketches: a small sketch called Slim-subsketch and a large sketch called Fat-subsketch. The Slim-subsketch is periodically transferred to the remote collector for answering queries quickly and accurately. The Fat-subsketch, however, is not transferred to the remote collector because it is used only to assist the Slim-subsketch during the insertions and deletions and is not used to answer queries. We implemented and extensively evaluated SF-sketch along with several prior sketches and compared them side by side. Our experimental results show that SF-sketch outperforms the most widely used CM-sketch by up to 33.1 times in terms of accuracy.

The Problem: Bandwidth and Accuracy

In modern networking and big data, counting occurrences of millions of items (like IP packets) in real-time is a critical task. Because memory is limited, probabilistic data structures called sketches are used to trade a small amount of accuracy for a significantly reduced memory footprint.

However, as data rates skyrocket, these sketches fill up quickly and must be sent to a remote collector for analysis. This creates two primary challenges:

  1. The Bandwidth Bottleneck: Transmitting large sketches consumes excessive network capacity.
  2. The Accuracy Gap: To keep transmitted sketches small, accuracy is often sacrificed due to "over-estimation error," where multiple items hash to the same memory slot and their counts become conflated.

Existing solutions like the Count-Min (CM) sketch are fast but suffer from low accuracy, while others like the Conservative Update (CU) sketch improve accuracy but fail to support item deletions—a requirement for many dynamic applications.

The SF-sketch Architecture

The proposed SF-sketch (Slim-Fat sketch) addresses these issues through a two-stage architecture that decouples local monitoring from remote querying.

The SF-sketch architecture separates the structure into a Slim-subsketch for queries and a Fat-subsketch for local update assistance.
  • Slim-subsketch: A memory-efficient sketch that is periodically sent to the remote collector. This is the only component used to answer queries.
  • Fat-subsketch: A much larger sketch that resides exclusively on the local monitoring node (e.g., a router). It acts as a "buffer" or "advisor" to the Slim-subsketch, leveraging the fact that local memory is often more plentiful than transmission bandwidth.

Guided Updates and Deletions

The core innovation of SF-sketch is its "Guided Update" mechanism. When a new item arrives, it is first recorded in the Fat-subsketch. The system then queries the Fat-subsketch to obtain a more accurate estimate of the item's frequency. The Slim-subsketch is only incremented if its current value is lower than this estimate. This filtering process drastically reduces over-estimation error in the transmitted sketch.

Illustration of item insertion into the sketch structure, showing how counters are updated across buckets.

To support deletions, SF-sketch uses the Fat-subsketch to verify if a counter in the Slim-subsketch represents the "largest" item in its bucket. If it does, and that item is being deleted, the Slim counter is allowed to decrement. This prevents the under-estimation errors that typically plague sketches when deletions are introduced.

Performance and Key Results

The authors evaluated SF-sketch using real-world network traffic (230K flows) and synthetic datasets (Uniform and Zipfian distributions). Key findings include:

  • Unprecedented Accuracy: SF-sketch outperformed the standard CM-sketch by up to 33.1 times in average relative error.
  • High Throughput: By utilizing GPU acceleration (NVIDIA Tesla C2075), the SF-sketch achieved a query throughput of over 110 million queries per second (Mqps). On a 24-thread CPU, it reached 16.3 Mqps.
  • Efficiency: SF-sketch requires significantly less memory than the CU-sketch to reach a 1% error rate, while maintaining query speeds identical to the fastest prior art.

Conclusion

SF-sketch demonstrates that by treating memory as an asymmetric resource—plentiful locally but scarce for transmission—it is possible to achieve massive gains in accuracy without sacrificing speed. While the two-stage update introduces a slight overhead, the use of hardware acceleration ensures it remains viable for high-speed data links.

Summary updated

BibTeX
@article{yang2020sf,
  author = {Tong Yang and Lingtong Liu and Yibo Yan and Muhammad Shahzad and Yulong Shen and Xiaoming Li and Bin Cui and Gaogang Xie},
  title = {{SF-sketch: slim-fat-sketch with GPU assistance}},
  journal = {IEEE Trans. Parallel Distributed Syst.},
  year = {2020},
  url = {https://openreview.net/forum?id=jt7UkeYjra},
}
Figure