blog-post

Manticore Load Emulator

TL;DR

Manticore Load Emulator एक ओपन-सोर्स बेंचमार्किंग टूल है जो आपको अपने Manticore Search डिप्लॉयमेंट का सत्यापन और ऑप्टिमाइज़ करने में मदद करता है। चाहे आप एक उत्पादन डिप्लॉयमेंट की योजना बना रहे हों, प्रदर्शन मुद्दों को डिबग कर रहे हों, या अपने कॉन्फ़िगरेशन को ठीक कर रहे हों, यह टूल वास्तविक-समय की निगरानी और विस्तृत विश्लेषण के साथ व्यापक परीक्षण क्षमताएँ प्रदान करता है। सरलता और शक्ति के लिए बनाया गया, यह बुनियादी प्रश्न परीक्षण से लेकर जटिल मल्टी-प्रोसेस वर्कलोड अनुकरण तक सब कुछ सपोर्ट करता है।

Introduction

यहाँ एक मजेदार तथ्य है: जब लोग पूछते हैं कि क्या Manticore उनके वर्कलोड को संभाल सकता है, तो हम इसे एक चुनौती के रूप में लेते हैं। और जब प्रदर्शन हमारे लिए इतना मायने रखता है, तो आपको तैयार रहना चाहिए। प्रस्तुत है Manticore Load Emulator — एक ओपन-सोर्स टूल जो Manticore (और आपका हार्डवेयर) को उसकी सीमाओं तक लाने के लिए डिज़ाइन किया गया है।

चाहे आप जानना चाहते हों कि क्या Manticore आपके अनूठे सेटअप को संभाल सकता है या बस इसे अधिकतम प्रदर्शन दिलाने के लिए देख रहे हों, यह टूल आपके लिए तैयार है।

आप इसे GitHub पर प्राप्त कर सकते हैं या हमारे रिपॉजिटरी से पैकेज के रूप में इंस्टॉल कर सकते हैं (Manticore संस्करण > 6.3.8)।

Why We Built It

हमसे अक्सर पूछा जाता है: “क्या Manticore मेरे वर्कलोड को संभाल सकता है?” खैर, संक्षिप्त उत्तर सामान्यतः “हाँ” होता है। लेकिन आपको हमारा शब्द स्वीकार करने के बजाय, हमने एक टूल बनाया ताकि आप इसे स्वयं परख सकें। Manticore Load Emulator पारदर्शिता और सशक्तिकरण के बारे में है—उसके साथ, आपके हार्डवेयर को उसकी सीमाओं तक ले जाकर आनंद भी आता है।

Use Cases

1. Performance Validation for New Deployments

Manticore Search के साथ लाइव जाने से पहले, अपने अपेक्षित वर्कलोड का अनुकरण करने के लिए Load Emulator का उपयोग करें। यह सुनिश्चित करता है कि आपकी अवसंरचना सही तरीके से स्केल और कॉन्फ़िगर की गई है ताकि अधिकतम प्रदर्शन हो सके।

2. Debugging and Troubleshooting

नियंत्रित परीक्षण चलाकर बाधाओं या प्रदर्शन में गिरावट का पता लगाएँ। उदाहरण के लिए, यह विश्लेषण करें कि कैसे विशिष्ट प्रश्न पैटर्न या बड़े डेटा सेट प्रश्न की लेटेंसी और थ्रूपुट को प्रभावित करते हैं।

3. Optimization of Existing Setups

बचत आकार, धागे की संख्या, या प्रश्न कैशिंग जैसे कॉन्फ़िगरेशन को ठीक करें ताकि इष्टतम प्रदर्शन प्राप्त हो सके। स्वचालित तुलना के लिए हायपरपैरामीटर टेस्टिंग फीचर का उपयोग करें।

4. Evaluating Infrastructure Changes

क्या आप अपने हार्डवेयर को अपग्रेड करने, डेटाबेस के शार्दिंग को समायोजित करने या किसी अन्य क्लाउड प्रदाता पर जाने की योजना बना रहे हैं? Load Emulator आपको विभिन्न सेटअप के बीच प्रदर्शन बेंचमार्क और तुलना करने की अनुमति देता है।

5. Stress Testing for Scalability

कठोर वर्कलोड का अनुकरण करें ताकि यह मूल्यांकन किया जा सके कि आपका डिप्लॉयमेंट भारी ट्रैफिक के तहत कितना अच्छी तरह स्केल कर सकता है। यह विशेष रूप से उत्पाद लॉन्च या मौसमी स्पाइक्स जैसी घटनाओं के लिए तैयारी के लिए उपयोगी है।

