<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>small_fish__ (宋佳洋)</title>
    <link>https://ruby-china.org/small_fish__</link>
    <description>键盘华尔兹</description>
    <language>en-us</language>
    <item>
      <title>分享一篇文章 "如何量化我们的服务"</title>
      <description>&lt;p&gt;主要介绍了三种方法来度量我们的服务：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;USE 方法&lt;/li&gt;
&lt;li&gt;RED 方法&lt;/li&gt;
&lt;li&gt;Google SRE 黄金指标&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;文章链接：&lt;a href="https://mp.weixin.qq.com/s/khZ6P-x69YNaszSwYtLykg" rel="nofollow" target="_blank"&gt;https://mp.weixin.qq.com/s/khZ6P-x69YNaszSwYtLykg&lt;/a&gt;&lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Tue, 27 Feb 2018 19:15:05 +0800</pubDate>
      <link>https://ruby-china.org/topics/35099</link>
      <guid>https://ruby-china.org/topics/35099</guid>
    </item>
    <item>
      <title>prometheus-phoenix 为你的 Phoenix 应用添加 metrics 监控</title>
      <description>&lt;p&gt;参考链接： &lt;a href="https://github.com/deadtrickster/prometheus-phoenix" rel="nofollow" target="_blank"&gt;https://github.com/deadtrickster/prometheus-phoenix&lt;/a&gt;&lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Tue, 30 Jan 2018 14:09:50 +0800</pubDate>
      <link>https://ruby-china.org/topics/34972</link>
      <guid>https://ruby-china.org/topics/34972</guid>
    </item>
    <item>
      <title>给你的 Rails 一键添加 Prometheus 监控</title>
      <description>&lt;p&gt;博客地址： &lt;a href="https://www.robustperception.io/instrumenting-a-ruby-on-rails-application-with-prometheus/" rel="nofollow" target="_blank"&gt;https://www.robustperception.io/instrumenting-a-ruby-on-rails-application-with-prometheus/&lt;/a&gt;&lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Fri, 19 Jan 2018 10:53:01 +0800</pubDate>
      <link>https://ruby-china.org/topics/34914</link>
      <guid>https://ruby-china.org/topics/34914</guid>
    </item>
    <item>
      <title>GoRails 作者说他一个月做视频教学收入到 15000 刀了</title>
      <description>&lt;p&gt;详情： &lt;a href="https://www.indiehackers.com/interview/gorails-8999c7ac7f" rel="nofollow" target="_blank"&gt;https://www.indiehackers.com/interview/gorails-8999c7ac7f&lt;/a&gt; ，说明 Ruby 用户的付费能力很强呀。&lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Tue, 09 Jan 2018 19:16:55 +0800</pubDate>
      <link>https://ruby-china.org/topics/34863</link>
      <guid>https://ruby-china.org/topics/34863</guid>
    </item>
    <item>
      <title>分享一个收集 Nginx 日志的 Prometheus 插件</title>
      <description>&lt;p&gt;最近新项目刚上线，也就顺便把监控，告警之类的加上了。&lt;/p&gt;

&lt;p&gt;这里我们主要用到 Prometheus 相关技术栈，在统计 API 的时候，没有找到特别好用的 Nginx 相关插件，所以就自己码了一个  &lt;a href="https://github.com/songjiayang/nginx-log-exporter" rel="nofollow" target="_blank" title=""&gt;nginx-log-exporter&lt;/a&gt;，欢迎大家使用和吐槽。&lt;/p&gt;
&lt;h3 id="主要功能包含："&gt;主要功能包含：&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;支持多个日志同时收集&lt;/li&gt;
&lt;li&gt;支持日志滚动收集&lt;/li&gt;
&lt;li&gt;支持自定义数据格式&lt;/li&gt;
&lt;li&gt;支持收集动态 URL &lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="主要作用："&gt;主要作用：&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;监控 API 访问量&lt;/li&gt;
&lt;li&gt;监控 API 响应速度&lt;/li&gt;
&lt;li&gt;监控 API 错误率&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;效果图（Grafana + Prometheus）:&lt;/p&gt;

