Skip to content

Commit

Permalink
Create gh-pages branch via GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
sysulq committed Jan 12, 2015
0 parents commit 36cb70d
Show file tree
Hide file tree
Showing 9 changed files with 769 additions and 0 deletions.
Binary file added images/bg_hr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/blacktocat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icon_download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/sprite_download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
272 changes: 272 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,272 @@
<!DOCTYPE html>
<html>

<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="description" content="Httpmq : A simple HTTP message queue written in Go with goleveldb, just like httpsqs wriiten in C with Tokyo Cabinet.">

<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">

<title>Httpmq</title>
</head>

<body>

<!-- HEADER -->
<div id="header_wrap" class="outer">
<header class="inner">
<a id="forkme_banner" href="https://github.com/hnlq715/httpmq">View on GitHub</a>

<h1 id="project_title">Httpmq</h1>
<h2 id="project_tagline">A simple HTTP message queue written in Go with goleveldb, just like httpsqs wriiten in C with Tokyo Cabinet.</h2>

<section id="downloads">
<a class="zip_download_link" href="https://github.com/hnlq715/httpmq/zipball/master">Download this project as a .zip file</a>
<a class="tar_download_link" href="https://github.com/hnlq715/httpmq/tarball/master">Download this project as a tar.gz file</a>
</section>
</header>
</div>

<!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer">
<section id="main_content" class="inner">
<h1>
<a id="httpmq" class="anchor" href="#httpmq" aria-hidden="true"><span class="octicon octicon-link"></span></a>httpmq</h1>

<p>This program is a simple HTTP message queue written in Go with gdleveldb, just like httpsqs wriiten in C with Tokyo Cabinet.</p>

<h1>
<a id="feature" class="anchor" href="#feature" aria-hidden="true"><span class="octicon octicon-link"></span></a>Feature</h1>

<ul>
<li>Very simple, less than 300 lines Go code.</li>
<li>Very fast, more than 10000 requests/sec.</li>
<li>High concurrency, support the tens of thousands of concurrent connections.</li>
<li>Multiple queue.</li>
<li>Low memory consumption, mass data storage, storage dozens of GB of data takes less than 100MB of physical memory buffer.</li>
<li>Convenient to change the maximum queue length of per-queue.</li>
<li>Queue status view.</li>
<li>Be able to view the contents of the specified queue ID.</li>
<li>Multi-Character encoding support.</li>
</ul>

<h1>
<a id="usage" class="anchor" href="#usage" aria-hidden="true"><span class="octicon octicon-link"></span></a>Usage</h1>

<pre><code> Usage of ./httpmq:
-auth="": auth password to access httpmq
-buffer=4: write buffer(MB)
-cache=8: cache size(MB)
-cpu=1: cpu number for httpmq
-db="level.db": database path
-ip="0.0.0.0": ip address to listen on
-maxqueue=1000000: the max queue length
-port="1218": port to listen on
-readtimeout=15: read timeout for an http request
-verbose=true: output log
-writetimeout=15: write timeout for an http request
</code></pre>

<ol>
<li>
<p>PUT text message into a queue</p>

<p>HTTP GET protocol (Using curl for example):</p>

<pre><code>curl "http://host:port/?name=your_queue_name&amp;opt=put&amp;data=url_encoded_text_message&amp;auth=mypass123"
</code></pre>

<p>HTTP POST protocol (Using curl for example):</p>

<pre><code>curl -d "url_encoded_text_message" "http://host:port/?name=your_queue_name&amp;opt=put&amp;auth=mypass123"
</code></pre>
</li>
<li>
<p>GET text message from a queue</p>

<p>HTTP GET protocol (Using curl for example):</p>

<pre><code>curl "http://host:port/?charset=utf-8&amp;name=your_queue_name&amp;opt=get&amp;auth=mypass123"
</code></pre>
</li>
<li>
<p>View queue status</p>

<p>HTTP GET protocol (Using curl for example):</p>

<pre><code>curl "http://host:port/?name=your_queue_name&amp;opt=status&amp;auth=mypass123"
</code></pre>
</li>
<li>
<p>View queue details</p>