Key Features

यहाँ हैं कि क्यों Manticore Load Emulator बेंचमार्किंग और परीक्षण के लिए एक बेहतरीन टूल है:

1. SQL-Powered Simplicity

यह टूल Manticore के SQL सपोर्ट का लाभ उठाता है, जिससे यह विभिन्न प्रकार के वर्कलोड का अनुकरण करना आसान हो जाता है। अपने लोड या प्रश्न परिलक्षित परिदृश्यों को लिखना SQL कमांड लिखने जितना सरल है।

2. High Concurrency Support

एकाधिक धागों और प्रक्रियाओं का उपयोग करके वास्तविक दुनिया के उच्च-लोड परिदृश्यों का अनुकरण करें। अगर आपका सर्वर इसे संभाल सकता है, तो यह टूल इसे उसकी सीमा तक ले जाएगा।

3. Custom Query Generation

लचीले पैटर्न के साथ डाइनामिक प्रश्न उत्पन्न करें, यादृच्छिक टेक्स्ट से लेकर पूर्णांक, फ्लोट्स, या एरे के सटीक रेंज तक:

  • value उपयोग करने के लिए सटीक मान
  • <increment> 1 से शुरू होने वाला स्वचालित वृद्धि करने वाला मान
  • <increment/1000> 1000 से शुरू होने वाला स्वचालित वृद्धि करने वाला मान
  • <string/3/10> 3 से 10 के बीच लंबाई की यादृच्छिक स्ट्रिंग
  • <text/20/100> 20 से 100 शब्दों वाली यादृच्छिक टेक्स्ट
  • <text/{/path/to/file}/10/100> फ़ाइल से शब्दों का उपयोग करते हुए यादृच्छिक टेक्स्ट, 10 से 100 शब्द
  • <int/1/100> 1 और 100 के बीच यादृच्छिक पूर्णांक
  • <float/1/1000> 1 और 1000 के बीच यादृच्छिक फ्लोट
  • <boolean> यादृच्छिक सत्य या असत्य
  • <array/2/10/100/1000> 2-10 तत्वों का एरे, मान 100-1000
  • <array_float/256/512/0/1> 256-512 यादृच्छिक फ्लोट्स का एरे, मान 0 और 1 के बीच

4. Batch Loading

कॉनफिगरेबल बैच आकार के साथ एक बार में लाखों रिकॉर्ड लोड करें।

5. Real-Time Monitoring & Analytics

व्यापक मैट्रिक्स के साथ अपने परीक्षण प्रदर्शन को ट्रैक करें जिसमें शामिल हैं:

  • प्रगति और थ्रूपुट (QPS)
  • विस्तृत लेटेंसी प्रतिशत
  • प्रदर्शन बाधाओं की पहचान
  • वास्तविक-समय की स्थिति अपडेट

6. Flexible Configuration

कमांड-लाइन तर्क आपको अपने वर्कलोड के हर पहलू को संशोधित करने देता है। क्या आपको कई प्रकार के प्रश्नों का अनुकरण करना है? विभिन्न वर्कलोड को समानांतर में चलाने के लिए --together विकल्प का उपयोग करें।

7. Hyperparameter Testing

एक ही रन में थ्रेड की संख्या या बैच के आकार की तुलना करें, कॉमा से अलग किए गए मानों के साथ। उदाहरण के लिए:

--threads=1,2,4,8 --batch-size=100,1000,10000

8. Quiet Mode for Analysis

--quiet मोड में, टूल सेमीकोलन से अलग परिणाम प्रदान करता है जो सीधे Google Sheets या Excel में कॉपी करके दृश्य बनाने में आसान है।

9. Multi-Process Support

क्या आपको शार्डेड सेटअप या एक साथ कई वर्कलोड का परीक्षण करने की आवश्यकता है? यह शक्तिशाली फ्लैग आपको उसी परीक्षण सत्र के भीतर समानांतर में कई परीक्षण कॉन्फ़िगरेशन चलाने की अनुमति देता है। परीक्षणों को अनुक्रमिक रूप से चलाने के बजाय, जो समय लेने वाला हो सकता है, --together आपके परीक्षण चलाता है और उन्हें एक ही कुशल निष्पादन में मिलाता है।

उदाहरण के लिए, आप कर सकते हैं:

  • अपने डेटाबेस के कई शार्दों का एक साथ परीक्षण करें
  • विभिन्न डेटाबेस संस्करणों के खिलाफ वही परीक्षण सूट चलाएँ
  • विभिन्न कॉन्फ़िगरेशन सेटिंग्स के बीच अपने आवेदन की पुष्टि करें
  • विभिन्न सेटअप के बीच प्रदर्शन मैट्रिक्स की तुलना करें

Simply append --together to your test command, and specify multiple test configurations. The tool will handle the parallel execution while keeping the results organized and easily comparable.

10. Graceful Shutdown

If you need to stop mid-test (or accidentally hit Ctrl+C), the tool ensures a clean termination without leaving things messy.

11. Two Modes of Latency Tracking

  • Histogram-Based: Memory-efficient and approximate for broad trends
  • Precise: For exact latency percentiles, because sometimes precision is key

Getting Started

Here’s a quick example to get you started:

Example 1: Simple Insert

Insert 1 million integers in batches of 10K:

manticore-load \
  --drop \
  --init="create table t(a int)" \
  --load="insert into t values(0, <int/1/1000000>)" \
  --batch-size=10000 \
  --total=1000000

example 1

Example 2: Simulating Concurrency

7-8% CPU load and 160K docs per second seems too low for your workload? Let’s load it up by increasing the thread count:

manticore-load \
  --drop \
  --init="create table t(a int)" \
  --load="insert into t values(0, <int/1/1000000>)" \
  --batch-size=10000 \
  --threads=16 \
  --total=10000000

example 2

OK, now we got 665K at 25% CPU load. Looks like we can squeeze more from the instance, but it requires writing to multiple tables at once. Let’s do that:

Example 3: Sharded Workload

Test a sharded environment by loading data into multiple tables simultaneously:

manticore-load --quiet \
  --drop \
  --init="create table t(a int)" \
  --load="insert into t values(0, <int/1/1000000>)" \
  --batch-size=10000 \
  --threads=8 \
  --total=5000000 \
  --together \
  --drop \
  --init="create table t2(a int)" \
  --load="insert into t2 values(0, <int/1/1000000>)" \
  --batch-size=10000 \
  --threads=8 \
  --total=5000000 \
  --together \
  --drop \
  --init="create table t3(a int)" \
  --load="insert into t3 values(0, <int/1/1000000>)" \
  --batch-size=10000 \
  --threads=8 \
  --total=5000000 \
  --together \
  --drop \
  --init="create table t4(a int)" \
  --load="insert into t4 values(0, <int/1/1000000>)" \
  --batch-size=10000 \
  --threads=8 \
  --total=5000000

example 3

Too much data and you don’t need the progress? By adding --quiet flag, the tool will output only the final results:

example 3-2

Example 4: Combining Writes and Reads

Previous examples were focused on loading data. What if you want to test write/read performance? Let’s also use a more realistic workload than just integers.

manticore-load \
  --total=1000000 \
  --batch-size=10000 \
  --drop \
  --init="create table products(name text, price float, stock int)" \
  --load="insert into products(name, price, stock) values('<text/3/10>', <float/1/100>, <int/1/100>)" \
  --together \
  --total=10000 \
  --load="select * from products where match('<text/2/5>') and price < 10"

example 4

We can see how the read performance degrades as more data is loaded.

Example 5: Hyperparameter Testing

Let’s test how different thread counts affect the performance:

manticore-load \
  --total=10000 \
  --quiet \
  --threads=1,4,8,16,32,64 \
  --load="select * from products where match('<text/2/5>') and price < 10"

example 5

We can see that with the current schema and 1 million docs in the table the throughput can be up to 9858 selects per second at 4.3ms average latency with 6.5ms p95 latency.

Isn’t it great you can make such conclusions in just a couple of minutes?

Conclusion

Manticore Load Emulator is more than just a benchmarking tool—it’s your partner in ensuring optimal performance for your search deployments. Whether you’re running a small proof-of-concept or scaling to handle millions of queries, this tool provides the insights you need to make informed decisions about your infrastructure and configuration.

Remember: the best performance testing is iterative. Start small, gather data, make adjustments, and test again. With Manticore Load Emulator, you have all the tools you need to build and validate a high-performance search solution.

मैंटीकोर सर्च इंस्टॉल करें

मैंटीकोर सर्च इंस्टॉल करें