&lt;p&gt;&lt;img src="https://user-images.githubusercontent.com/1459834/34656613-7083cf3e-f457-11e7-929a-2758abad387b.png" title="" alt="png"&gt;&lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Mon, 08 Jan 2018 21:28:42 +0800</pubDate>
      <link>https://ruby-china.org/topics/34853</link>
      <guid>https://ruby-china.org/topics/34853</guid>
    </item>
    <item>
      <title>This week in Rails </title>
      <description>&lt;p&gt;分享一个网站，&lt;a href="https://rails-weekly.ongoodbits.com/" rel="nofollow" target="_blank"&gt;https://rails-weekly.ongoodbits.com/&lt;/a&gt; ，内容还比较全&lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Fri, 29 Sep 2017 10:06:23 +0800</pubDate>
      <link>https://ruby-china.org/topics/34285</link>
      <guid>https://ruby-china.org/topics/34285</guid>
    </item>
    <item>
      <title>推荐一本 Rails 新手入门书籍</title>
      <description>&lt;p&gt;sitepoint 邮件推送的一本 rails 新手指南，看了目录，觉得蛮全的，推荐下。&lt;/p&gt;

&lt;p&gt;btw: 现在出 rails 的书真的不多咯&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.sitepoint.com/premium/products/Z2lkOi8vbGVhcm5hYmxlL1Byb2R1Y3QvMTA3?utm_medium=email&amp;amp;utm_campaign=242_Rails_Book_Pre_Launch_Newsletter&amp;amp;utm_content=242_Rails_Book_Pre_Launch_Newsletter+Version+A+CID_5e13f93d6ed3634427f3b85e82180506&amp;amp;utm_source=CampaignMonitor%20SitePoint&amp;amp;utm_term=Learn%20Rails%20for%209%20now" rel="nofollow" target="_blank" title=""&gt;购买链接&lt;/a&gt; ／ 
&lt;a href="https://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2016/10/1477911297rails3sample-1.pdf" rel="nofollow" target="_blank" title=""&gt;书籍目录&lt;/a&gt;&lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Tue, 01 Nov 2016 09:40:03 +0800</pubDate>
      <link>https://ruby-china.org/topics/31489</link>
      <guid>https://ruby-china.org/topics/31489</guid>
    </item>
    <item>
      <title>隔壁 #RubyKaigi 正在时</title>
      <description>&lt;p&gt;昨晚看了苹果发布会，是不是没过瘾，不急隔壁 RubyKaigi 也正在如火，最新资讯请刷 &lt;a href="https://twitter.com/hashtag/rubykaigi?src=hash" rel="nofollow" target="_blank" title=""&gt;Twitter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;大家对开场大戏怎么看：&lt;/p&gt;

