Replies: 2 comments 2 replies
-
| 
         This thing is not being mentioned for the first time. But query from alias actually is very slow compared with specific daily index with specific time range. Query performance impact leads to functional issues.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Compare to elastic index challenges, the cost of elastic is actually becoming an unacceptable issue, rather than these unbalanced and other issues.  | 
  
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Search before asking
Description
1. Background
The current implementation writes data to Elasticsearch by creating a new index for each day (e.g.,
skywalking_segment-20250724). While this approach is straightforward for low data volumes, it presents significant challenges as the amount of data grows. When daily data volume is high, this strategy leads to massive single-day indices (potentially hundreds of gigabytes), causing severe issues:2. Proposed Solution
We propose migrating from the daily index pattern to a strategy that leverages Elasticsearch's built-in Index Lifecycle Management (ILM) combined with a Rollover Alias.
The core concept of this strategy is:
skywalking_segment). Both writes and queries will target this alias.15GBor its age reaches2d), ILM automatically creates a new index and seamlessly switches the write alias (is_write_index: true) to it.3. Implementation Steps
The complete implementation involves the following four key steps:
Step 1: Create an ILM Policy
Define a policy that specifies the conditions for the rollover and delete actions.
15GBor the index is2days old. The data will be automatically deleted after7days.Step 2: Create an Index Template
Create a template to automatically apply the ILM policy and settings to all new indices matching the
skywalking_segment-*pattern.skywalking_segment-will be associated with theskywalking_segment_ilm_policyand useskywalking_segmentas its rollover alias.Step 3: Create the Bootstrap Index
Manually create the very first index and assign the alias to it, explicitly marking it as the write index.
skywalking_segment-000002,skywalking_segment-000003, etc.) will be created and managed automatically by ILM.Step 4: Modify Application Code
This is the most critical change. All logic in the application code that writes to and queries from Elasticsearch must be updated:
skywalking_segment-20250724) to the fixed aliasskywalking_segment.skywalking_segment. Since the alias points to all relevant active indices (e.g.,skywalking_segment-000001,skywalking_segment-000002), querying the alias will search across all necessary data.4. Advantages
Adopting this solution will yield significant benefits:
max_primary_shard_size, we ensure that every shard remains within a healthy and efficient size range, preventing giant shards.5. Potential Impact
skywalking_segment-20250724) with the new write alias (e.g.,skywalking_segment).Conclusion:
This optimization is a critical step to ensure the system remains performant and highly available as data volumes continue to scale. We strongly recommend that the core development team evaluate and adopt this proposal.
Use case
Data Storage, Logging Module, Elasticsearch Integration
Related issues
Optimize storage
Are you willing to submit a pull request to implement this on your own?
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions