← Back to team overview

fuel-dev team mailing list archive

Nailgun agent handler improvements

 

Hello fuelers,

Currently in Nailgun we have two Node handlers, which can do the same
things:

- NodeCollectionHandler
- NodeAgentHandler

As far as I know, the last one was introduced to increase performance, since
updating information can take some time and on 1000+ nodes it may be a
bottle
neck. The only thing I dislike is that we have the same logic in two places
and it complicates the code maintenance.

So I want to suggest another solution, which keeps performance improvements
and gets rid of code duplication. The idea is that we can add some resource,
request on which will just make some simple thing like updating node's
online
status.

Technically it should be something like this:

    POST /api/nodes/42/ping/

where 42 is a node id


Pros:

- new handler will make just one query in pure SQL (UPDATE query)

Cons:

- discovery agents should decide which requests to do:

  * put updated data to node collection handler if data was changed since
last request
  * post ping request to update online status (data wasn't changed, afaik
most of cases)

I have made some tests and such ping handler works a bit quicker than agent
handler,
and obvious it's a simple.

So what do you think about it?

Thanks,
Igor

Follow ups