Add support for 'auto' number of API or conductor workers

Bug #1240197 reported by Russell Bryant on 2013-10-15
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Shantanu Tushar

Bug Description

Nova has some configuration options that allow you to have some services start multiple worker processes.



Swift has a similar "workers" option. In Swift, you can set this option to 'auto', and it will use the number of CPU cores. We should add support for 'auto' to all of the workers options in Nova.

Changed in nova:
status: New → Confirmed
importance: Undecided → Wishlist
tags: added: api conductor low-hanging-fruit
Shantanu Tushar (shaan7in) wrote :

I was looking for something to implement as my first patch and this sounds interesting. I did some poking around and found that nova uses Oslo.config which doesn't seem to support an `auto'-like feature. However, I do see this line[1] in nova/cmd/ -

    launcher.launch_service(server, workers=server.workers or 1)

which essentially starts worker processes. Does it make sense to detect the number of CPUs here and set that instead of 1?



Yes, You can borrow the snippet for CPU_COUNT from swift

And then you can do

launcher.launch_service(server, workers=server.workers or CPU_COUNT)

instead of

launcher.launch_service(server, workers=server.workers or 1)

Good Luck with your first review :)

-- dims

Shantanu Tushar (shaan7in) wrote :


That is exactly what I am planning to do, just wanted a confirmation that it makes sense. Thanks :)

Anton (agorenkov) wrote :

As there is no visible activity on the issue during the last month, I'll try to look at it too.

Changed in nova:
assignee: nobody → Anton (agorenkov)
Shantanu Tushar (shaan7in) wrote :

I have a patch at which has a failed test due to some issue with test infra.

Anton (agorenkov) wrote :

Ok, so you are planning to finalize the fix, right?

Shantanu Tushar (shaan7in) wrote :

Yes, I am working on the related bug

Anton (agorenkov) wrote :

Ok, so please assign the issues you are working on to yourself.

Changed in nova:
assignee: Anton (agorenkov) → nobody
Changed in nova:
assignee: nobody → Shantanu Tushar (shaan7in)
Mohammed Naser (mnaser) wrote :

This has been taken care of in this merged review

Changed in nova:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers