|
2 | 2 | title: OpenObserve Streaming Search
|
3 | 3 | description: Learn how OpenObserve's Streaming Search delivers incremental query results using HTTP/2 partitioning for faster log analysis and real-time data processing.
|
4 | 4 | ---
|
5 |
| -This user guide provides details on how to configure, and use OpenObserve's **Streaming Search** feature to improve query performance and responsiveness. |
| 5 | +This user guide provides details on how to configure, and use the **Streaming Search** feature to improve query performance and responsiveness. |
6 | 6 |
|
7 | 7 | ## What is Streaming Search?
|
8 | 8 |
|
9 |
| -Streaming Search is a feature that delivers query results incrementally to the user interface using an **HTTP/2** streaming connection. Instead of waiting for the entire query to complete, OpenObserve breaks large queries into smaller partitions and streams the results as they are processed. This allows matching log entries to appear more quickly, even while the query continues to run in the background. |
| 9 | +Streaming Search allows OpenObserve to return query results through a single, persistent HTTP/2 connection. Instead of issuing one HTTP request per partition, the system streams the entire result set over one connection. This reduces overhead, improves dashboard performance, and provides faster response times during long-range queries. |
10 | 10 |
|
11 | 11 | !!! note "Where to Find"
|
12 | 12 | The **Streaming Search** toggle is located under **Management > General Settings**.
|
13 | 13 |
|
14 | 14 | !!! note "Who Can Access"
|
15 | 15 | The `Root` user and any other user with permission to **update** the **Settings** module can modify the **Streaming Search** setting. Access is controlled through role-based access control (RBAC).
|
| 16 | + <br> |
16 | 17 | 
|
17 | 18 |
|
| 19 | +## Concepts |
| 20 | +### Partition |
| 21 | + |
| 22 | +OpenObserve splits the total time range into partitions, each covering a segment of time or data volume. For example, an 8-hour query with 8 GB of data may be split into 8 partitions, each processing 1 GB. These partitions are executed sequentially and contribute partial results to the final output. |
| 23 | + |
| 24 | + |
| 25 | +### Mini-Partition |
| 26 | +Based on the environment variable `ZO_MINI_SEARCH_PARTITION_DURATION_SECS`, the first partition is divided into a mini-partition to return results faster. This is helpful when working with large time ranges. |
| 27 | + |
| 28 | +The environment variable is enabled by default and it defines the duration of the mini-partition in seconds. By default, this is set to 60 seconds. |
| 29 | + |
| 30 | +??? note "See how a mini-partition works:" |
| 31 | + Suppose you run a query over the past 12 hours. |
| 32 | + |
| 33 | + - The first partition might normally span 1 hour of data. |
| 34 | + - The mini-partition splits this into a smaller slice, such as 1 minute by default, or according to the configured duration. |
| 35 | + - This 1-minute slice is processed first and returned quickly, allowing partial results to appear faster, while the rest of the query continues in the background. |
| 36 | + |
| 37 | + > **Note:** Only the first partition is affected. All subsequent partitions are processed at their normal size. |
| 38 | + |
| 39 | +### HTTP/2 Streaming |
| 40 | + |
| 41 | +When **Streaming Search** is enabled, OpenObserve uses a single HTTP/2 connection to send the entire result set. |
| 42 | + |
| 43 | +This enables: |
| 44 | + |
| 45 | +- A larger in-memory cache that persists for the entire query |
| 46 | +- Fewer HTTP round trips |
| 47 | +- Faster response and improved dashboard rendering |
| 48 | + |
| 49 | +> **Note:** When **Streaming Search is enabled**, the mini-partition output is included in the same `_search_stream` response. All data is delivered over a single HTTP/2 connection. You do not see a separate request for the mini-partition. |
18 | 50 |
|
19 | 51 | ## Enable or Disable Streaming Search
|
20 | 52 |
|
21 | 53 | 1. Go to **Management**.
|
22 |
| -2. Select **General Settings**. |
| 54 | +2. Select **General Settings**. <br> |
23 | 55 | 
|
24 | 56 | 3. Locate the **Enable Streaming Search** option.
|
25 | 57 | 4. Toggle this switch to **On** to enable streaming mode, or **Off** to disable it.
|
26 |
| -5. Click **Save** to save the changes. |
27 |
| - |
28 |
| -## How does it work? |
29 |
| - |
30 |
| -### 1. Partitioning |
| 58 | +5. Click **Save** to apply the changes. |
31 | 59 |
|
32 |
| -OpenObserve splits the total time range into partitions, each covering a segment of time or data volume, called **partitions**. For example, an 8-hour query with 8 GB of data may be split into 8 partitions, each processing 1 GB. Each partition is executed independently and contributes partial results to the overall output. |
33 | 60 |
|
34 |
| -Streaming begins as soon as the first partition completes, improving responsiveness. |
| 61 | +## Without Streaming Search |
35 | 62 |
|
36 |
| -### 2. Mini-Partitioning |
| 63 | +- OpenObserve splits the query time range into multiple partitions. |
| 64 | +- Each partition triggers a separate `_search` request. |
| 65 | +- The first partition includes a mini-partition by default. |
| 66 | +- The mini-partition result is returned first in a separate request, followed by results from the full partitions. |
| 67 | +- Each request has its own connection, and there is no query-wide cache across partitions. |
| 68 | +- The browser must wait for multiple independent requests to complete, which can increase load times and perceived delay. |
37 | 69 |
|
38 |
| -Mini-partitioning further breaks the first partition into small slices based strictly on time. Controlled by: `ZO_MINI_SEARCH_PARTITION_DURATION_SECS`=60 (default is 60 seconds) |
| 70 | +**Performance Test: 2-week Dashboard Query** <br> |
39 | 71 |
|
40 |
| -These short-duration partitions are created only at the beginning of the query time range. Enables the result to appear within milliseconds, even if the full partition takes longer. Once mini-partitions complete, the system switches back to processing full-size partitions. |
| 72 | +Panel 1 triggers 7 `_search` requests and completes loading the data in 4.452 seconds. |
| 73 | +<br> |
| 74 | + |
41 | 75 |
|
42 |
| -### 3. Streaming via HTTP/2 |
| 76 | +Panel 2 triggers 57 `_search` requests and completes loading the data in 25.987 seconds. |
| 77 | +<br> |
| 78 | + |
43 | 79 |
|
44 |
| -Results from each partition are sent incrementally to the browser using a single persistent HTTP/2 connection. |
| 80 | +## With Streaming Search |
45 | 81 |
|
46 |
| -### 4. Real-time delivery |
| 82 | +- OpenObserve still splits the query time range into partitions. |
| 83 | +- The first partition includes a mini-partition by default. |
| 84 | +- All partition results, including the mini-partition, are returned through a single `_search_stream` request. |
| 85 | +- The entire result is returned over a single HTTP/2 connection. |
| 86 | +- The system uses a query-wide cache, which improves efficiency and reduces recomputation. |
| 87 | +- There is no duplication of requests, which lowers server and browser load. |
47 | 88 |
|
48 |
| -As each partition is processed, its results are immediately streamed to the user interface. |
| 89 | +**Performance Test: 2-week Dashboard Query** |
49 | 90 |
|
50 |
| -This mechanism avoids delays caused by waiting for the entire result set and is especially useful for long-running or high-volume searches. |
| 91 | +Panel 1 triggers 1 `_search_stream` request and completes loading the data in 393 milliseconds. |
| 92 | +<br> |
| 93 | + |
51 | 94 |
|
| 95 | +Panel 2 triggers 1 `_search_stream` request and completes loading the data in 1.29 seconds. |
| 96 | +<br> |
| 97 | + |
52 | 98 |
|
53 | 99 | ## Considerations
|
54 | 100 |
|
55 | 101 | - Requires HTTP/2 support in the network stack.
|
56 |
| -- Fallbacks to standard query mode if disabled. |
57 |
| -- Partitioning behavior is automatic. Mini-partitioning improves the time-to-first-result without affecting the accuracy of final results. |
| 102 | +- Falls back to standard query mode if disabled. |
| 103 | +- Partitioning behavior is automatic. Mini-partitioning improves the time-to-first-result without affecting the accuracy of final results. |
0 commit comments