<p>HTTP GET protocol (Using curl for example):</p>

<pre><code>curl "http://host:port/?name=your_queue_name&amp;opt=view&amp;pos=1&amp;auth=mypass123"
</code></pre>
</li>
<li>
<p>Reset queue</p>

<p>HTTP GET protocol (Using curl for example):</p>

<pre><code>curl "http://host:port/?name=your_queue_name&amp;opt=reset&amp;pos=1&amp;auth=mypass123"
</code></pre>
</li>
</ol>

<h1>
<a id="benchmark" class="anchor" href="#benchmark" aria-hidden="true"><span class="octicon octicon-link"></span></a>Benchmark</h1>

<p>Test machine:</p>

<pre><code> CPU: 2 AMD Athlon(tm) II X2 245 Processor
Memory: Size: 2048 MB
Locator: DIMM0
Range Size: 2 GB
Size: 2048 MB
Locator: DIMM1
Range Size: 2 GB
Size: No Module Installed
Locator: DIMM2
Size: No Module Installed
Locator: DIMM3
</code></pre>

<h3>
<a id="put-queue" class="anchor" href="#put-queue" aria-hidden="true"><span class="octicon octicon-link"></span></a>PUT queue:</h3>

<pre><code>ab -k -c 1000 -n 10000 "http://127.0.0.1:1218/?name=xoyo&amp;opt=put&amp;data=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
This is ApacheBench, Version 2.3 &lt;$Revision: 655654 $&gt;
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests


Server Software:
Server Hostname: 127.0.0.1
Server Port: 1218

Document Path: /?name=xoyo&amp;opt=put&amp;data=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Document Length: 13 bytes

