code imports should run fewer jobs at once

Bug #497645 reported by Michael Hudson-Doyle
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Michael Hudson-Doyle

Bug Description

It seems that imports using bzr-svn and bzr-git are very much more cpu bound than the cscvs imports were, and so it doesn't make sense to run more jobs on a machine than the machine has CPUs as this just leads to thrashing death.

Maybe we could even put a "number of CPUs" column on the CodeImportMachine table?

Related branches

tags: added: code-import
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I talked about this with Aaron a little, and we decided that passing the number of CPUs on the slave to the getJobForMachine XML-RPC call would be less work. "os.sysconf('SC_NPROCESSORS_ONLN')" is a way to find the number of CPUs.

Revision history for this message
James Troup (elmo) wrote : Re: [Bug 497645] Re: code imports should run fewer jobs at once

Michael Hudson <email address hidden> writes:

> I talked about this with Aaron a little, and we decided that passing
> the number of CPUs on the slave to the getJobForMachine XML-RPC call
> would be less work. "os.sysconf('SC_NPROCESSORS_ONLN')" is a way to
> find the number of CPUs.

This will misrepresent the capacity of SMT boxes (as our current
generation of servers are) and for something like code import that's
probably bad (it's not the kind of work load which will benefit from
scaling with number of threads rather than cores).

That said, I'm afraid I don't know a particular clean way to detect
active SMT other than to check for duplicate core id's in /proc/cpuinfo.
(And bear in mind that older CPUs won't have a core ID in /proc/cpuinfo)

--
James

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

James Troup wrote:
> Michael Hudson <email address hidden> writes:
>
>> I talked about this with Aaron a little, and we decided that passing
>> the number of CPUs on the slave to the getJobForMachine XML-RPC call
>> would be less work. "os.sysconf('SC_NPROCESSORS_ONLN')" is a way to
>> find the number of CPUs.
>
> This will misrepresent the capacity of SMT boxes (as our current
> generation of servers are)

Bugger. I thought I checked this, but obviously got it wrong somehow.

> and for something like code import that's
> probably bad (it's not the kind of work load which will benefit from
> scaling with number of threads rather than cores).

Yeah/

> That said, I'm afraid I don't know a particular clean way to detect
> active SMT other than to check for duplicate core id's in /proc/cpuinfo.
> (And bear in mind that older CPUs won't have a core ID in /proc/cpuinfo)

That sounds fairly horrible. Maybe CodeImportMachine.cpu_count is
easier then.

Cheers,
mwh

Revision history for this message
Tim Penhey (thumper) wrote :

Will this still be an issue if we have incremental imports?

Changed in launchpad-code:
status: New → Incomplete
Revision history for this message
Aaron Bentley (abentley) wrote :

I can't think of a reason why incremental imports would change this. The issue is that these imports are CPU-intensive. It doesn't matter whether they run for a short or long time-- you don't want to run multiple imports in parallel on a single core.

Changed in launchpad-code:
status: Incomplete → Confirmed
status: Confirmed → Triaged
importance: Undecided → High
Changed in launchpad-code:
assignee: nobody → Michael Hudson (mwhudson)
milestone: none → 10.02
status: Triaged → In Progress
Changed in launchpad-code:
status: In Progress → Fix Committed
Changed in launchpad-code:
status: Fix Committed → In Progress
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.