rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: David Unric <dunric29a@gmail.com>
To: Rack Development <rack-devel@googlegroups.com>
Subject: Re: Rack and memory usage ?
Date: Sat, 22 Aug 2015 14:54:17 -0700 (PDT)	[thread overview]
Message-ID: <d5450e4b-559f-423f-b38a-315e20fe931e@googlegroups.com> (raw)
In-Reply-To: <1440276882101.d5f8b2d3@Nodemailer>


[-- Attachment #1.1: Type: text/plain, Size: 2540 bytes --]

Simple script takes about 6.2 MiB of memory with Ruby 2.2.3 on x86_64 
machine

    ruby --disable=gems,rubyopt -e 'gets'

so  31 - 5 - 6.2 ≈ 20 MiB is for Rack

Not saying this is bad but if there is a way how to push it lower. AFAIK 
all ruby web servers are built upon Rack, not aware of any going its own 
independent way.

Thanks for link to derailed_benchmarks gem. Looks promising, definitely 
would take a closer look at it.

Btw. CRuby does not seem any worse then his "main" rival. Equivalent script 
takes about 6.4 MiB with Python 2.7.10 and 7.7 MiB on Python 3.4.3.

On Saturday, August 22, 2015 at 10:54:44 PM UTC+2, richard schneeman wrote:
>
> Just running `irb` with no libraries is 9.9 mb for me with Ruby 2.2.3. In 
> Ruby 2.0 it's 17.9mb for me. Ruby is not known to be the most memory 
> efficient language. 
>
> I wrote a tool to help debug memor use in apps, check it out 
> https://github.com/schneems/derailed_benchmarks
>
> You can run 
>
> $ derailed bundle:mem
>
> To see the memory impact of all the gems you're using at require time. 
>
> Here's more information: 
> http://www.schneems.com/2015/05/11/how-ruby-uses-memory.html
>
>
>
>
> ---
> Richard Schneeman 
> http://www.schneems.com
>
>
>
> On Sat, Aug 22, 2015 at 3:39 PM, David Unric <dunr...@gmail.com 
> <javascript:>> wrote:
>
>> Hi,
>>
>> I'm asking if am I doing something wrong or is normal for a minimal rack 
>> application have memory footprint over 25 MiB ?
>>
>> I'd like to reduce the memory usage as possible for deployment of a 
>> Sinatra app on small x86 Linux NAS device. I did measured the memory usage 
>> and Rack occupies about excessive 26 from total of 31 MiB (the rest is Thin 
>> server + the app).
>>
>> Is there some Rack-lite or some trick how to shake-off unnecessary code 
>> to get it on diet ?
>>
>> Thanks.
>>
>> -- 
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Rack Development" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to rack-devel+...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups "Rack Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rack-devel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 5426 bytes --]

  reply	other threads:[~2015-08-22 21:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-22 17:58 Rack and memory usage ? David Unric
2015-08-22 20:54 ` richard schneeman
2015-08-22 21:54   ` David Unric [this message]
2015-08-24 23:16     ` James Tucker
2015-08-25 12:17       ` Christian Neukirchen
2015-08-27  7:01       ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://groups.google.com/group/rack-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d5450e4b-559f-423f-b38a-315e20fe931e@googlegroups.com \
    --to=rack-devel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).