Where should you start improving the search experience, and what will bring the most value at different steps? We’ve created an ebook with a detailed roadmap to the advanced search experience.
Site searchers produce up to 14% of overall revenue, and site search optimization increases conversion rates by 43%. Having a site search is not enough though. There is a lot of work behind optimizing its performance to provide the fastest and most accurate match to search queries. There may be various challenges related to performance, such as increased traffic and workloads, search latency, downtime, irrelevant results, and more.
How to understand what component of your system may misbehave, and what would add an excess network hop? As an Elasticsearch consulting company, we want to share some of our insights. In this article, we've put together some of the best tips from Wise software engineers on how to tune Elasticsearch search performance and what metrics to keep an eye on to know how things are going.
Configuration of internal site search is a part of custom E-commerce development. One of the most common tools that can be used to configure site search is Elasticsearch. It is an incredibly powerful analytics engine that is ideal for huge databases with a large catalog and hundreds of real-time customers. It supports multi-tenancy and has the ability to store, search, and analyze document files in diverse formats. There are lots of benefits to configuring site search with Elasticsearch, but the scaling of its performance is a far more challenging task.
Elasticsearch use cases include multiple situations when sites suffer from poor search performance, and often they remain overlooked. As for reasons why it might happen, there are several aspects to consider. Here are the tips that will help you to discover slow search faster and fix performance issues.
This piece of advice is related to Elasticsearch monitoring. To ensure efficient work of the site searcg, we need to understand the current performance level. The Elasticsearch system unites multiple components, and each of them affects its overall performance. Here are some of the most crucial indicators to keep an eye on.
The important place in search performance tuning is taken up by the choice of your hardware. Adding extra hardware isn't the only solution for scaling Elasticsearch. It goes beyond that. Even the most diligent optimization efforts are useless if you don't have the necessary hardware. When you are dealing with a massive quantity of data and want to provide your customers with speedy access to it, hardware is crucial.
Here are some suggestions for expanding your current Elasticsearch installation.
Make sure you can readily increase hardware resources, such as processor performance, memory capacity, and so on, to respond to unforeseen traffic spikes.
Every time you start an Elasticsearch instance, you start a node. A cluster is a group of nodes that are all connected to each other. By default, HTTP and transport traffic can be handled by every node in the cluster. As a rule, there may be multiple nodes running in production with a large number of requests being processed, which might add an excess network hop.
Load balancing is a straightforward technique to distribute the load coming to an endpoint across multiple nodes. More specifically, it will distribute requests, gather results after processing, and then merge these results to construct and provide a final result. You may also specify the number of load balancers and configure them accordingly. As a result, load balancing decreases the strain on a specific node, enhancing performance.
How to enable load balancing in Elasticsearch? The Elasticsearch cluster includes load balancers by default. When creating an elasticsearch.url that refers to all/any coordinating nodes, we also recommend employing a load balancer or round-robin DNS server. A load balancer allows you to switch, add, or delete data nodes and coordinating nodes without having to edit the main configuration file or restart the service, reducing downtime for any changes.
Data in an Elasticsearch index can grow to massive proportions. To keep it manageable, Elasticsearch supports the concept of a cluster in which multiple nodes run on one or more host machines, which can be grouped into a cluster with a unique name. These clustered nodes hold up the entire data in the form of documents and provide the functionality of indexing and searching those documents.
Sharding is the process of splitting up the data in an index into numerous smaller pieces for easier querying. All queries in Elasticsearch are processed on a single thread for each shard. However, numerous shards can be run simultaneously. Therefore, many shards would result in several concurrent threads. Having the right number of shards is important for performance.
Elasticsearch organizes its data into indices. There is no hard and fast rule about the number of indices you need to save information, but here are some of our recommendations that may help you.
Elasticsearch takes some time to index new data, so it can't be quickly accessed. In-memory storage is made available when indexing is complete. Whenever a refresh occurs, this information is saved to the segment. Reloading a website would achieve the same effect. The frequency of refreshes is controlled by the refresh interval. Results are automatically updated once per second with a preset refresh period of one second.
The default settings are to refresh the indexes every second for search queries that have been consecutive in the past 30 seconds. If your index is often searched, Elasticsearch will update the index every second. Increase the index if you can afford to increase the period between when a document is indexed and when it becomes visible. Setting the refresh interval to a higher number, such as 300 s (5 minutes), may assist in increasing the indexing speed.
The standard refresh rate should be sufficient in most situations. However, you should consider what is most suitable for you. There is a cost associated with maintaining and regularly updating indexes. A daily refresh is sufficient if you don't want data in near-real-time; for instance, if you only deal with data from the previous day.
Every index stores information in a set of documents. If documents are well-formatted, requests may be fulfilled more quickly. Queries are slowed down by parent-child and nested fields. If you want your queries to return results quickly, you should strive to make the documents as flat as possible. Here are several of our recommendations to do so.
Some third-party plugins generate a large amount of useless data in your database. If your database transactions become slow, look for large tables and what data is stored in them. Determine the source of the slowness and delete any data that you no longer require.
MySQL is capable of detecting and logging your slowest database requests. Enable this logging to discover the queries that are slowing down your site the most; you may then cache these searches in an in-memory store like Redis or Memcached, or delete the data (and plugin) completely if it is no longer required. If you have influence over the architecture of your database, make sure that columns that are often fetched during site searches are indexed.
Decide on a caching technique for your site early on. Caching pages and queries allows your site to fetch them faster, which improves speed. At the same time, it is recommended not to cache out-of-stock levels and other ephemeral data. Doing so would result in a confusing and irritating experience for your clients.
Keep track of the correct quantity of things in stock so that out-of-stock products aren't displayed and cached as available. If you sell through a lot of different channels, you might want to use a centralized stock management system to keep track of all the goods that come in and go out and to automatically clear your site's cache when this system changes.
One of the most important aspects of a successful E-commerce project is having a highly-performing search functionality. But, customer expectations nowadays are high. Even if you have an effective site search solution in place, you will always find the need to update and improve search performance to make it flexible enough to meet ever-changing customer requirements.
Here are key takeaways from our article that will help you to improve Elasticsearch search performance.
Elasticsearch search performance tuning is rather a complex task. So be cautious while adjusting any settings in the production environment. Book Elasticsearch consulting to figure out what’s best for your case or let us help you configure everything for you.
Perhaps you've just decided to start using Elasticsearch, or maybe you're currently an Elasticsearch user who envisions a lot of scope for your company, we are ready to help you. The Wise team can assemble a dedicated team to ensure end-to-end Elasticsearch integration and handle all the technical challenges of your case. Contact us to discuss details.