You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/article/lawn.tex
+25-28
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@
37
37
\makesavenoteenv{tabular}
38
38
\makesavenoteenv{table}
39
39
40
-
\title{Timer Lawn: Solving the Timer Wheel Overflow Problem Using Unbound Low Latency Timer Data Structure for Large Scale and High Throughput Systems}
40
+
\title{Timer Lawn: Solving the Timer Wheel Overflow Problem for Large Scale and High Throughput Systems}
41
41
42
42
43
43
\author{
@@ -102,26 +102,24 @@ \subsection{List and Tree Based Schemes}
The Hashed Timing Wheel was designed to be an all-purpose timer storage solution for a unified system of known size and resolution\cite{TW87, TW, TWI, largescale, autoscale}. While previous work has shown that Hashed Timing Wheels have optimal run-time complexity, and in ideal conditions are in fact, optimal, real-world implementations would suffer from either being bound by maximal TTL and resolution combination, or would require a costly ($O(n)$) run-time re-build upon of the data structure upon reaching such limits (in \cite{CQ} it is referred to as "the overflow problem"). For large numbers of timers, producers, or consumers as is common in large scale operations, the simplest and mose effective solution is to overestimate the needed resolution and/or TTL so to abstain from rebuilding for as long as possible.
105
+
The Hashed Timing Wheel was designed to be an all-purpose timer storage solution for a unified system of known size and resolution\cite{TW87, TW, TWI, largescale, autoscale}. While previous work has shown that Hashed Timing Wheels have optimal run-time complexity, and in ideal conditions are in fact, optimal, real-world implementations would suffer from either being bound by maximal TTL and resolution combination, or would require a costly ($O(n)$) run-time re-build upon of the data structure upon reaching such limits (in \cite{CQ} it is referred to as "the overflow problem"). For large numbers of timers, producers, or consumers as is common in large scale operations, the simplest and mose effective solution is to overestimate the needed resolution and/or TTL so to abstain from rebuilding (resizing) for as long as possible.
106
106
107
107
\subsection{Overflow Algorithms}
108
108
in order to handle overflows correctly there are two valid options:
109
-
\subsubsection{increase current wheel slots (Alg. \ref{alg:overflow_rebuild})} Rebuild the overflowing wheel so it would include a larger number of slots into the future. This change entails a worst case cost of $O(n)$ upon any addition of an overflowing timer.
110
-
\subsubsection{in place addition of cycle count for each item (Alg. \ref{alg:overflow_inplace})} Each element in a slot is also stored with the number of wheel cycles needed before element expiration. This change entails a worst case cost of $O(n)$ for all \textit{PerTickBookkeeping} operation.
111
-
109
+
\subsubsection{increase current wheel slots (Alg. \ref{alg:overflow_resize})} Resize the overflowing wheel so it would include a larger number of slots into the future. This change entails a worst case cost of $O(n)$ upon any addition of an overflowing timer.
112
110
113
111
\begin{algorithm}
114
-
\caption{Timer Wheel Data Store Rebuild algorithm\label{alg:overflow_rebuild}}
@@ -131,8 +129,10 @@ \subsubsection{in place addition of cycle count for each item (Alg. \ref{alg:ove
131
129
\end{algorithm}
132
130
133
131
132
+
\subsubsection{in place addition of cycle count for each item (Alg. \ref{alg:overflow_inplace})} Each element in a slot is also stored with the number of wheel cycles needed before element expiration. This change entails a worst case cost of $O(n)$ for all \textit{PerTickBookkeeping} operation.
133
+
134
134
\begin{algorithm}
135
-
\caption{Timer Wheel Data Store Multipass (in-place) algorithm\label{alg:overflow_inplace}}
Unlike the state-of-the-art Timer Wheel algorithm, Lawn enables the simultaneous timer handling and bookkeeping by splitting the buckets between several worker processesor threads, adding or removing workers as needed. This method enables usage of the Lawn algorithm in highly parallel applications and does not require the use of semaphores than other synchronization mechanisms within the bucket level.
302
+
Unlike the state-of-the-art Timer Wheel algorithm, Lawn enables the simultaneous timer handling and bookkeeping by splitting the buckets between several worker processes, threads or even different machines altogether, adding or removing workers as needed. This method enables usage of the Lawn algorithm in large scale or highly parallel applications and does not require the use of semaphores than other synchronization mechanisms within a single bucket.
306
303
307
304
308
305
\subsection{Known implementations of Lawn}
@@ -316,8 +313,8 @@ \subsection{Known implementations of Lawn}
316
313
\end{enumerate}
317
314
318
315
\section{Conclusion}
319
-
Lawn is a simplified overflow-free algorithm that displays near-optimal results for use cases involving many (millions) concurrent timers from large scale (tens of thousands) of independent machine systems.
320
-
Using Lawn is an elegant solution to the overflow problem in Timer Wheel and other current algorithms, requiring less knowledge about the usage pattern with the only requirement is for the TTLs being discrete and bound, but not what the bounds are.
316
+
Lawn is a simplified overflow-free algorithm that displays near-optimal results for use cases involving many (tens of millions) concurrent timers from large scale (tens of thousands) independent machine systems.
317
+
Using Lawn is an elegant solution to the overflow problem in Timer Wheel and other current algorithms, enabling simpler use of available cores and requiring less knowledge about the usage pattern with the only requirement is for the TTLs being discrete and their number being bound, but not knowing what the bound on max TTL is.
321
318
The algorithm is currently deployed and in use by several organizations under real-world load, all reporting satisfactory results.
0 commit comments