Use SolrMeter to test Solr performance

One of the biggest challenges when conducting performance testing is to know when you've accomplished your goals. SolrMeter, available at http://code.google.com/p/solrmeter/, makes it very easy to test your Solr configuration. When performance testing Solr, you are typically tweaking configuration values such as cache sizes and query parameters in response to two ongoing activities: the pace of the documents being indexed into Solr, and the pace of the queries being issued to Solr. SolrMeter makes it very easy to control the pace of these two activities through a simple GUI tool. SolrMeter brings together both basic load testing functionality with some visualization and analytics of your Solr instance. A typical example is looking at your cache rates. While you can use the Solr Admin Plugins / Stats page to pull back these results, you are only seeing a snapshot in time.

In the following screenshot, you can see a visualization of the queryResultCache over time:

Use SolrMeter to test Solr performance

The middle four slopes were created because I began the Update Console 75 seconds after starting to index new data. You can easily see the impact of commits on the caches. This type of visualization can help you go beyond just using the default caching configurations.

Start SolrMeter with the embedded configuration for the mbartists core by running from ./examples/10/solrmeter:

>>java –Dsolrmeter.configurationFile=./mbartists.smc.xml-jar solrmeter-0.2.0-jar-with-dependencies_3_1_4_0.jar

mbartists.smc.xml specifies to SolrMeter which data files to use to power the queries to be made and the data to be indexed. SolrMeter takes in separate data files to randomly build combinations of queries with filters, faceting, and updates applied.

If you are already using Solr and logging the queries, then you should instead provide an externalQueries.txt file that has the full set of query parameters:

q="Maxtor Corp"+OR+Belkin&rows=5&fq=inStock:true&facet=true&facet.field=price

Just extract the entire line after the ? character logged by the GET requests in the Solr log. This is great for repeating the same set of queries, so you are doing A/B testing as you are tweaking the various settings. SolrMeter also supports exporting the query time and a histogram of the query time in the CSV format to make your own graphs.

You can also use SolrMeter to place a "base" load on a Solr, and then use other testing tools that offer more scripting or analytics options to ensure that what works just fine when Solr isn't under load continues to meet expectations when Solr is under load, for example, you might want to set up 60 updates per minute and 300 queries per minute as a base load. Using SolrMeter, you can quickly set this scenario up, and then use another tool like JMeter that drives your frontend search user interface to ensure your application meets your expected SLA when Solr is under load. Alternatively, you can easily change settings, such as cache configurations or faceting settings, and see the impact that these changes have on performance. Finally, SolrMeter now runs as a command-line application, so you can use it as the heart of automated performance tests.

Tip

I like to build my list of queries for load testing by extracting a day's worth of queries from the existing search engine log or the HTTP web server log files. This gives me a realistic set of data, so I am tuning to what my users actually search for, not what I think they are searching for! SolrMeter can be used for this.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.174.239