RLabkey API Performance

LabKey Support Forum
RLabkey API Performance marcia hon  2018-03-08 08:27
Status: Closed
 
Hello,

From our experience, RLabkey API Performance is very slow.

We have a query which uploading directly to Postgres takes 5 minutes... whereas via RLabkey API it takes days.

Please let us know what is wrong and how to fix this.

Thanks
Marcia
 
 
Jon (LabKey DevOps) responded:  2018-03-09 16:04
Hi Marcia,

Have you taken the time to review our robust Support Documentation?

https://www.labkey.org/Documentation/wiki-page.view?name=default

Many of your questions can be answered in our docs and we even have videos to help you understand how to both use LabKey and understand the functionality:

https://www.labkey.org/Documentation/wiki-page.view?name=videos

For future, please do your best to consult our fantastic docs first before posting to the Community Forums.


Regarding your performance problem, it is difficult to say what the issue could possibly be. It could be how you're inserting the information (e.g. doing individual LABKEY.insertRows vs using LABKEY.importRows option to do it in bulk:
 
https://cran.r-project.org/web/packages/Rlabkey/Rlabkey.pdf

Importing directly to a database is not the same as using the LabKey platform since unlike the database, we apply additional metadata to the data that is imported/inserted into any list, dataset, assay, etc.

It could also possibly be inadequate hardware that your LabKey instance is sitting on:

https://www.labkey.org/Documentation/wiki-page.view?name=beforeInstall

It could also be how you wrote your R code as well depending on how complex the information is.

However, if it is a straight import of data, potentially you should see that same sluggishness you described if you were to import the data directly into LabKey via the UI. If you can successfully import the data in a reasonable amount of time, then I doubt it's the platform that is the issue and most likely how the R code is written.

Regards,

Jon