FAQ
I want to do some resource analysis of instances before CF routing the
requests to app instances randomly. Thus, some kind of LB may be achieved
here.

But I found that in ../router/router_uls_server.rb, the Router "look up"
the instances according to requested URL, which, has been binded with
serveral servers by host and port.

# Lookup a droplet
unless droplets = Router.lookup_droplet(url)
Router.log.debug "No droplet registered for #{url}"
raise Sinatra::NotFound
end



That means I can not get the stats of instances of specific app easily in
Router, because the coming URL can provide neither app name nor owner of
this app.
So, unlike in the CloudController, I can not send a message to NATS with
the id of app droplet like below:

message = { :droplet => app.id, :version => app.generate_version,
:states => ['RUNNING'], :include_stats => true }
opt = { :timeout => 2, :expected => app.instances }

So, is there any way to achieve that? I mean get stats of corresponding
instance by URL (or via the instance's host and port)?

As far as I know, this kind of info can only request via NATS, right?

Search Discussions

  • 磊张 at Aug 1, 2012 at 10:57 am
    Never mind. VCAP Component varz has enough information to use. The monitor
    function in DEA is enough.

    在 2012年7月27日星期五UTC+8下午8时38分21秒,磊张写道:
    I want to do some resource analysis of instances before CF routing the
    requests to app instances randomly. Thus, some kind of LB may be achieved
    here.

    But I found that in ../router/router_uls_server.rb, the Router "look up"
    the instances according to requested URL, which, has been binded with
    serveral servers by host and port.

    # Lookup a droplet
    unless droplets = Router.lookup_droplet(url)
    Router.log.debug "No droplet registered for #{url}"
    raise Sinatra::NotFound
    end



    That means I can not get the stats of instances of specific app easily in
    Router, because the coming URL can provide neither app name nor owner of
    this app.
    So, unlike in the CloudController, I can not send a message to NATS with
    the id of app droplet like below:

    message = { :droplet => app.id, :version => app.generate_version,
    :states => ['RUNNING'], :include_stats => true }
    opt = { :timeout => 2, :expected => app.instances }

    So, is there any way to achieve that? I mean get stats of corresponding
    instance by URL (or via the instance's host and port)?

    As far as I know, this kind of info can only request via NATS, right?

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupvcap-dev @
postedJul 27, '12 at 12:38p
activeAug 1, '12 at 10:57a
posts2
users1

1 user in discussion

磊张: 2 posts

People

Translate

site design / logo © 2022 Grokbase