For the past two days, ruby development web site performance test summary

This is only the individual test, is also a ruby beginner test, if ill-Optimize and causing significant error also invited Members to make the exhibitions.

  1. Rails vs Rack vs Merb:
    Merb worse performance than Rails, but documents, rich plug-ins, plus Rack can deal with some of the demand for high-speed. Also heard to Merb into Rails, high-speed processing and Metal, really unlimited prospects.
    Rack one word fast, cool.
    Merb looks beautiful, but found that too little documentation. All beginners do not test, such as I want to let ActiveRecord support for Enum types, Merb seems to need its own sword, and Rails can be used with a speed of static> Rack> Merb> Rails
    The speed of horizontal comparison
    Static Rack Merb Rails
    Speed 3130 1192 305 180

    (Unit: reqs / sec)

  2. Cache:
    page cache is very convenient, but also directly generate html, can easily realize the whole point of static, and only if the id of each file are kept in the same directory, it is hard to imagine tens of thousands of documents squeezed in a directory. cache has yet to be studying. Fragment seems to be able to solve this problem.
    For very simple helloworld, action cache unpleasant anti-slow. reqs from 180 down to 150.
  3. Server:
    Fastcgi faster than a lot of Mongrel. Mongrel easier to use. I now use development are mongrel, production using fastcgi
    Nginx and lighttpd almost fast,
    apache2 performance mod_rails remember the good, the specific numerical forget, apache2 is too large, memory accounted for much more flexibility to configure Nginx not good, and in terms of performance and Nginx and Lighttpd have not a small gap, so no longer be considered.
  4. Personally, I finally Orientation:
    Nginx + Fastcgi + Rails + Rack as my Rails platform.

In addition to my blog are Medium ruby in the recent study, ruby now give me the greatest feeling is flexible and convenient.

2009-1-21 added:

  1. Fastcgi
    After practice, found at fastcgi on lighttpd is better, the best performance and stability for Rails platform or recognized Lighttpd + Fastcgi. However, it is undeniable nginx for a very good server, especially in the configuration of him, I was particularly China and Italy.
  2. Cache
    Fragment Cache referred to as the Page Cache with two different levels of cache,
    Page to provide the full text of cache, the controller in caches_page: actionName form.
    Fragment for regional cache, in the views in a <% cache do%> xxx <% end%> form.
    Fragment Cache memory about the way such as documents mentioned in
    #Memory cache, and is the default cache
    ActionController::Base.cache_store = :memory_store
    #To save a file
    ActionController::Base.cache_store = :file_store, "/path/to/cache/directory"
    ActionController::Base.cache_store = :drb_store, "druby://localhost:9192"
    ActionController::Base.cache_store = :mem_cache_store, "localhost"
    ActionController::Base.cache_store ="parameter") #Rewrite its own Store

    Environment can be added in the statement set config.cache_store = xxx

    Online article a lot of use out-of-date version of the rails still exist fragment_cache_store = as a tutorial, a lot of people take a detour. Rails upgrade or so at the process of studying, reading changelog is necessary.

    About Custom Store online tutorial appears to have done little, but its not complicated, because of rails open source, everyone can refer to MemoryStore source memorystore_cache.rb
    Such as class MyOwnStore <ActiveSupport:: Cache:: Store and rewrite write, read, etc., you can easily develop Fragment caching methods.

    About more cache can refer to But attention to the version of rails is also obsolete, because of its log or show Completed in 0.18700 (5 reqs / sec) | Rendering: 0.10900 (58%) | DB: 0.00000 (0%) forms.

分类:Ruby 时间:2009-03-08 人气:697
blog comments powered by Disqus


  • Swig to expand the use of ruby performance 2009-03-12

    In the use of ruby / rails process, did find that sometimes unsatisfactory performance, such as to generate a 600 layer 3 of the item directory tree structure go take 20ms, to improve performance in the study using c / c + + Writing ruby module proce

  • Section: Linux performance analysis and tuning description 2010-07-08

    Linux performance analysis and tuning describes EDITORIAL: computer to solve the basic problem is how the hardware capabilities without adding more cases to enable them to do more work; and we apply the principles of design flexibility is an importan

  • Shows the performance of large amounts of data server tips Performance Tips for Displaying Large Volume of Data from Server 2010-10-29 When coming from the server need to display large amounts of data, we can use the DataGrid datagrid for the UI, the data provider to a ArrayCollection: var datagrid: DataGrid = new DataGrid (); datagrid.dataprov

  • ruby page cache page cache 2009-08-10

    Format cache page: application.rb method def will_paginate_format(paginator, options={}) #update = options.delete(:update) str = will_paginate(paginator, options) str.gsub!(/\?id=(\d)*/, "") end Routing configuration map.connect 'posts/index/:pa

  • Linux kernel file Cache management mechanism introduced 2010-08-18

    1 Introduction Since its inception, Linux was continuously improved and popularity, now it has become one of the mainstream of general operating system, used well or very broad, Ta with Windows, UNIX Together account for nearly all the operating syst

  • Caching with Nginx's proxy_cache replaced by Squid 2011-05-06

    [Author of the article: Zhang Yan paper version: v1.2 Last modified: 2009.01.12 reprint please indicate the original link: ] Nginx from the 0.7.48 release, support for Squid cache similar function. This cache is used

  • 个人收藏列表 2012-04-03

    SQL Injection Cheat Sheet ( sql injection, security, web application security) ad.(Find and exploit SQL Injections with free Netsparker SQL Injection Scanner) 介绍很多内存管理相关的Blog,

  • Custom powerful, ActiveReports For. NET Development Report Lee 2010-08-18

    ActiveReports For. NET 6.0 is a powerful. NET report controls can be used for both Windows Forms and Web Forms platforms, with custom, high performance, high-quality, multi-language support function, can report design, print, browse , conversion, int

  • Image load balancing 2011-02-22

    Mass picture storage and load balancing for distributed research (Analysis) Abstract: The massive picture of access to the site to bring down the speed, performance pressure and I / O bottlenecks and other issues, proposed a massive picture of the di

iOS 开发

Android 开发

Python 开发



PHP 开发

Ruby 开发






Javascript 开发

.NET 开发



Copyright (C), All Rights Reserved. 版权所有 闽ICP备15018612号

processed in 0.085 (s). 12 q(s)