[openstack-dev] [nova] Performance concerns over all the new notifications

Jay Pipes jaypipes at gmail.com
Thu Oct 20 09:18:31 UTC 2016


On 10/20/2016 05:08 AM, Joshua Harlow wrote:
> Matt Riedemann wrote:
>> There are a lot of specs up for review in ocata related to adding new
>> versioned notifications for operations that we didn't have notifications
>> on before, like CRUD operations on resources like flavors and server
>> groups.
>>
>> We've got a lot of legacy notifications for server actions, like
>> server.pause.start and server.pause.end. Those are pretty simple.
>>
>> The thing that has me concerned about the CRUD operation notifications
>> on resources is the extra DB query overhead to create the payloads which
>> might not even get sent out.
>>
>> For example, I was reviewing this spec about adding notifications for
>> CRUD ops on server groups:
>>
>> https://review.openstack.org/#/c/375316/
>>
>> Looking at the code for InstanceGroup, when a member is added to or
>> removed from the group, the hosts field implicitly changes, but to
>> calculate the hosts field we have to get all of the instances (members)
>> in the group and then built the list of instance.host values.
>>
>> This is probably less of an issue if the server group object in scope
>> already has the hosts field set, but if it doesn't and we're
>> constructing it just for the notification, that's extra DB and RPC
>> overhead - and notifications might not even be setup.
>>
>> I was thinking about it like logging details at debug level. If I need
>> to build some large object or get some data for debugging something
>> that's not in scope, I'd wrap that in a conditional:
>>
>> if LOG.isEnabledFor(logging.DEBUG):
>> LOG.debug('gimme da deets: %s', self.build_da_deets())
>>
>> But do we have anything like that for notifications? Basically, tell me
>> if I should even bother building payloads for notifications.
>>
>
> Also at what point is the notification system actually the equivalent of
> the database transaction log (just something to ask/think about).

At no point, really. :) One is a serialized write-ahead log of commits. 
The other is an asynchronous, fire-and-forget, pub-sub system.

> If every CRUD operation is doing notifications, it sorta feels like
> it is nearly just the same...

No, not really. You wouldn't compare the initial creation of a Tweet 
with the notifications (email, mobile app, AJAX callback, etc) about 
that Tweet that get sent out to all subscribers. Same thing here.

Best,
-jay



More information about the OpenStack-dev mailing list