unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / 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	[thread overview]
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	other threads:[~2018-02-10 13:52 UTC|newest]

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

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-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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

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).