[Groonga-commit] droonga/drnbench at 48a10d2 [master] Add how to run benchmark for a regular HTTP server

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Jan 16 12:27:59 JST 2014


YUKI Hiroshi	2014-01-16 12:27:59 +0900 (Thu, 16 Jan 2014)

  New Revision: 48a10d25af3a99c9c8e9d2cdf4eb3faff7a7d3a3
  https://github.com/droonga/drnbench/commit/48a10d25af3a99c9c8e9d2cdf4eb3faff7a7d3a3

  Message:
    Add how to run benchmark for a regular HTTP server

  Modified files:
    README.md

  Modified: README.md (+92 -5)
===================================================================
--- README.md    2014-01-16 12:12:38 +0900 (aaba768)
+++ README.md    2014-01-16 12:27:59 +0900 (43c4e8a)
@@ -4,17 +4,104 @@
 
 Drnbench is a benchmark tool for Droonga.
 
-It may be used for other HTTP servers (in future versions).
+It may be used for other HTTP servers.
 
 
 ## How to run benchmark?
 
-### Benchmarking of request-responsne style commands, with a Droonga Engine instance
+### Benchmarking with an HTTP server
 
-Drnbench can benchmark performance of a Droonga Engine with random requests.
+Drnbench can benchmark performance of an HTTP server with random requests.
 
-In this scenario, you have to prepare patterns of requests for commands.
-Drnbench will start multiple clients and send many requests based on the patterns file, via fluentd protocol (msgpack).
+In this scenario, you have to setup an HTTP server and prepare patterns of requests.
+Drnbench will start multiple clients and send many requests based on the patterns file.
+
+ 1. Create a patterns file in the format:
+    
+        {
+          "(pattern type 1 name)": {
+            "frequency": (appearance ratio in all requests),
+            "path":      "(path to the endpoint)",
+            "method":    "(HTTP method)",
+            "patterns":  [
+              { "body": (request body 1 sent by POST method) },
+              { "body": (request body 2 sent by POST method) },
+              ...
+            ]
+          }
+          "(patterns type 2 name)": {
+            "frequency": (appearance ratio in all requests),
+            "patterns":  [
+              {
+                "path":   "(path to the endpoint 1)",
+                "method": "(HTTP method)",
+                "body":   (request body 1 sent by POST method)
+              },
+              {
+                "path":   "(path to the endpoint 2)",
+                "method": "(HTTP method)",
+                "body":   (request body 2 sent by POST method)
+              },
+              ...
+            ]
+          },
+          ...
+        }
+    
+    For example, a file "patterns.json" like:
+    
+        {
+          "user search": {
+            "frequency": 0.61,
+            "method":    "GET",
+            "patterns":  [
+              { "path": "/users?q=foo" },
+              { "path": "/users?q=bar" },
+              ...
+            ]
+          },
+          "item search": {
+            "frequency": 0.32,
+            "method":    "GET",
+            "patterns":  [
+              { "path": "/items?q=foo" },
+              { "path": "/items?q=bar" },
+              ...
+            ]
+          },
+          ...
+        }
+    
+ 2. Setup an HTTP server. For example, localhost:80.
+ 4. Run drnbench with the pattern file.
+    
+        # cd ~/drnbench
+        # RUBYLIB=lib/ bin/drnbench \
+            --start-n-clients=1 \
+            --end-n-clients=32 \
+            --step=1 \
+            --duration=10 \
+            --wait=0.01 \
+            --mode=http \
+            --request-patterns-file=/tmp/patterns.json \
+            --host=localhost \
+            --port=80
+    
+ 5. You'll get a result like:
+    
+        n_clients,total_n_requests,queries_per_second,min_elapsed_time,max_elapsed_time,average_elapsed_time,200
+        1,33,3.3,0.164632187,0.164632187,0.19133309036363635,0
+        2,70,7.0,0.161510877,0.161510877,0.1846983412285715,0
+        3,87,8.7,0.1658357,0.1658357,0.24303329366666668,0
+        ...
+
+
+### Benchmarking of request-responsne style commands, with a Droonga-based search system
+
+Drnbench can benchmark performance of a Droonga-based search system with random requests.
+
+In this scenario, you have to setup a Droonga-based search system and prepare patterns of requests for commands.
+Drnbench will start multiple clients and send many requests based on the patterns file.
 
  1. Create a patterns file in the format:
     
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index