Fly.io <> R2

download speed from R2 to fly.io is sad 🤔
31 Replies
Sid
Sid3y ago
Are the bucket and the Fly app in different regions? (Possibly in extremes like Singapore vs Eastern US?)
chientrm
chientrmOP3y ago
they're same singapore region I send request to fly.io, fly.io download a file from R2 (500MB), fly.io throw timeout error (60 secs) before being able to process the file and return processing progress. upload from an EC2 instance is fine ~80MB/s
Sid
Sid3y ago
Interesting, this is only on Fly? I'm assuming EC2 was also in Singapore, and you are too, is the download speed better when you download the file from R2 on your machine?
chientrm
chientrmOP3y ago
ec2 in singapore, too. download speed to my laptop is slow because of slow wifi. I can test download from R2 to EC2
chientrm
chientrmOP3y ago
Download from R2 to EC2 instance.
Sid
Sid3y ago
Let me try and repro this
chientrm
chientrmOP3y ago
Thank you so much, that will help us cutdown paid on fly.io because it's per second billing 👍
Sid
Sid3y ago
Hm so I set up a simple Docker app that just launches rclone and downloads a file from an APAC R2 bucket on Fly, and I don't see speeds that low 🤔
Sid
Sid3y ago
My Dockerfile is just
FROM rclone/rclone:latest
ENV RCLONE_CONFIG=/etc/rclone/rclone.conf

COPY rclone.conf /etc/rclone/rclone.conf
VOLUME /downloads

CMD ["copy", "-P", "r2-staging:r2-apac/file.dmg", "/downloads"]
FROM rclone/rclone:latest
ENV RCLONE_CONFIG=/etc/rclone/rclone.conf

COPY rclone.conf /etc/rclone/rclone.conf
VOLUME /downloads

CMD ["copy", "-P", "r2-staging:r2-apac/file.dmg", "/downloads"]
How are you making sure that your bucket is in the right region? Did you issue a GetBucketLocation?
Sid
Sid3y ago
Interestingly though, Fly's Grafana says otherwise
Sid
Sid3y ago
I don't know if the Network I/O is only taking "data out" into account though I presume it is, you might want to look into this. Maybe the speed you're seeing isn't accurate? Hm or maybe my graph is flawed because the download is happening during the app's "build" phase Either way, I'd double-check your bucket's location first
chientrm
chientrmOP3y ago
My example file was ~550MB, with average 10MB/s, I assume it made up over 60 seconds so that fly.io throw time out error. I see that Fly's Grafana is not accurate 🤔 I can't find the info on dash, I remember I created it with Singapore region 🙂
Sid
Sid3y ago
Ah yeah regions don't show up on the dash yet, but if you have an S3 SDK set up, you should be able to issue a GetBucketLocation command to check where the bucket actually is
chientrm
chientrmOP3y ago
chientrm
chientrmOP3y ago
Currently, I made my fly app to periodically res.write downloading progress to avoid fly.io timeout error.
Sid
Sid3y ago
I've only used Fly occasionally, but is the 60s timeout on the TCP response?
chientrm
chientrmOP3y ago
sounds like TCP.
chientrm
chientrmOP3y ago
Sid
Sid3y ago
I see Let me try and deploy my app in a different region to see if the low speeds are a Fly thing or an APAC thing
chientrm
chientrmOP3y ago
is 10MB/s downloading considered good speed?
Sid
Sid3y ago
No that's really low On my local machine I can get up to 75-80 from a bucket in Frankfurt (which is near where I am)
chientrm
chientrmOP3y ago
when I download from R2 to EC2, it's 10MB/s too I can do a second test
chientrm
chientrmOP3y ago
2nd test is same
Sid
Sid3y ago
Okay this is more like it (EWR = US East)
Sid
Sid3y ago
So this looks like an APAC problem, probably nothing to do with Fly
chientrm
chientrmOP3y ago
it's 8PM at my location and it's rush hour now. I can redo the test later at the morning and at lunch.
Sid
Sid3y ago
Yeah that would be interesting to see as well, but I'll check this out internally as well
chientrm
chientrmOP3y ago
redo test at 8:30AM
chientrm
chientrmOP3y ago
Redo test at lunch time 0:00PM
Sid
Sid3y ago
Hm, still pretty abysmal

Did you find this page helpful?