&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2016/08eecde935775d1ce4031edf1972cd22.png!large" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;官网传送门： &lt;a href="http://rubykaigi.org/2016/schedule/" rel="nofollow" target="_blank"&gt;http://rubykaigi.org/2016/schedule/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have  fun &lt;img title=":tada:" alt="🎉" src="https://twemoji.ruby-china.com/2/svg/1f389.svg" class="twemoji"&gt; &lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Thu, 08 Sep 2016 09:53:31 +0800</pubDate>
      <link>https://ruby-china.org/topics/31011</link>
      <guid>https://ruby-china.org/topics/31011</guid>
    </item>
    <item>
      <title>Heroku, SSL &amp; Me. We’ ve come a long way.</title>
      <description>&lt;p&gt;&lt;a href="https://substrakt.com/heroku-ssl-me-weve-come-a-long-way/" rel="nofollow" target="_blank"&gt;https://substrakt.com/heroku-ssl-me-weve-come-a-long-way/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/substrakt/letsencrypt-heroku" rel="nofollow" target="_blank"&gt;https://github.com/substrakt/letsencrypt-heroku&lt;/a&gt;&lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Fri, 22 Jul 2016 09:48:52 +0800</pubDate>
      <link>https://ruby-china.org/topics/30597</link>
      <guid>https://ruby-china.org/topics/30597</guid>
    </item>
    <item>
      <title>Ruby 2.4 一些新特性</title>
      <description>&lt;p&gt;&lt;a href="https://blog.blockscore.com/new-features-in-ruby-2-4/" rel="nofollow" target="_blank"&gt;https://blog.blockscore.com/new-features-in-ruby-2-4/&lt;/a&gt;&lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Thu, 21 Jul 2016 17:37:09 +0800</pubDate>
      <link>https://ruby-china.org/topics/30588</link>
      <guid>https://ruby-china.org/topics/30588</guid>
    </item>
    <item>
      <title>H2O 完美支持 mruby</title>
      <description>&lt;p&gt;&lt;a href="https://h2o.examp1e.net/configure/mruby.html" rel="nofollow" target="_blank"&gt;https://h2o.examp1e.net/configure/mruby.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ruby 的又一个发展领域，good.&lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Wed, 20 Jul 2016 10:44:37 +0800</pubDate>
      <link>https://ruby-china.org/topics/30572</link>
      <guid>https://ruby-china.org/topics/30572</guid>
    </item>
    <item>
      <title>[测试] 这些方法属于  Ruby 还是 Rails ？ </title>
      <description>&lt;p&gt;&lt;a href="http://railshurts.com/quiz/" rel="nofollow" target="_blank"&gt;http://railshurts.com/quiz/&lt;/a&gt;&lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Fri, 08 Jul 2016 16:19:52 +0800</pubDate>
      <link>https://ruby-china.org/topics/30480</link>
      <guid>https://ruby-china.org/topics/30480</guid>
    </item>
    <item>
      <title>Rethinking Computer Science Education</title>
      <description>&lt;p&gt;作者还是蛮出名的，经常在 conf 露脸，不过这个文章真心长。&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Therefore, Computer Science education is not just about teaching abstractions and programming literacy. It’s also about standing up against bullying, fighting for gender equity and reforming our education system to support our kids to develop their interests rather than just drowning them in homework and exams.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;传送链接：&lt;a href="https://medium.com/@chancancode/rethinking-computer-science-education-319a60709b30#.n4kiioyg2" rel="nofollow" target="_blank"&gt;https://medium.com/@chancancode/rethinking-computer-science-education-319a60709b30#.n4kiioyg2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;长文，慎入 &lt;img title=":sweat_smile:" alt="😅" src="https://twemoji.ruby-china.com/2/svg/1f605.svg" class="twemoji"&gt; &lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Thu, 30 Jun 2016 11:11:16 +0800</pubDate>
      <link>https://ruby-china.org/topics/30408</link>
      <guid>https://ruby-china.org/topics/30408</guid>
    </item>
    <item>
      <title>本地测试了下个人常用的 Web 框架的吞吐率，结果不出意料</title>
      <description>&lt;h3 id="目的"&gt;目的&lt;/h3&gt;
