Plumber APIs timing - big discrepancies between R Studio Connect and local runs

April 26, 2019 @konradino Konrad Semsch

@konradino wrote:

Hello,

I have a plumber API that takes unexpectedly long to run and I have trouble understanding what the reason for that could be. Let me give you some context:

that API doesn't do any fancy calculations, locally runs in a couple of seconds for json files of 4-5 MB (including importing data). Our expectation was that it would run similarly fast when wrapped in a plumber API, but to our surprise it's quite the contrary.

R Studio Connect API - curl timing results:

time_namelookup:  0.004264
time_connect:         0.004503
time_appconnect:   0.000000
time_pretransfer:    0.004548
time_redirect:         0.000000
time_starttransfer:  0.005525

----------

time_total:  20.593546

Local API - timing of the most important code pieces

Starting server to listen on port 7992

Running the swagger UI at http://127.0.0.1:7992/__swagger__/

Working on it...

Time difference of 3.83 secs <- loading json

Raw file ready to rock...

887

Time difference of 0.81 secs <- data prep

Time difference of 0.10 secs <- variables calculation

Other than that there are no other operations that take time. As you can see the same code runs for over 20 seconds on RSC vs. nearly 5 seconds locally. How come there's such a huge difference between those timings between RSC and when running locally? Is there any way to speed that up?

Thank you!

Posts: 15

Participants: 3

Read full topic

Previous Article
Connect QuickStart issue with headless start within VM
Connect QuickStart issue with headless start within VM

@connorjo wrote: Hello, I am attempting to (headless) start Connect QuickStart f...

Next Article
How do I setup RStudio Connect on A Ubuntu Server with Apache Hosting A WordPress - both on https ?
How do I setup RStudio Connect on A Ubuntu Server with Apache Hosting A WordPress - both on https ?

@Terrance wrote: Hi, Need some advice if it is possible for an Ubuntu Server 16....