From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.25.143.3 with SMTP id r3csp1533271lfd; Sat, 22 Aug 2015 14:54:22 -0700 (PDT) X-Received: by 10.68.88.130 with SMTP id bg2mr30738585pbb.129.1440280460883; Sat, 22 Aug 2015 14:54:20 -0700 (PDT) Return-Path: Received: from mail-pa0-x23d.google.com (mail-pa0-x23d.google.com. [2607:f8b0:400e:c03::23d]) by mx.google.com with ESMTPS id vz8si19892373pac.74.2015.08.22.14.54.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Aug 2015 14:54:20 -0700 (PDT) Received-SPF: pass (google.com: domain of rack-devel+bncBCR75BPVVQMRBCW74OXAKGQEV6BSQCA@googlegroups.com designates 2607:f8b0:400e:c03::23d as permitted sender) client-ip=2607:f8b0:400e:c03::23d; Authentication-Results: mx.google.com; spf=pass (google.com: domain of rack-devel+bncBCR75BPVVQMRBCW74OXAKGQEV6BSQCA@googlegroups.com designates 2607:f8b0:400e:c03::23d as permitted sender) smtp.mailfrom=rack-devel+bncBCR75BPVVQMRBCW74OXAKGQEV6BSQCA@googlegroups.com; dkim=pass header.i=@googlegroups.com; dkim=pass header.i=@gmail.com; dmarc=pass (p=NONE dis=NONE) header.from=gmail.com Received: by mail-pa0-x23d.google.com with SMTP id l1sf16974873pax.1; Sat, 22 Aug 2015 14:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :sender:list-subscribe:list-unsubscribe; bh=VC1IBbAe9nzIs7mCaICJvrluF434OrfJKlohfeHLik4=; b=HpQEHcw5TIRJEjBpybELqkqbDL+J776cKN1wYf8IpwQGQ9d51LibhIFr9ljzM9M0w7 kKqhwDNsAGcvF0Jh4XrloqQ/GkNvU1jvdDHLDYyKUs7tvH4XyQ0KoI388wH/ksvXM9Fn tQ2KrhR5FZZiw0/fJOYaqiSXYZFFmnv7r+3s7c4NbG8Bf7dQJg9t7fIAhpbwI0QobI1f Bva/+GhN5WJTJ5XLzaXPuc9BAX84KhWq7Qi0nbJsxoUDYo//Tg8uUDSt1XVcdd7gHEUH dpm9HDkTbkXL1gDRBrtPhq+iLrh1U3MYDlsmFFE7zq2Pd6IaPn0o+OgCDCRl6ZMERQdu VOSg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :sender:list-subscribe:list-unsubscribe; bh=VC1IBbAe9nzIs7mCaICJvrluF434OrfJKlohfeHLik4=; b=dtm8jmLiV4rqLNMdBCc6uFYMwx8LtPeBtod1g1k+OxPRgEBnAPE3tsT7ZQhEBshRID If8A5P2BOFsXvkDF2m9xheIVIq0bJKlTSaP6t14YNsaKwG1gy26cVRwRFTqtXKZ1Vsvf o4vONWtMcAQsDx/7k3cAWQHEkBFmOmfSJ+sH05veu69iPTGD8k0aUdwtfp/4Yc9gVO2E O7qQ0ojLtIz4Iqo3Dz4mgzB89XUP2lajjs3BVkBSJA4zJTriiquIZmsw1FEgEQoJaeez wQkG8N2EE+iJKpAhXdDMTbUN+gsOr6yo4gaQQJgzpzQqJAP/TOflOMQe2gSQitopsSMn Qaeg== X-Received: by 10.50.152.6 with SMTP id uu6mr154103igb.4.1440280459453; Sat, 22 Aug 2015 14:54:19 -0700 (PDT) X-BeenThere: rack-devel@googlegroups.com Received: by 10.50.79.196 with SMTP id l4ls791470igx.22.canary; Sat, 22 Aug 2015 14:54:18 -0700 (PDT) X-Received: by 10.50.28.19 with SMTP id x19mr152523igg.16.1440280458826; Sat, 22 Aug 2015 14:54:18 -0700 (PDT) Date: Sat, 22 Aug 2015 14:54:17 -0700 (PDT) From: David Unric To: Rack Development Message-Id: In-Reply-To: <1440276882101.d5f8b2d3@Nodemailer> References: <9d5cc646-0803-42c3-b118-f54a4cf8c6c0@googlegroups.com> <1440276882101.d5f8b2d3@Nodemailer> Subject: Re: Rack and memory usage ? MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_833_32675998.1440280457377" X-Original-Sender: dunric29a@gmail.com Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: rack-devel@googlegroups.com X-Google-Group-Id: 486215384060 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , ------=_Part_833_32675998.1440280457377 Content-Type: multipart/alternative; boundary="----=_Part_834_1289726653.1440280457377" ------=_Part_834_1289726653.1440280457377 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Simple script takes about 6.2 MiB of memory with Ruby 2.2.3 on x86_64=20 machine ruby --disable=3Dgems,rubyopt -e 'gets' so 31 - 5 - 6.2 =E2=89=88 20 MiB is for Rack Not saying this is bad but if there is a way how to push it lower. AFAIK=20 all ruby web servers are built upon Rack, not aware of any going its own=20 independent way. Thanks for link to derailed_benchmarks gem. Looks promising, definitely=20 would take a closer look at it. Btw. CRuby does not seem any worse then his "main" rival. Equivalent script= =20 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= =20 > Ruby 2.0 it's 17.9mb for me. Ruby is not known to be the most memory=20 > efficient language.=20 > > I wrote a tool to help debug memor use in apps, check it out=20 > https://github.com/schneems/derailed_benchmarks > > You can run=20 > > $ derailed bundle:mem > > To see the memory impact of all the gems you're using at require time.=20 > > Here's more information:=20 > http://www.schneems.com/2015/05/11/how-ruby-uses-memory.html > > > > > --- > Richard Schneeman=20 > http://www.schneems.com > > > > On Sat, Aug 22, 2015 at 3:39 PM, David Unric > wrote: > >> Hi, >> >> I'm asking if am I doing something wrong or is normal for a minimal rack= =20 >> application have memory footprint over 25 MiB ? >> >> I'd like to reduce the memory usage as possible for deployment of a=20 >> Sinatra app on small x86 Linux NAS device. I did measured the memory usa= ge=20 >> and Rack occupies about excessive 26 from total of 31 MiB (the rest is T= hin=20 >> server + the app). >> >> Is there some Rack-lite or some trick how to shake-off unnecessary code= =20 >> to get it on diet ? >> >> Thanks. >> >> --=20 >> >> ---=20 >> You received this message because you are subscribed to the Google Group= s=20 >> "Rack Development" group. >> To unsubscribe from this group and stop receiving emails from it, send a= n=20 >> email to rack-devel+...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > --=20 ---=20 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 e= mail to rack-devel+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_834_1289726653.1440280457377 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Simple script takes about 6.2 MiB of memory with Ruby 2.2.= 3 on x86_64 machine

=C2=A0=C2=A0=C2=A0 ruby --disable=3Dgems,rubyopt= -e 'gets'

so=C2=A0 31 - 5 - 6.2 =E2=89=88 20 MiB is for Rac= k

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. Lo= oks 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 memor= y efficient language.=C2=A0

I wrote a tool to help debug memor use in apps, check it out https://github.com/schneems/derailed_benchmarks

You can run=C2=A0

$ derailed bundle:mem

To see the memory impact of all the gems you're using at require t= ime.=C2=A0





---
Richard Schneeman



On Sat, Aug 22, 2015 at 3:39 PM, Davi= d Unric <dunr...@gmail.com> 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 deploymen= t 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 &= quot;Rack Development" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to rack-devel+...@googlegroups.com.
For more options, visit https://groups.google.com/= d/optout.

--

---
You received this message because you are subscribed to the Google Groups &= quot;Rack Development" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to rack-dev= el+unsubscribe@googlegroups.com.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_834_1289726653.1440280457377-- ------=_Part_833_32675998.1440280457377--