&lt;p&gt;测试个人经常使用的不同 App server（主要用来做 API）的吞吐率。&lt;/p&gt;
&lt;h3 id="测试主机"&gt;测试主机&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;系统：MacBook Air (11-inch, Early 2015)&lt;/li&gt;
&lt;li&gt;CPU: 1.6 GHz Intel Core i5 x4 (4 核)&lt;/li&gt;
&lt;li&gt;内存：4 GB 1600 MHz DDR3&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="参数对比"&gt;参数对比&lt;/h3&gt;&lt;h5 id="1. Golang Gin 框架（协程模式）"&gt;1. Golang Gin 框架（协程模式）&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;Go 1.6&lt;/li&gt;
&lt;li&gt;Gin v1.0rc1&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id="2. Node Koa 框架 (多进程 ＋ 异步IO模式)"&gt;2. Node Koa 框架 (多进程 ＋ 异步 IO 模式)&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;Node v6.1.0&lt;/li&gt;
&lt;li&gt;Koa 1.2.0&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id="3. Ruby Sinatra 框架 (多进程多线程模式)"&gt;3. Ruby Sinatra 框架 (多进程多线程模式)&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;Ruby 2.3.1p112&lt;/li&gt;
&lt;li&gt;Sinatra 1.4.7&lt;/li&gt;
&lt;li&gt;Puma 3.4.0&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="测试方法"&gt;测试方法&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;使用 wrk 测试工具&lt;/li&gt;
&lt;li&gt;压力参数参考 &lt;a href="http://www.littlelines.com/blog/2014/07/08/elixir-vs-ruby-showdown-phoenix-vs-rails/" rel="nofollow" target="_blank"&gt;http://www.littlelines.com/blog/2014/07/08/elixir-vs-ruby-showdown-phoenix-vs-rails/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;分别测试 &lt;code&gt;/users&lt;/code&gt; (有 DB 查询) 和 &lt;code&gt;/static&lt;/code&gt; （无 DB 查询）&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="数据准备"&gt;数据准备&lt;/h3&gt;
&lt;p&gt;采用 mongodb 作为测试，并选用了各自最为流行的 mongo 驱动。&lt;/p&gt;

&lt;p&gt;进入 mongo console 执行以下命令：&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use ruby2go2node2elixir

db.users.insert([
  {"_id": ObjectId(), "username": "Josh Williams", "created_at": new Date(), "updated_at": new Date()},
  {"_id": ObjectId(), "username": "Josh Williams", "created_at": new Date(), "updated_at": new Date()},
  {"_id": ObjectId(), "username": "Josh Williams", "created_at": new Date(), "updated_at": new Date()},
  {"_id": ObjectId(), "username": "Josh Williams", "created_at": new Date(), "updated_at": new Date()},
  {"_id": ObjectId(), "username": "Josh Williams", "created_at": new Date(), "updated_at": new Date()}
])
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="启动服务："&gt;启动服务：&lt;/h3&gt;
&lt;p&gt;所有命令都是在项目根目录前提下执行：&lt;/p&gt;
&lt;h5 id="Gin (golang)（绑定在3000端口）"&gt;Gin (golang)（绑定在 3000 端口）&lt;/h5&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;go
&lt;span class="nb"&gt;source &lt;/span&gt;env.sh
make 
&lt;/code&gt;&lt;/pre&gt;&lt;h5 id="Koa (nodejs)（绑定在3001端口）"&gt;Koa (nodejs)（绑定在 3001 端口）&lt;/h5&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;nodejs
npm &lt;span class="nb"&gt;install
&lt;/span&gt;npm start
&lt;/code&gt;&lt;/pre&gt;&lt;h5 id="Sinatra (ruby)（绑定在3002端口）"&gt;Sinatra (ruby)（绑定在 3002 端口）&lt;/h5&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;ruby
bundle 
puma &lt;span class="nt"&gt;-C&lt;/span&gt; puma.rb
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="Wrk 本地测试结果"&gt;Wrk 本地测试结果&lt;/h3&gt;&lt;h4 id="Gin (golang)"&gt;Gin (golang)&lt;/h4&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;wrk &lt;span class="nt"&gt;-t4&lt;/span&gt; &lt;span class="nt"&gt;-c100&lt;/span&gt; &lt;span class="nt"&gt;-d30S&lt;/span&gt; &lt;span class="nt"&gt;--timeout&lt;/span&gt; 2000 &lt;span class="s2"&gt;"http://127.0.0.1:3000/static"&lt;/span&gt;
Running 30s &lt;span class="nb"&gt;test&lt;/span&gt; @ http://127.0.0.1:3000/static
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    14.63ms   59.10ms 779.91ms   96.68%
    Req/Sec     5.42k     1.37k   20.49k    86.36%
  634806 requests &lt;span class="k"&gt;in &lt;/span&gt;30.10s, 167.09MB &lt;span class="nb"&gt;read
