unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: murdering high-memory workers and auto-scaling
Date: Thu, 1 Mar 2012 17:20:16 -0800	[thread overview]
Message-ID: <20120302012016.GB12687@dcvr.yhbt.net> (raw)
In-Reply-To: <CAO1NZAqqfQRHhSz0jxcTtO6ngxOxFSq5dQm7UPJdXm7uidV79g@mail.gmail.com>

Ben Somers <somers.ben@gmail.com> wrote:
> First: auto-killing bloated workers. My current app has some memory
> leakage that wasn't really visible on our older passenger setup, since

Btw, you reported issues with memory usage on a Ubuntu system
a few months ago, is this the same system?  Are you using stock
malloc() or tcmalloc()?  (tcmalloc comes standard with REE afaik
and never releases memory to the kernel).

For glibc malloc (ptmalloc) users I mentioned MALLOC_MMAP_THRESHOLD_,
but forgot about MALLOC_ARENA_MAX.

Since MRI is mostly single-threaded (especially the memory allocation
portions), I'm tending to think the per-thread optimizations in glibc
malloc do not help in most cases and will only lead to internal
fragmentation.  So perhaps setting MALLOC_ARENA_MAX=1 (perhaps along
with mmap threshold) in the environment will reduce fragmentation
and memory usage.

It doesn't look like the MALLOC_ARENA_* environment variables are
in the manpages, yet: http://udrepper.livejournal.com/20948.html
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying

      parent reply	other threads:[~2012-03-02  1:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-01 23:52 murdering high-memory workers and auto-scaling Ben Somers
2012-03-02  0:12 ` Clifton King
2012-03-02  1:07 ` Eric Wong
2012-03-02  1:20 ` 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=20120302012016.GB12687@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=mongrel-unicorn@rubyforge.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).