cmogstored dev/user discussion/issues/patches/etc
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: mogile@googlegroups.com
Cc: cmogstored-public@bogomips.org
Subject: mogstored (and cmogstored) threads per device
Date: Sun, 2 Nov 2014 09:57:50 +0000	[thread overview]
Message-ID: <20141102-revisiting-threads-per-dev@mogile> (raw)

Currently, mogstored uses 10 threads per device, with a cap of 100
threads total.  This was set in 2006[1] when it was probably rare to
have 10 devices on commodity hardware.  I suspect the 100 cap is
necessary with more devices as IO::AIO does not set a limit on pthread
stacks sizes (and typical pthreads stack sizes are huge by default).

For rotational disks, using multiple OS-level threads as Perl IO::AIO
and cmogstored do is still the only way to get concurrency for all
FS-level ops[2].

cmogstored also uses 10 threads per device, but with no cap.  It will
continue gracefully if the OS limits on thread creation are reached.
On a modern GNU/Linux or FreeBSD, I'm comfortable having no cap in
cmogstored with 20K page stacks (+4K guard stack).

However, cmogstored is completely multi-threaded with no Perl
bottlenecks.  Thus the threads are also subject to less wait time
and contend for more CPU time.

So I'm considering lowering default thread counts in cmogstored.
Maybe conservatively to 8 per-device; but maybe as drastically as
2-4 per-device.  Maybe mogstored can use a lower default, too.

Any thoughts?

Of course, anybody can also set "SERVER aio_threads = XX" via
sidechannel on either server, but the the goal is to lower memory usage
and reduce scheduler overhead out-of-the-box.

I'm also considering shipping the venerable dlmalloc in cmogstored[3].
glibc default arena knobs are completely wrong for cmogstored and
not enough people read the cmogstored manpage or glibc docs for
recommendations on tuning malloc...

[1] git commit de43ded3658311b83dd23f4176b2fc37c8497599 or SVN r390
[2] The POSIX AIO and Linux-kernel-only AIO APIs lack
    analogous interfaces for open, stat, unlink, etc...
[3] http://bogomips.org/cmogstored-public/m/import-and-use-dlmalloc-2.8.6%40s

             reply	other threads:[~2014-11-02  9:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-02  9:57 Eric Wong [this message]
2014-12-16  7:18 ` mogstored (and cmogstored) threads per device dormando
2014-12-16  8:40   ` Eric Wong

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/cmogstored/README

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

  git send-email \
    --in-reply-to=20141102-revisiting-threads-per-dev@mogile \
    --to=e@80x24.org \
    --cc=cmogstored-public@bogomips.org \
    --cc=mogile@googlegroups.com \
    /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/cmogstored.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).