&lt;/span&gt;Requests/sec:  21092.78
Transfer/sec:      5.55MB

wrk &lt;span class="nt"&gt;-t4&lt;/span&gt; &lt;span class="nt"&gt;-c100&lt;/span&gt; &lt;span class="nt"&gt;-d30S&lt;/span&gt; &lt;span class="nt"&gt;--timeout&lt;/span&gt; 2000 &lt;span class="s2"&gt;"http://127.0.0.1:3000/users"&lt;/span&gt;
Running 30s &lt;span class="nb"&gt;test&lt;/span&gt; @ http://127.0.0.1:3000/users
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    17.63ms    5.65ms 125.03ms   80.56%
    Req/Sec     1.43k   317.13     2.19k    59.50%
  171245 requests &lt;span class="k"&gt;in &lt;/span&gt;30.03s, 143.06MB &lt;span class="nb"&gt;read
&lt;/span&gt;Requests/sec:   5702.07
Transfer/sec:      4.76MB
&lt;/code&gt;&lt;/pre&gt;&lt;h4 id="Koa (nodejs)"&gt;Koa (nodejs)&lt;/h4&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#### 多进程模式&lt;/span&gt;

wrk &lt;span class="nt"&gt;-t4&lt;/span&gt; &lt;span class="nt"&gt;-c100&lt;/span&gt; &lt;span class="nt"&gt;-d30S&lt;/span&gt; &lt;span class="nt"&gt;--timeout&lt;/span&gt; 2000 &lt;span class="s2"&gt;"http://127.0.0.1:3001/static"&lt;/span&gt;
Running 30s &lt;span class="nb"&gt;test&lt;/span&gt; @ http://127.0.0.1:3001/static
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    10.77ms    8.97ms 199.54ms   94.74%
    Req/Sec     2.56k   374.25     4.50k    87.25%
  305517 requests &lt;span class="k"&gt;in &lt;/span&gt;30.03s, 84.20MB &lt;span class="nb"&gt;read
&lt;/span&gt;Requests/sec:  10172.22
Transfer/sec:      2.80MB

wrk &lt;span class="nt"&gt;-t4&lt;/span&gt; &lt;span class="nt"&gt;-c100&lt;/span&gt; &lt;span class="nt"&gt;-d30S&lt;/span&gt; &lt;span class="nt"&gt;--timeout&lt;/span&gt; 2000 &lt;span class="s2"&gt;"http://127.0.0.1:3001/users"&lt;/span&gt;
Running 30s &lt;span class="nb"&gt;test&lt;/span&gt; @ http://127.0.0.1:3001/users
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    44.25ms   18.20ms 460.36ms   85.57%
    Req/Sec   576.93     83.73     0.85k    76.90%
  68859 requests &lt;span class="k"&gt;in &lt;/span&gt;30.01s, 56.08MB &lt;span class="nb"&gt;read
&lt;/span&gt;Requests/sec:   2294.72
Transfer/sec:      1.87MB

&lt;span class="c"&gt;##### 单进程模式&lt;/span&gt;

wrk &lt;span class="nt"&gt;-t4&lt;/span&gt; &lt;span class="nt"&gt;-c100&lt;/span&gt; &lt;span class="nt"&gt;-d30S&lt;/span&gt; &lt;span class="nt"&gt;--timeout&lt;/span&gt; 2000 &lt;span class="s2"&gt;"http://127.0.0.1:3001/static"&lt;/span&gt;
Running 30s &lt;span class="nb"&gt;test&lt;/span&gt; @ http://127.0.0.1:3001/static
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    21.21ms    1.45ms  47.63ms   93.30%
    Req/Sec     1.18k   103.09     1.88k    86.25%
  141520 requests &lt;span class="k"&gt;in &lt;/span&gt;30.06s, 39.00MB &lt;span class="nb"&gt;read
&lt;/span&gt;Requests/sec:   4708.48
Transfer/sec:      1.30MB

