How long should it take to save a file to Backendless?

I’m just wondering how long I should expect it to take to save an 8.4 MB json file using the iOS API. Right now, it’s taking about two minutes from the time when fileService is called to when the persistenceService save function finishes and the file appears in Backendless dashboard. Is this normal?

Thanks

The process saving a file is instantaneous. The majority of the time is spent on file upload from your device to the server.

Yeah, I guess I’m wondering about the “upload time” then. Is two minutes a normally observed length of time for a file this size or can/should it be faster?

I think there is a linear correlation to the throughput/speed of your connection. Are you on wi-fi or perhaps it goes through the cellular network? Any proxy configuration on the phone?

I’m using an iPad connected to wifi with 9.43Mbps download and 7.94 Mbps upload speeds. No proxies configs involved.

Try uploading with Backendless console. Just drag and drop a file of similar size into a folder in console (on the Files screen) and see how long it takes.

Well, if those are supposed to be equivalent then I definitely have something slowly down my file upload on the app side. I just uploaded a 25 MB video in about 5 seconds.

Here is my code for saving the file. Do you notice anything that could be slowing it down?

It messed up the formatting. I’ll upload it as a file.

code_sample.txt (1.43kB)

What if you put a proxy between your phone and our server and see where the time is spent? Whether it is the upload or something else? For instance, I usually use Charles Proxy whenever I need to debug any kind of client/server issue.

Alright, thanks. I’ll look into that. I’m also dealing with the app crashing sometimes if I use the app too much in the 2 minute upload window.

I used the built in Xcode network monitor and observed that the network traffic is definitely being sluggish. I’m thinking that there must be some sort of conflict or inefficiency between the Backendless file upload and other network traffic occurring simultaneously on the device. I’m going to dig into it a bit more and will post any findings I come across.

Hi Brandon,

Please try ‘saveFile’ method of FileService class instead ‘upload’:

-(void)saveFile:(NSString *)path fileName:(NSString *)fileName content:(NSData *)content response:(void(^)(BackendlessFile *))responseBlock error:(void(^)(Fault *))errorBlock;

Can you compare how they go?

Regards,
Slava

So, using saveFile did speed it up a bit. Why do you think that is? Are there any downsides I should consider when sending the data as a byte array?