Concurrency Level: 1000
Time taken for tests: 0.771 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 10000
Total transferred: 1640000 bytes
HTML transferred: 130000 bytes
Requests per second: 12964.69 [#/sec] (mean)
Time per request: 77.133 [ms] (mean)
Time per request: 0.077 [ms] (mean, across all concurrent requests)
Transfer rate: 2076.38 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 2 7.7 0 41
Processing: 0 70 74.9 73 473
Waiting: 0 70 74.9 73 473
Total: 0 72 75.8 76 473

Percentage of the requests served within a certain time (ms)
50% 76
66% 91
75% 98
80% 110
90% 183
95% 216
98% 272
99% 310
100% 473 (longest request)
</code></pre>

<h3>
<a id="get-queue" class="anchor" href="#get-queue" aria-hidden="true"><span class="octicon octicon-link"></span></a>GET queue:</h3>

<pre><code>ab -k -c 1000 -n 10000 "http://127.0.0.1:1218/?name=xoyo&amp;opt=get" [system]
This is ApacheBench, Version 2.3 &lt;$Revision: 655654 $&gt;
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests


Server Software:
Server Hostname: 127.0.0.1
Server Port: 1218

Document Path: /?name=xoyo&amp;opt=get
Document Length: 512 bytes

Concurrency Level: 1000
Time taken for tests: 0.703 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 10000
Total transferred: 6640000 bytes
HTML transferred: 5120000 bytes
Requests per second: 14227.83 [#/sec] (mean)
Time per request: 70.285 [ms] (mean)
Time per request: 0.070 [ms] (mean, across all concurrent requests)
Transfer rate: 9225.86 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 5.3 0 33
Processing: 0 49 61.2 20 449
Waiting: 0 49 61.2 20 449
Total: 0 50 62.0 22 471

Percentage of the requests served within a certain time (ms)
50% 22
66% 67
75% 87
80% 105
90% 128
95% 161
98% 224
99% 240
100% 471 (longest request)
</code></pre>
</section>
</div>

<!-- FOOTER -->
<div id="footer_wrap" class="outer">
<footer class="inner">
<p class="copyright">Httpmq maintained by <a href="https://github.com/hnlq715">hnlq715</a></p>
<p>Published with <a href="http://pages.github.com">GitHub Pages</a></p>
</footer>
</div>



</body>
</html>
1 change: 1 addition & 0 deletions javascripts/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('This would be the main JS file.');
1 change: 1 addition & 0 deletions params.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Httpmq","tagline":"A simple HTTP message queue written in Go with goleveldb, just like httpsqs wriiten in C with Tokyo Cabinet.","body":"httpmq\r\n======\r\n\r\nThis program is a simple HTTP message queue written in Go with gdleveldb, just like httpsqs wriiten in C with Tokyo Cabinet.\r\n\r\nFeature\r\n======\r\n\r\n* Very simple, less than 300 lines Go code.\r\n* Very fast, more than 10000 requests/sec.\r\n* High concurrency, support the tens of thousands of concurrent connections.\r\n* Multiple queue.\r\n* Low memory consumption, mass data storage, storage dozens of GB of data takes less than 100MB of physical memory buffer.\r\n* Convenient to change the maximum queue length of per-queue.\r\n* Queue status view.\r\n* Be able to view the contents of the specified queue ID.\r\n* Multi-Character encoding support.\r\n\r\nUsage\r\n======\r\n ```\r\n Usage of ./httpmq:\r\n -auth=\"\": auth password to access httpmq\r\n -buffer=4: write buffer(MB)\r\n -cache=8: cache size(MB)\r\n -cpu=1: cpu number for httpmq\r\n -db=\"level.db\": database path\r\n -ip=\"0.0.0.0\": ip address to listen on\r\n -maxqueue=1000000: the max queue length\r\n -port=\"1218\": port to listen on\r\n -readtimeout=15: read timeout for an http request\r\n -verbose=true: output log\r\n -writetimeout=15: write timeout for an http request\r\n ```\r\n\r\n1. PUT text message into a queue\r\n\r\n HTTP GET protocol (Using curl for example):\r\n ```\r\n curl \"http://host:port/?name=your_queue_name&opt=put&data=url_encoded_text_message&auth=mypass123\"\r\n ```\r\n HTTP POST protocol (Using curl for example):\r\n ```\r\n curl -d \"url_encoded_text_message\" \"http://host:port/?name=your_queue_name&opt=put&auth=mypass123\"\r\n ```\r\n\r\n2. GET text message from a queue\r\n\r\n HTTP GET protocol (Using curl for example):\r\n ```\r\n curl \"http://host:port/?charset=utf-8&name=your_queue_name&opt=get&auth=mypass123\"\r\n ```\r\n\r\n3. View queue status\r\n\r\n HTTP GET protocol (Using curl for example):\r\n ```\r\n curl \"http://host:port/?name=your_queue_name&opt=status&auth=mypass123\"\r\n ```\r\n4. View queue details\r\n\r\n HTTP GET protocol (Using curl for example):\r\n ```\r\n curl \"http://host:port/?name=your_queue_name&opt=view&pos=1&auth=mypass123\"\r\n ```\r\n5. Reset queue\r\n\r\n HTTP GET protocol (Using curl for example):\r\n ```\r\n curl \"http://host:port/?name=your_queue_name&opt=reset&pos=1&auth=mypass123\"\r\n ```\r\n\r\nBenchmark\r\n========\r\n\r\nTest machine:\r\n ```\r\n CPU: 2 AMD Athlon(tm) II X2 245 Processor\r\n Memory: Size: 2048 MB\r\n Locator: DIMM0\r\n Range Size: 2 GB\r\n Size: 2048 MB\r\n Locator: DIMM1\r\n Range Size: 2 GB\r\n Size: No Module Installed\r\n Locator: DIMM2\r\n Size: No Module Installed\r\n Locator: DIMM3\r\n ```\r\n\r\n\r\n###PUT queue:\r\n\r\n ab -k -c 1000 -n 10000 \"http://127.0.0.1:1218/?name=xoyo&opt=put&data=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\r\n This is ApacheBench, Version 2.3 <$Revision: 655654 $>\r\n Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\r\n Licensed to The Apache Software Foundation, http://www.apache.org/\r\n \r\n Benchmarking 127.0.0.1 (be patient)\r\n Completed 1000 requests\r\n Completed 2000 requests\r\n Completed 3000 requests\r\n Completed 4000 requests\r\n Completed 5000 requests\r\n Completed 6000 requests\r\n Completed 7000 requests\r\n Completed 8000 requests\r\n Completed 9000 requests\r\n Completed 10000 requests\r\n Finished 10000 requests\r\n \r\n \r\n Server Software: \r\n Server Hostname: 127.0.0.1\r\n Server Port: 1218\r\n \r\n Document Path: /?name=xoyo&opt=put&data=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r\n Document Length: 13 bytes\r\n \r\n Concurrency Level: 1000\r\n Time taken for tests: 0.771 seconds\r\n Complete requests: 10000\r\n Failed requests: 0\r\n Write errors: 0\r\n Keep-Alive requests: 10000\r\n Total transferred: 1640000 bytes\r\n HTML transferred: 130000 bytes\r\n Requests per second: 12964.69 [#/sec] (mean)\r\n Time per request: 77.133 [ms] (mean)\r\n Time per request: 0.077 [ms] (mean, across all concurrent requests)\r\n Transfer rate: 2076.38 [Kbytes/sec] received\r\n \r\n Connection Times (ms)\r\n min mean[+/-sd] median max\r\n Connect: 0 2 7.7 0 41\r\n Processing: 0 70 74.9 73 473\r\n Waiting: 0 70 74.9 73 473\r\n Total: 0 72 75.8 76 473\r\n \r\n Percentage of the requests served within a certain time (ms)\r\n 50% 76\r\n 66% 91\r\n 75% 98\r\n 80% 110\r\n 90% 183\r\n 95% 216\r\n 98% 272\r\n 99% 310\r\n 100% 473 (longest request)\r\n\r\n###GET queue:\r\n\r\n ab -k -c 1000 -n 10000 \"http://127.0.0.1:1218/?name=xoyo&opt=get\" [system]\r\n This is ApacheBench, Version 2.3 <$Revision: 655654 $>\r\n Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\r\n Licensed to The Apache Software Foundation, http://www.apache.org/\r\n \r\n Benchmarking 127.0.0.1 (be patient)\r\n Completed 1000 requests\r\n Completed 2000 requests\r\n Completed 3000 requests\r\n Completed 4000 requests\r\n Completed 5000 requests\r\n Completed 6000 requests\r\n Completed 7000 requests\r\n Completed 8000 requests\r\n Completed 9000 requests\r\n Completed 10000 requests\r\n Finished 10000 requests\r\n \r\n \r\n Server Software: \r\n Server Hostname: 127.0.0.1\r\n Server Port: 1218\r\n \r\n Document Path: /?name=xoyo&opt=get\r\n Document Length: 512 bytes\r\n \r\n Concurrency Level: 1000\r\n Time taken for tests: 0.703 seconds\r\n Complete requests: 10000\r\n Failed requests: 0\r\n Write errors: 0\r\n Keep-Alive requests: 10000\r\n Total transferred: 6640000 bytes\r\n HTML transferred: 5120000 bytes\r\n Requests per second: 14227.83 [#/sec] (mean)\r\n Time per request: 70.285 [ms] (mean)\r\n Time per request: 0.070 [ms] (mean, across all concurrent requests)\r\n Transfer rate: 9225.86 [Kbytes/sec] received\r\n \r\n Connection Times (ms)\r\n min mean[+/-sd] median max\r\n Connect: 0 1 5.3 0 33\r\n Processing: 0 49 61.2 20 449\r\n Waiting: 0 49 61.2 20 449\r\n Total: 0 50 62.0 22 471\r\n \r\n Percentage of the requests served within a certain time (ms)\r\n 50% 22\r\n 66% 67\r\n 75% 87\r\n 80% 105\r\n 90% 128\r\n 95% 161\r\n 98% 224\r\n 99% 240\r\n 100% 471 (longest request)\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}
Loading

0 comments on commit 36cb70d

Please sign in to comment.