unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / Atom feed
From: Eric Wong <e@80x24.org>
To: cyan eccentricyan <eccentricyan@gmail.com>
Cc: unicorn-public@bogomips.org
Subject: Re: unicorn takes 1.4G memory per worker
Date: Sat, 10 Feb 2018 13:52:05 +0000
Message-ID: <20180210135204.GA1348@80x24.org> (raw)
In-Reply-To: <CAN1mbKtog4=8rQnXenHy3U5_NtmWsD7gT6xxv=cM2ZMTT2-1Qw@mail.gmail.com>

cyan eccentricyan <eccentricyan@gmail.com> wrote:
> github . com/unicorn-engine/unicorn/issues/941
> 
> after deploy or restart unicorn, it doesnt resolve the big memory problem
> i want to know what make unicorn memory size and how to make staging
> unicorn size to 230M not 1.4G

You're going to have to analyze your app and all is dependencies
to figure this out; but it's generic Ruby knowledge to fix and
the problem is all over the place...

I get angry as hell when it comes to memory usage but there's
not a lot I can do besides rant(*) and try to fix some things
which come along:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/438693
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/438700

There's more Ruby itself can do (some I intend to work on later
this year); but nothing is going to save you if the apps do wacky
things like load hundreds of thousands of rows from a DB into
memory or try to process giant files all at once.

A lot of of it is mentality: It starts like things like turning
off HTML in your mail client (which roughly triples the size of
mail) and forcing yourself to test and develop against old
hardware on slow connections.


(*) Even 230M is too much IMHO:
https://bogomips.org/unicorn-public/20161212021000.GA15226@untitled/

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-10  7:12 cyan eccentricyan
2018-02-10 13:52 ` Eric Wong [this message]

Reply instructions:

You may reply publically 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-all from there: mbox

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

  List information: https://yhbt.net/unicorn/

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

  git send-email \
    --in-reply-to=20180210135204.GA1348@80x24.org \
    --to=e@80x24.org \
    --cc=eccentricyan@gmail.com \
    --cc=unicorn-public@bogomips.org \
    /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

unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help

Archives are clonable:
	git clone --mirror https://yhbt.net/unicorn-public
	git clone --mirror http://ou63pmih66umazou.onion/unicorn-public

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.unicorn
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.unicorn

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git