Issues with getSignedUrl AWS S3 function

I wanted to chime in again as I have switched from importing the “AWS SDK” package back to using the deprecated 3rd party service.

I conducted testing about a month ago to test the difference in speed for simply signing a URL with the AWS service. When importing the AWS SDK package, it would take anywhere from 3-15 seconds for the function to return. Nearly all of this time was spent on the module being loaded which I tested by removing all of the signing function.

Now having moved the same signing function to use the 3rd Party Service, the function consistently returns in hundreds of milliseconds or less.

If the import of AWS-SDK speed is not fixes, and the AWS 3rd Party Service is discontinued, I will have to move away from realm functions because the speed is too unreliable.

Hey @Tyler_Collins

I’ve been doing some work converting the functions to the aws-sdk and faced the same issues uploading a raw image via the function, in terms of 20+ seconds for a simple image. I think it’s likely to do with memory or something with the package being loaded in.

However… Is there any reason you don’t just use the getSignedUrl function from S3 to generate a presigned URL for a putObject command? That way the user uploads directly so S3 and upon the success you could call another function to save the key and bucket to mongo?

Take a look here - How to Generate Signed Amazon S3 URLs in Node.js

@henna.s @Drew_DiPalma - Moving functions over to the aws-sdk package was pretty painless aside from the issues that @Jason_Tulloch is running into, but I think the presigned URL will help there. I haven’t yet put the code into production as I’m currently traveling. However, I’m definitely less stressed about the move to npm packages now :slight_smile:

Thanks!

Hi @Adam_Holt apologies ahead of time I’m on mobile.

I was using getSignedUrl to get a url and upload the image directly from the browser. I was not sending the image itself to the realm function.

This action of just signing the url was still taking upwards of 20 seconds. However to narrow down the time drain I removed all code and only imported the Aws SDK module. Even with this the function times were 5-20 seconds.

@Tyler_Collins , @Adam_Holt ,

Thank you for raising the concerns. I have separated this issue from the image loading issue and let’s continue the discussion on getSignedUrl issue here.

The engineering team is aware of this and is working on performance improvements.

I will keep updates on this topic as soon as there is more information available.

Appreciate your patience with us.

Best,
Henna :performing_arts:

Just linking this post here, as I’m not seeing any issues with the getSignedUrl function. However, it might be because I’m using getSignedUrlPromise from the AWS S3 SDK. Example is in the post below.

Cheers