0

I'm running an apache server on a Raspberry Pi with a predictor that uses R.

The problem is that R has to load some tables from RData files (and some libraries) and it takes a long time (+/- 6 seconds).

Is there a way to keep this data loaded so only the method make_prediction(args) has to run?

Thanks!

6
  • RData is already pretty efficient serialization. It will be hard to beat that. The optional R image save is using the same format. Feb 19, 2019 at 13:42
  • That you for your answer. So there is no way to keep the RData loaded on the apache server / raspberry pi?
    – nblitz
    Feb 19, 2019 at 16:27
  • I am not sure what you mean. It is a file. You can save it whereever you want. Upon startup, the process loads it. If the file is large, and the disk is slow, then that takes a moment. There really is not anything more to it. Feb 19, 2019 at 16:28
  • Aha, maybe my problem description is not clear enough. I will try to make it clearer. I mean that the php script calls a batch command "Rscript my-r-script.r args" which returns a value. That R script first has to load in some RData. I would like that data to be already loaded when the server calls the R script.
    – nblitz
    Feb 19, 2019 at 16:31
  • Come on now. This is the first time you mention PHP in the context. Obviously you want the data in the server so recast your deployment so that R is loaded in the webserver / becomes the webserver. Feb 19, 2019 at 16:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.