The nova.scheduler.caching_scheduler Module

class CachingScheduler(*args, **kwargs)

Bases: nova.scheduler.filter_scheduler.FilterScheduler

Scheduler to test aggressive caching of the host list.

Please note, this is a very opinionated scheduler. Be sure to review the caveats listed here before selecting this scheduler.

The aim of this scheduler is to reduce server build times when you have large bursts of server builds, by reducing the time it takes, from the users point of view, to service each schedule request.

There are two main parts to scheduling a users request: * getting the current state of the system * using filters and weights to pick the best host

This scheduler tries its best to cache in memory the current state of the system, so we don’t need to make the expensive call to get the current state of the system while processing a user’s request, we can do that query in a periodic task before the user even issues their request.

To reduce races, cached info of the chosen host is updated using the existing host state call: consume_from_instance

Please note, the way this works, each scheduler worker has its own copy of the cache. So if you run multiple schedulers, you will get more retries, because the data stored on any additional scheduler will be more out of date, than if it was fetched from the database.

In a similar way, if you have a high number of server deletes, the extra capacity from those deletes will not show up until the cache is refreshed.

run_periodic_tasks(context)

Called from a periodic tasks in the manager.

Previous topic

The nova.safe_utils Module

Next topic

The nova.scheduler.chance Module

Project Source

This Page