From owner-freebsd-questions@FreeBSD.ORG Mon Jun 30 17:15:01 2008 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 739681065678 for ; Mon, 30 Jun 2008 17:15:01 +0000 (UTC) (envelope-from michel@lpthe.jussieu.fr) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by mx1.freebsd.org (Postfix) with ESMTP id 04D1D8FC26 for ; Mon, 30 Jun 2008 17:15:00 +0000 (UTC) (envelope-from michel@lpthe.jussieu.fr) Received: from parthe.lpthe.jussieu.fr (parthe.lpthe.jussieu.fr [134.157.10.1]) by shiva.jussieu.fr (8.14.3/jtpda-5.4) with ESMTP id m5UGq6D2011668 for ; Mon, 30 Jun 2008 18:52:07 +0200 (CEST) X-Ids: 166 Received: from niobe.lpthe.jussieu.fr (niobe.lpthe.jussieu.fr [134.157.10.41]) by parthe.lpthe.jussieu.fr (Postfix) with ESMTP id C6F75236FEA for ; Mon, 30 Jun 2008 18:52:05 +0200 (CEST) Received: by niobe.lpthe.jussieu.fr (Postfix, from userid 2005) id B7DEB30; Mon, 30 Jun 2008 18:52:05 +0200 (CEST) Date: Mon, 30 Jun 2008 18:52:05 +0200 From: Michel Talon To: questions@freebsd.org Message-ID: <20080630165205.GA3033@lpthe.jussieu.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (shiva.jussieu.fr [134.157.0.166]); Mon, 30 Jun 2008 18:52:07 +0200 (CEST) X-Virus-Scanned: ClamAV 0.93/7412/Mon Jun 9 16:34:57 2008 on shiva.jussieu.fr X-Virus-Status: Clean X-Miltered: at jchkmail.jussieu.fr with ID 48690F37.000 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Enveloppe: 48690F37.000/134.157.10.1/parthe.lpthe.jussieu.fr/parthe.lpthe.jussieu.fr/ X-j-chkmail-Score: MSGID : 48690F37.000 on jchkmail.jussieu.fr : j-chkmail score : . : R=. U=. O=. B=0.030 -> S=0.030 X-j-chkmail-Status: Ham Cc: Subject: Re: Too Much Context Switching? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2008 17:15:01 -0000 Kris Kennaway wrote: > In 6.x. the default thread library is quite inefficient although it can > make use of multiple CPUs (again, providing the application is giving > them work to do). For multi-threaded performance you will be better off > switching to the libthr library (see libmap.conf(5)) or updating to 7.0 > (where it is the default). This isn't likely to be the underlying issue > if you are trying to debug a loss of performance relative to the same > configuration in the past though. Indeed Plone is written in python, and python has a "Big Giant Lock" inside which insures that only one thread can execute, in order to protect the python structures. This lock is only released under special circumstances, such as doing IO. Hence it is necessary to run several instances of python programs and do synchronization work, if one wants to make use of several CPUs, or use python threads, and immediately make some IOs, or similar techniques. It may be that using Jython, if possible, yields better threading behavior. When doing some work according to these ideas, i had found quite severe contention, and this was not cured when switching native threading libraries (libksd, libthr, etc.). The problem is really inside python. -- Michel TALON