none
Persist Variables in memory in web/compute Node - Web services RRS feed

  • Question

  • Hi,

    I work with a big data.table and need to publish some web services to consume, based on such table. The problem is that I need to know how to loaded only once and in the successive requests retrieve the data from memory and not from the DB or xdf files. Is this possible?

    On the other hand, my code is divided in several R files, but ML Server doesn't allow this. All the functions and objects need to be in the same file. Is there a way to upload my files to the server as they are? Or the only way is via a one file service? Can I run the code as is?

    Thanks.

    Thursday, January 11, 2018 9:05 AM

All replies

  • You might try working with RData files they can be loaded into memory(dataframes) via the R 'load()' command - perhaps that will work for your purpose to answer the first part of your question.

    Friday, January 12, 2018 10:54 PM
  • http://bluemountaincapital.github.io/FSharpRProvider/reading-rdata.html
    Friday, January 12, 2018 10:55 PM
  • I've found that the solution seems to be the use of snapshots: https://docs.microsoft.com/en-us/machine-learning-server/r/how-to-execute-code-remotely#r-session-snapshots
    Thursday, January 18, 2018 11:04 AM