public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Davide Libenzi <davidel@xmailserver.org>
To: bert hubert <ahu@ds9a.nl>
Cc: linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@transmeta.com>,
	Ulrich Drepper <drepper@cygnus.com>
Subject: RE: huge number of context switches under 2.2.x with SMP & threa
Date: Tue, 17 Jul 2001 16:29:23 -0700 (PDT)	[thread overview]
Message-ID: <XFMail.20010717162923.davidel@xmailserver.org> (raw)
In-Reply-To: <20010718011329.A1829@home.ds9a.nl>


On 17-Jul-2001 bert hubert wrote:
> A threads related question - I have a nameserver with 8 active threads,
> which in turn leads to 6 (in this case) MySQL connections. When
> stresstesting this nameserver, we see a *huge* number of context switches.
> 50.000 has been observered. When raising this to ~50 active threads and ~50
> MySQL connections we've seen 100.000 context switches/second. Performance
> suffers.
> 
> This is a RedHat 6.2 system with a 2.2.16 kernel, 2*PIII, 900MHz.
> 
> I saw some mention of this problem on the MySQL site with regards to
> processes holding a pthread_mutex_lock() for short amounts of time. They
> advise to use 2.4 but right now that is not within the scope of my options.
> 
> My question: is there a 2.2 kernel in which this is resolved? And secondly,
> is there a way to prevent this problem purely from userspace? In other
> words, what causes this problem.
> 
> The MySQL site also mentions that 2.4 could do better in some ways,
> especially regarding 'overspin'.

If the lock is contended the thread start spinning with sched_yield() for a
given number of times.
This could result in an high ctx switch rate with quite long runqueue also.




- Davide


      reply	other threads:[~2001-07-17 23:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-17  4:21 [BUG 2.4.6] PPID of a process is set to itself Tachino Nobuhiro
2001-07-17  4:41 ` Linus Torvalds
2001-07-17  6:10   ` Tachino Nobuhiro
2001-07-17  6:40     ` Linus Torvalds
2001-07-17  7:08       ` Ulrich Drepper
2001-07-17 23:13         ` huge number of context switches under 2.2.x with SMP & threaded apps bert hubert
2001-07-17 23:29           ` Davide Libenzi [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

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

  git send-email \
    --in-reply-to=XFMail.20010717162923.davidel@xmailserver.org \
    --to=davidel@xmailserver.org \
    --cc=ahu@ds9a.nl \
    --cc=drepper@cygnus.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox