<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>ltl3884 (ltl3884)</title>
    <link>https://ruby-china.org/ltl3884</link>
    <description>ri,这家伙没签名啊!</description>
    <language>en-us</language>
    <item>
      <title>为什么 JRuby + TorqueBox 相比 Ruby + Passenger 没有显著的提升?</title>
      <description>&lt;p&gt;&lt;strong&gt;2 台 8 核 16G 内存的机器 A 和 B 分别部署 test 项目&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;test 项目为 rails4.1，有一个 controller 返回 json 数据&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;TestController&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ApplicationController&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;index&lt;/span&gt;
        &lt;span class="n"&gt;render&lt;/span&gt; &lt;span class="ss"&gt;:json&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"abc"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;机器 A&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ruby 2.1.5&lt;/li&gt;
&lt;li&gt;passenger 4.0.58&lt;/li&gt;
&lt;li&gt;nginx 1.6.2&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;机器 B&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;jruby .1.7.19&lt;/li&gt;
&lt;li&gt;torquebox 3.1.2&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;机器 A &lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;passenger_min_instances 200;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;并发 200 访问&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;siege -c200 http://localhost/test/index
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2015/d7f903a786ffb04689e0ffd390569a66.png" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;-------------------------------分割线--------------------------------------------&lt;/p&gt;

&lt;p&gt;机器 B &lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;torquebox run --max-threads=200;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;并发 200 访问&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;siege -c200 http://localhost:8080/test/index
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2015/95a52f58658d168685b470a548cd439d.png" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="/robbin" class="user-mention" title="@robbin"&gt;&lt;i&gt;@&lt;/i&gt;robbin&lt;/a&gt; &lt;a href="/doitian" class="user-mention" title="@doitian"&gt;&lt;i&gt;@&lt;/i&gt;doitian&lt;/a&gt; &lt;a href="/huacnlee" class="user-mention" title="@huacnlee"&gt;&lt;i&gt;@&lt;/i&gt;huacnlee&lt;/a&gt; &lt;a href="/rei" class="user-mention" title="@rei"&gt;&lt;i&gt;@&lt;/i&gt;rei&lt;/a&gt; &lt;a href="/flyerhzm" class="user-mention" title="@flyerhzm"&gt;&lt;i&gt;@&lt;/i&gt;flyerhzm&lt;/a&gt;&lt;/p&gt;</description>
      <author>ltl3884</author>
      <pubDate>Mon, 19 Oct 2015 17:01:44 +0800</pubDate>
      <link>https://ruby-china.org/topics/27732</link>
      <guid>https://ruby-china.org/topics/27732</guid>
    </item>
    <item>
      <title>JRuby 线程安全 问题</title>
      <description>&lt;p&gt;使用 jrlint 检查代码发现 &lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="vi"&gt;@configurations&lt;/span&gt; &lt;span class="o"&gt;||=&lt;/span&gt; &lt;span class="no"&gt;Configuration&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;提示&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;" [nonatomic, warning] Non-local operator assignment is not guaranteed to be atomic"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;像这种 lazy initialization 的代码如何修改？&lt;/p&gt;</description>
      <author>ltl3884</author>
      <pubDate>Mon, 07 Sep 2015 18:01:31 +0800</pubDate>
      <link>https://ruby-china.org/topics/27226</link>
      <guid>https://ruby-china.org/topics/27226</guid>
    </item>
    <item>
      <title>有没有 Cucumber 和 RSpec 的最新书籍?</title>
      <description>&lt;p&gt;有没有 cucumber 和 rspec 的最新书籍？ &lt;/p&gt;</description>
      <author>ltl3884</author>
      <pubDate>Mon, 07 May 2012 17:43:44 +0800</pubDate>
      <link>https://ruby-china.org/topics/3134</link>
      <guid>https://ruby-china.org/topics/3134</guid>
    </item>
    <item>
      <title>你们在什么平台下开发 rails?</title>
      <description>&lt;p&gt;以前在 ubuntu 下 gvim&lt;br&gt;
现在用 mac 的 textmate&lt;/p&gt;

&lt;p&gt;觉得 vim 的快捷键按起来 比 textmate 方便多了&lt;/p&gt;

&lt;p&gt;大家觉得呢？&lt;/p&gt;</description>
      <author>ltl3884</author>
      <pubDate>Fri, 02 Mar 2012 11:48:02 +0800</pubDate>
      <link>https://ruby-china.org/topics/1552</link>
      <guid>https://ruby-china.org/topics/1552</guid>
    </item>
  </channel>
</rss>