wrk &lt;span class="nt"&gt;-t4&lt;/span&gt; &lt;span class="nt"&gt;-c100&lt;/span&gt; &lt;span class="nt"&gt;-d30S&lt;/span&gt; &lt;span class="nt"&gt;--timeout&lt;/span&gt; 2000 &lt;span class="s2"&gt;"http://127.0.0.1:3001/users"&lt;/span&gt;
Running 30s &lt;span class="nb"&gt;test&lt;/span&gt; @ http://127.0.0.1:3001/users
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    73.37ms   10.07ms 212.29ms   87.93%
    Req/Sec   342.42     66.59   505.00     63.45%
  40923 requests &lt;span class="k"&gt;in &lt;/span&gt;30.08s, 33.33MB &lt;span class="nb"&gt;read
&lt;/span&gt;Requests/sec:   1360.40
Transfer/sec:      1.11MB

&lt;/code&gt;&lt;/pre&gt;&lt;h4 id="Sinatra (ruby)"&gt;Sinatra (ruby)&lt;/h4&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wrk -t4 -c100 -d30S --timeout 2000 "http://127.0.0.1:3002/static"
Running 30s test @ http://127.0.0.1:3002/static
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    22.83ms   28.96ms 392.78ms   88.99%
    Req/Sec     1.23k   334.43     2.07k    60.92%
  147405 requests in 30.06s, 35.85MB read
Requests/sec:   4903.72
Transfer/sec:      1.19MB

wrk -t4 -c100 -d30S --timeout 2000 "http://127.0.0.1:3002/users"
Running 30s test @ http://127.0.0.1:3002/users
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   153.62ms  121.39ms   1.09s    73.08%
    Req/Sec   159.87     36.28   287.00     69.44%
  19111 requests in 30.05s, 16.51MB read
Requests/sec:    635.96
Transfer/sec:    562.70KB

