简体   繁体   中英

Uniquely identify instances of VMs (Azure ML - web services)

I'm posting this more as a 'probe' question and plan to expand the discussion in case some interest shows up. The reason behind this is that in my experience, the SO community on azure-ml (and related) is still developing and there is not much feedback - but I would be happy to help it grow stronger.

My situation is as follows: I have an experiment in Azure ML which does all its work inside an R module. I published this as a web service and set the 'max concurrent calls' slider to 10 - which I believe guarantees me that there will be at most 10 instances of my web service up and running at any time, to serve requests (please correct me if i am wrong).

Now, I am trying to do some performance testing by firing 10 parallel calls to my webservice, but get unexpected results...

I am trying to run the load tests and log where each of them actually goes to (which instance). My idea is to get a glimpse into how these calls are actually distributed to the instances by the load balancer, under certain max number of concurrent calls = X. I am doing this by firing a call to "bot.whatismyipaddress.com" from inside the R script. Here is the important snip of the code:

library(rjson)
machine.ip <- readLines("http://bot.whatismyipaddress.com/", warn=F)
result$MachineIP <- machine.ip

Additionally, I am using the sample R code from the web service RRS help page to fire up to 70 (sequential) calls to my web service. This sample code returns some info back to the console : the results of my web service as well as some info on to which hostname the call goes through. Here is a sample :

* Hostname was NOT found in DNS cache
*   Trying 40.114.242.9...
* Connected to europewest.services.azureml.net (40.114.242.9) port 443 (#0)

The difficulty that I am facing is that I cannot uniquely identify the different instances of my web service. The info out to console from the call (the second snippet) often shows a different IP address than the one from inside- R -code logs ( result$MachineIP )...

Can someone point out what am i doing wrong, and how could i uniquely identify the different instances that are serving the calls? Any help would be really appreciated. Thanks!

PS I've tried this as well, but the first apporach does not work when calling it from inside the R script and I'm using a modified version of the second apporach (the one suggested there does not work). Here are also my questions on the Azure forum, in case someone is interested.

If anyone could help or point me to some source of info I would be really grateful!

This question was resolved thanks to some people on the Azure ML forum so I'm going to post an answer for anyone landing here in search for some answers...

The short answer is no, this is not possible. The more detailed version is:
"From within the R script you cannot identify the internal AzureML IP addresses or the unique web service instances. When you make an external network call from the R script to an outside URL, that URL will see one of the AzureML public virtual IP's as the source IP. These are IP's of the load balancers, and not of the machines that are physically running the web service. AzureML dynamically allocates the instances of R engine in the backend, handles failures, and uses multiple nodes for running the web service for high availability. The exact layout of these for a given web service is not programmatically discoverable."
Here is also the link to the original discussion.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM