ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: v.ondruch@tiscali.cz
To: ruby-core@ruby-lang.org
Subject: [ruby-core:87616] [Ruby trunk Feature#14718] Use jemalloc by default?
Date: Sat, 23 Jun 2018 18:39:03 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-72635.20180623183902.a7fbcb70ee1e42ed@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-14718.20180427161410@ruby-lang.org

Issue #14718 has been updated by vo.x (Vit Ondruch).


Fedora and RHEL Ruby maintainer here. Just a few remarks.

mperham (Mike Perham) wrote:
> ~~~
> Bundle jemalloc and link it statically.
> 
>     pro: No runtime hell.
>     con: Bloats source distribution. Costs non-glibc users.
>     con: Also costs the core devs because they have to sync the bundled jemalloc with the upstream.
> ~~~
> 
> This would be my choice as a maintainer and I trust antirez knows what he's doing when he made the same choice for Redis.  You control the exact version and any resulting bugs.  If you depend on the distro's package, you will integrate with a variety of versions, all with their own set of platform-specific bugs and crash reports.  Ubuntu 14 might have jemalloc 3.6.0, 16 might have 4.2.0, 18 might have 5.0.1, etc.  Dealing with those platform issues will also cost the core devs.

We are always against bundling. You make great disservice to almost every Linux distribution if you ever suggest/consider bundling.


normalperson (Eric Wong) wrote:
> shyouhei@ruby-lang.org wrote:
>  > So, I think it's clear people are interested in replacing _glibc_ malloc, not everything that exist in the whole universe.
>  > 
>  > Let's discuss how we achieve that.  There can be several ways:
>  > 
>  > - Just enable `--with-jemalloc` default on, only for Linux.
>  >     - pro: This is the easiest to implement.
>  >     - pro: Arguably works well. Already field proven.
>  >     - con: Mandates runtime dependency for libjemalloc on those systems.
>  
>  How about only link against it by default if detected.  It will
>  be like our optional dependency on GMP.

This is the preferred way of course. Specifying `--with-jemalloc` configure option while I still have to add `BuildRequires: jemalloc-devel` on the top of the Ruby package just duplicates the effort.

OTOH, if somebody is building Ruby on their system, they want to be in control and be able to disable jemalloc, although the jemalloc-devel is installed. But that is not the case for building package, since in that time we start with minimal buildroot and add just what is necessary.

normalperson (Eric Wong) wrote:
> We will depend on distros to enable/disable the dependency on it.

Thx :) I think that at least in Fedora/RHEL case, the decision will be based on this discussion and on the Ruby defaults, unless some glibc maintainer chimes in and provides some great arguments against.

----------------------------------------
Feature #14718: Use jemalloc by default?
https://bugs.ruby-lang.org/issues/14718#change-72635

* Author: mperham (Mike Perham)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
I know Sam opened #9113 4 years ago to suggest this but I'm revisiting the topic to see if there's any movement here for Ruby 2.6 or 2.7.  I supply a major piece of Ruby infrastructure (Sidekiq) and I keep hearing over and over how Ruby is terrible with memory, a huge memory hog with their Rails apps.  My users switch to jemalloc and a miracle occurs: their memory usage drops massively.  Some data points:

https://twitter.com/brandonhilkert/status/987400365627801601
https://twitter.com/d_jones/status/989866391787335680
https://github.com/mperham/sidekiq/issues/3824#issuecomment-383072469

Redis moved to jemalloc many years ago and it solved all of their memory issues too.  Their conclusion: the glibc allocator "sucks really really hard". http://oldblog.antirez.com/post/everything-about-redis-24.html

This is a real pain point for the entire Rails community and would improve Ruby's reputation immensely if we can solve this problem.



-- 
https://bugs.ruby-lang.org/

  parent reply	other threads:[~2018-06-23 18:39 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-14718.20180427161410@ruby-lang.org>
2018-04-27 16:14 ` [ruby-core:86725] [Ruby trunk Feature#14718] Use jemalloc by default? mperham
2018-04-27 18:12   ` [ruby-core:86731] " Eric Wong
2018-04-27 18:13     ` [ruby-core:86732] " Koichi Sasada
2018-04-27 16:30 ` [ruby-core:86726] " merch-redmine
2018-04-27 16:38 ` [ruby-core:86728] " mperham
2018-04-27 18:50 ` [ruby-core:86734] " shevegen
2018-04-27 19:28 ` [ruby-core:86735] " rr.rosas
2018-04-27 19:59 ` [ruby-core:86736] " rr.rosas
2018-04-27 21:59 ` [ruby-core:86738] " mperham
2018-04-28  4:36 ` [ruby-core:86742] " the.codefolio.guy
2018-04-28 19:52 ` [ruby-core:86752] " nobu
2018-04-28 20:33 ` [ruby-core:86753] " mperham
2018-04-29  8:21 ` [ruby-core:86760] " shyouhei
2018-04-30 15:57 ` [ruby-core:86777] " mperham
2018-05-01  1:46 ` [ruby-core:86786] " shyouhei
2018-05-02 17:31 ` [ruby-core:86843] " mperham
2018-05-02 21:00   ` [ruby-core:86844] " Eric Wong
2018-05-15  8:33     ` [ruby-core:87036] " Eric Wong
2018-05-08  2:27 ` [ruby-core:86936] " davidtgoldblatt
2018-05-08  3:34 ` [ruby-core:86938] " mame
2018-05-10  5:11 ` [ruby-core:86962] " dennisb55
2018-05-10  5:37 ` [ruby-core:86964] " dennisb55
2018-05-10  5:55 ` [ruby-core:86965] " merch-redmine
2018-05-10  6:26 ` [ruby-core:86966] " dennisb55
2018-05-10 17:20 ` [ruby-core:86971] " merch-redmine
2018-05-11  1:31 ` [ruby-core:86975] " shyouhei
2018-05-11  2:19   ` [ruby-core:86978] " Eric Wong
2018-05-11  3:01 ` [ruby-core:86979] " mame
2018-05-11  3:28 ` [ruby-core:86982] " dennisb55
2018-05-11  3:38 ` [ruby-core:86984] " dennisb55
2018-05-11  4:00 ` [ruby-core:86985] " dennisb55
2018-05-11  4:07 ` [ruby-core:86986] " dennisb55
2018-05-11 16:23 ` [ruby-core:86999] " mperham
2018-05-12  0:58 ` [ruby-core:87003] " dennisb55
2018-05-14  0:09 ` [ruby-core:87012] " shyouhei
2018-05-14  2:14 ` [ruby-core:87014] " dennisb55
2018-05-14  3:16 ` [ruby-core:87015] " shyouhei
2018-05-14  6:42 ` [ruby-core:87016] " dennisb55
2018-05-14  7:33 ` [ruby-core:87017] " sam.saffron
2018-05-14  7:53 ` [ruby-core:87020] " shyouhei
2018-05-14  8:30 ` [ruby-core:87023] " dennisb55
2018-05-14 15:58 ` [ruby-core:87027] " mperham
2018-05-14 16:31 ` [ruby-core:87028] " wyhaines
2018-05-15  3:49 ` [ruby-core:87031] " mame
2018-05-15  7:17 ` [ruby-core:87033] " sam.saffron
2018-05-15 23:16 ` [ruby-core:87048] " mperham
2018-05-16  5:11 ` [ruby-core:87060] " dennisb55
2018-05-16  5:14 ` [ruby-core:87061] " dennisb55
2018-05-16  5:29 ` [ruby-core:87064] " mperham
2018-05-16  5:54 ` [ruby-core:87065] " dennisb55
2018-05-16  9:09   ` [ruby-core:87071] " Eric Wong
2018-05-16 18:45 ` [ruby-core:87086] " mperham
2018-05-16 19:22 ` [ruby-core:87087] " merch-redmine
2018-05-16 20:12 ` [ruby-core:87088] " mperham
2018-05-16 23:54 ` [ruby-core:87090] " mame
2018-05-17 17:31 ` [ruby-core:87145] " mperham
2018-05-18  3:10 ` [ruby-core:87154] " dennisb55
2018-05-18  3:13 ` [ruby-core:87155] " dennisb55
2018-05-18  3:19 ` [ruby-core:87156] " dennisb55
2018-05-18  3:49 ` [ruby-core:87159] " mperham
2018-05-18  4:10 ` [ruby-core:87160] " dennisb55
2018-05-18  7:59   ` [ruby-core:87164] " Eric Wong
2018-05-19  2:55 ` [ruby-core:87186] " dennisb55
2018-05-22  1:12   ` [ruby-core:87216] " Vladimir Makarov
2018-05-23  2:57   ` [ruby-core:87230] " Eric Wong
2018-05-22 16:25 ` [ruby-core:87224] " mperham
2018-05-22 20:22 ` [ruby-core:87225] " mperham
2018-05-23  0:38 ` [ruby-core:87229] " dennisb55
2018-05-23  4:22 ` [ruby-core:87231] " mperham
2018-05-29 20:34 ` [ruby-core:87299] " edchick
2018-06-23 18:39 ` v.ondruch [this message]
2018-06-25  0:36 ` [ruby-core:87626] " nobu
2018-07-26 18:51 ` [ruby-core:88127] " carlos
2018-07-29  1:18 ` [ruby-core:88156] " andregsakata
2018-07-29  4:27 ` [ruby-core:88161] " dennisb55
2018-07-29  4:31 ` [ruby-core:88162] " dennisb55
2018-07-29  7:45 ` [ruby-core:88163] " fweimer
2018-07-30 10:16   ` [ruby-core:88192] " Eric Wong
2018-08-01  1:00     ` [ruby-core:88244] " Eric Wong
2018-07-29  8:38 ` [ruby-core:88164] " fweimer
2018-07-29 15:16 ` [ruby-core:88165] " andregsakata
2018-07-29 16:34 ` [ruby-core:88166] " andregsakata
2018-07-29 17:39 ` [ruby-core:88168] " andregsakata
2018-07-30 12:16 ` [ruby-core:88195] " fweimer
2018-07-30 13:16 ` [ruby-core:88196] " andregsakata
2018-07-30 13:20 ` [ruby-core:88197] " fweimer
2018-07-30 16:16 ` [ruby-core:88208] " andregsakata
2018-07-30 20:27 ` [ruby-core:88216] " davidtgoldblatt
2018-07-30 22:46 ` [ruby-core:88220] " andregsakata
2018-07-31  0:31 ` [ruby-core:88223] " dennisb55
2018-08-01  0:14 ` [ruby-core:88238] " sam.saffron
2018-08-01  9:55   ` [ruby-core:88256] " Eric Wong
2018-08-01  0:55 ` [ruby-core:88243] " mperham
2018-08-01  2:12 ` [ruby-core:88245] " sam.saffron
2018-08-01  3:41 ` [ruby-core:88247] " dennisb55
2018-08-02  0:04 ` [ruby-core:88266] " sam.saffron
2019-02-07  3:53 ` [ruby-core:91445] " mame
2019-02-09  4:42 ` [ruby-core:91499] " dennisb55
2019-03-14 16:52 ` [ruby-core:91832] " msiegel
2019-03-14 20:02 ` [ruby-core:91836] " fredngo
2019-03-14 20:35 ` [ruby-core:91838] " sam.saffron
2019-03-15  6:50 ` [ruby-core:91843] " dennisb55

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://www.ruby-lang.org/en/community/mailing-lists/

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

  git send-email \
    --in-reply-to=redmine.journal-72635.20180623183902.a7fbcb70ee1e42ed@ruby-lang.org \
    --to=ruby-core@ruby-lang.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.
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).