&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="吞吐率倍数关系"&gt;吞吐率倍数关系&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;无 DB 查询：&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
gin &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; koa&lt;span class="o"&gt;(&lt;/span&gt;多进程&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; koa&lt;span class="o"&gt;(&lt;/span&gt;单进程&lt;span class="o"&gt;)&lt;/span&gt; ~&lt;span class="o"&gt;=&lt;/span&gt; sinatra   
   &lt;span class="o"&gt;(&lt;/span&gt;2x&lt;span class="o"&gt;)&lt;/span&gt;          &lt;span class="o"&gt;(&lt;/span&gt;2x&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;有 DB 查询:
&lt;code&gt;bash
gin &amp;gt; koa(多进程) &amp;gt; koa(单进程) &amp;gt; sinatra   
 (2x)          (2x)         (2x)
&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="结论："&gt;结论：&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;在 4 核 CPU 条件下，golang 并发大概是 Nodejs 的两倍，Ruby 8 倍。因为 golang 有更好的并发模型，所以核数越多，这个差距越大。&lt;/li&gt;
&lt;li&gt;多进程的并发模型，代价其实挺大的。比如 Node 多进程模式并发能力并没有随核数成倍增加，大致是其核数／2 的提升。&lt;/li&gt;
&lt;li&gt;Ruby GIL 缘故，其并发能力最差不足为奇。但是现在主流的都是微服务，RESTful API，一些性能要求较高的 业务完全可以考虑其他性能更好的语言。在其他语言领域，有些 ruby 棘手的问题，或许根本就不存在。&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;测试代码，请移步 &lt;a href="https://github.com/songjiayang/ruby2go2node2elixir" rel="nofollow" target="_blank"&gt;https://github.com/songjiayang/ruby2go2node2elixir&lt;/a&gt; ，如果有不合理的地方，请大家指出。
ps: 我也希望是我测试代码写的有问题导致 Ruby 结果不理想。&lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Fri, 27 May 2016 13:56:43 +0800</pubDate>
      <link>https://ruby-china.org/topics/30143</link>
      <guid>https://ruby-china.org/topics/30143</guid>
    </item>
    <item>
      <title>请跟新 Ruby-China 右侧 Ruby 资源 中 “Ruby 视频” 链接</title>
      <description>&lt;p&gt;目前 &lt;a href="http://railscasts-china.com" rel="nofollow" target="_blank"&gt;http://railscasts-china.com&lt;/a&gt; 已无法访问，建议替换成 &lt;a href="https://gorails.com" rel="nofollow" target="_blank"&gt;https://gorails.com&lt;/a&gt; ，该网站作者更新还是蛮勤快的。
cc &lt;a href="/huacnlee" class="user-mention" title="@huacnlee"&gt;&lt;i&gt;@&lt;/i&gt;huacnlee&lt;/a&gt;  &lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Thu, 12 May 2016 23:20:38 +0800</pubDate>
      <link>https://ruby-china.org/topics/30006</link>
      <guid>https://ruby-china.org/topics/30006</guid>
    </item>
    <item>
      <title>分享个网站，里面内容蛮不错的 [thoughtbot 出品]</title>
      <description>&lt;p&gt;网站地址： &lt;a href="https://upcase.com" rel="nofollow" target="_blank"&gt;https://upcase.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;尤其喜欢每周视频 &lt;a href="https://upcase.com/the-weekly-iteration" rel="nofollow" target="_blank"&gt;https://upcase.com/the-weekly-iteration&lt;/a&gt;&lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Mon, 25 Apr 2016 10:57:12 +0800</pubDate>
      <link>https://ruby-china.org/topics/29844</link>
      <guid>https://ruby-china.org/topics/29844</guid>
    </item>
    <item>
      <title>[分享] dict_cache 帮助你在 terminal 里查询单词和浏览查询记录</title>
      <description>&lt;p&gt;背景：&lt;/p&gt;

&lt;p&gt;ruby 开发对英文单词量比较高，像我这种半吊子英文水平，使用英汉字典翻译的时候较多。&lt;/p&gt;

&lt;p&gt;前段时间看到 &lt;a href="/lingceng" class="user-mention" title="@lingceng"&gt;&lt;i&gt;@&lt;/i&gt;lingceng&lt;/a&gt; 写的 &lt;a href="https://github.com/lingceng/bing_dictionary" rel="nofollow" target="_blank" title=""&gt;bing_dictionary&lt;/a&gt; ，试用结果非常满意，速度快而且翻译比较准确。最近开始背诵单词，所以想将每天查询记录收集起来，以备每晚巩固之用，故写了 &lt;a href="https://github.com/songjiayang/dict_cache" rel="nofollow" target="_blank" title=""&gt;dict_cache&lt;/a&gt;。 &lt;/p&gt;
&lt;h2 id="安装"&gt;安装&lt;/h2&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gem install dict_cache
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="如何使用"&gt;如何使用&lt;/h2&gt;&lt;h4 id="1. 翻译单词 （用到 bing_dictionary）"&gt;1. 翻译单词（用到 bing_dictionary）&lt;/h4&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;dict apple

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src="http://7o512j.com1.z0.glb.clouddn.com/translate_word.png" title="" alt="translate_word.png"&gt;&lt;/p&gt;
&lt;h4 id="2. 查询每日记录，默认是当天"&gt;2. 查询每日记录，默认是当天&lt;/h4&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;dict_cache &lt;span class="nb"&gt;date&lt;/span&gt;:2016-03-04
dict_cache // today is default
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src="http://7o512j.com1.z0.glb.clouddn.com/daily_words" title="" alt="list_words.png"&gt;&lt;/p&gt;
&lt;h4 id="3. dict_cache clear 清空所有缓存记录"&gt;3. &lt;code&gt;dict_cache clear&lt;/code&gt; 清空所有缓存记录&lt;/h4&gt;&lt;h4 id="4. dict_cache --help/-h  帮助"&gt;4. &lt;code&gt;dict_cache --help/-h&lt;/code&gt;  帮助&lt;/h4&gt;
&lt;p&gt;欢迎大家使用，有任何问题和想法，欢迎提 issue 和 pr .&lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Fri, 04 Mar 2016 11:57:17 +0800</pubDate>
      <link>https://ruby-china.org/topics/29205</link>
      <guid>https://ruby-china.org/topics/29205</guid>
    </item>
    <item>
      <title>分享一个 font-aswsome 3.x 升级到 4.x 的小工具</title>
      <description>&lt;p&gt;最近将项目中 font-aswsome 从 3.x 升级到 4.x，写了个脚本来跑，如果有同样需求的朋友，果断拿走，不用客气 &lt;img title=":smile:" alt="😄" src="https://twemoji.ruby-china.com/2/svg/1f604.svg" class="twemoji"&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/songjiayang/font-aswsome-upgrade" rel="nofollow" target="_blank"&gt;https://github.com/songjiayang/font-aswsome-upgrade&lt;/a&gt;&lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Tue, 12 May 2015 12:10:14 +0800</pubDate>
      <link>https://ruby-china.org/topics/25534</link>
      <guid>https://ruby-china.org/topics/25534</guid>
    </item>
    <item>
      <title>[安卓机] 请问大家微信浏览器中的 css 如何调试。</title>
      <description>&lt;p&gt;页面样式在微信浏览器中出现问题，通过代码没有快速定位出错位置，所以想看看有没有好的调试方式，例如在 chorme 浏览器中装个某插件就得到和微信浏览器同样渲染结果。&lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Fri, 08 May 2015 17:38:28 +0800</pubDate>
      <link>https://ruby-china.org/topics/25493</link>
      <guid>https://ruby-china.org/topics/25493</guid>
    </item>
    <item>
      <title>[上海徐汇] 诚聘 iOS 工程师和前端工程师各 1 枚</title>
      <description>&lt;p&gt;公司&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;小型外企 Startup，氛围轻松，老洋房办公，自备厨房，淋浴间，私人咖啡馆&lt;/li&gt;
&lt;li&gt;朝 9:30，晚 6:30，一周五天，杜绝加班&lt;/li&gt;
&lt;li&gt;团队成员大多为 85、90 后，夹杂 70 后大叔 御姐若干&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;产品
室内空气质量监测业务（绿色认证 - 监测平台 - 硬件）
公司是目前国内市场上 室内空气 质量（PM2.5，VOC 等）方向的先驱&lt;/p&gt;

&lt;p&gt;这项业务目前处于起步阶段，beta 版硬件已投放几家外企办公室、高端酒店
后端服务已经上线，计划近期内搬入国内
&lt;a href="http://www.airaware.co/" rel="nofollow" target="_blank"&gt;http://www.airaware.co/&lt;/a&gt;
&lt;a href="http://gigareset.org/" rel="nofollow" target="_blank"&gt;http://gigareset.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;你
一枚有经验的 iOS 工程师
有完整开发过至少一个 iPhone APP，1-3 年经验
有眼缘（其他要求见仁见智了，见面详谈就知道合不合适了）&lt;/p&gt;

&lt;p&gt;待遇
10-16k
五险一金，年底双薪&lt;/p&gt;

&lt;p&gt;或者
一枚有经验的前端工程师（偏 css）
熟悉 html 和 css 标准，能够独立将设计实现为页面，0.5-2 年经验&lt;/p&gt;

&lt;p&gt;待遇
8-12k
五险一金，年底双薪&lt;/p&gt;

&lt;p&gt;求砸简历啊
hr#gigabase.org
公司地址：上海广元路 135 号
有个人 blog 和 github 地址也一起砸来吧&lt;/p&gt;</description>
      <author>small_fish__</author>
      <pubDate>Fri, 14 Nov 2014 10:12:56 +0800</pubDate>
      <link>https://ruby-china.org/topics/22680</link>
      <guid>https://ruby-china.org/topics/22680</guid>
    </item>
  </channel>
</rss>
