Facebooktwittergoogle_plusredditpinterestlinkedinmail

I am using two tool to benchmark query performance of an Elasticsearch server. Initially I faced problem to test elasticsearch query performance for large elasticsearch query as it’s very hard to put large query in command line. Then I found these two tool, having support to pass json as a POST parameter.

Tools are :
1) Siege
2) AB(Apache Bench)

1) Siege:
To setup siege in your linux system please follow the step by step guideline provide in this post. Write down you elasticsearch query in url.txt in POST parameter like below:

$ http://localhost:9200/index/type/_search POST {"query":{"filtered":{"query":{"match_all":{}},"filter":{"bool":{"must":[{"term":{"post_author":"1007"}},{"term":{"country":"USA"}},{"range":{"post_id":{"from":10,"to":20}}},{}]}}}}}

You can pass POST parameter in command line argument as well. I will prefer this way when my elasticsearch query is small.

$ siege -u 'http://localhost:9200/index/type/_search POST {"query":{"filtered":{"query":{"match_all":{}},"filter":{"bool":{"must":[{"term":{"post_author":"1007"}}]}}}}}' -r2 -c2 -v

2) AB(Apache Bench):

Please follow the instruction which is given in my earlier post to setup AB tool.

To test Elasticsearch query in AB tool write down you query in a json file and pass that json file in -p post parameter. Pass content-type parameter in ab command in case you are passing elasticsearch query in some other format file( may be query.txt).

ab -n 10 -c 10 -p /path/to/json/query.json http://localhost:9200/index/type/_search/

or

ab -n 10 -c 10 -p /path/to/json/query.json -T "application/json; charset=utf-8" http://localhost:9200/index/type/_search/

Hope this will help you. In case of any query feel free to email me at info@techieroop.com.

Test Elasticsearch Query Performancehttp://techieroop.com/wp-content/uploads/2015/07/test-elasticsearch-query-performance.pnghttp://techieroop.com/wp-content/uploads/2015/07/test-elasticsearch-query-performance-150x127.png Roopendra DevOPSElasticsearchTesting,,,
I am using two tool to benchmark query performance of an Elasticsearch server. Initially I faced problem to test elasticsearch query performance for large elasticsearch query as it's very hard to put large query in command line. Then I found these two tool, having support to pass json as...
I am using two tool to benchmark query performance of an Elasticsearch server. Initially I faced problem to test elasticsearch query performance for large elasticsearch query as it's very hard to put large query in command line. Then I found these two tool, having support to pass json as a POST parameter.<strong>Tools are :</strong> 1) Siege 2) AB(Apache Bench)<strong>1) Siege:</strong> To setup siege in your linux system please follow the step by step guideline provide in<a title="Siege Installation " href="http://techieroop.com/siege-a-simple-load-testing-and-benchmarking-tool/#.Vas85flF76A" target="_blank"> this post.</a> Write down you elasticsearch query in <strong>url.txt</strong> in POST parameter like below: <pre>$ http://localhost:9200/index/type/_search POST {"query":{"filtered":{"query":{"match_all":{}},"filter":{"bool":{"must":[{"term":{"post_author":"1007"}},{"term":{"country":"USA"}},{"range":{"post_id":{"from":10,"to":20}}},{}]}}}}}</pre> You can pass POST parameter in command line argument as well. I will prefer this way when my elasticsearch query is small. <pre>$ siege -u 'http://localhost:9200/index/type/_search POST {"query":{"filtered":{"query":{"match_all":{}},"filter":{"bool":{"must":[{"term":{"post_author":"1007"}}]}}}}}' -r2 -c2 -v</pre> <strong>2) AB(Apache Bench):</strong>Please follow the instruction which is given in my earlier post to<a title="AB Tool Setup" href="http://techieroop.com/performance-benchmark-using-apache-bench-tool/#.Vas2QPlF76A" target="_blank"> setup AB tool</a>.To test Elasticsearch query in AB tool write down you query in a json file and pass that json file in <strong>-p</strong> post parameter. Pass content-type parameter in ab command in case you are passing elasticsearch query in some other format file( may be query.txt). <pre>ab -n 10 -c 10 -p /path/to/json/query.json http://localhost:9200/index/type/_search/</pre> or <pre>ab -n 10 -c 10 -p /path/to/json/query.json -T "application/json; charset=utf-8" http://localhost:9200/index/type/_search/</pre> Hope this will help you. In case of any query feel free to email me at info@techieroop.com.
(Visited 2,667 times, 63 visits today)
Facebooktwittergoogle_pluslinkedinrss