cheat.sh icon indicating copy to clipboard operation
cheat.sh copied to clipboard

Long request times

Open andrewgodman opened this issue 5 years ago • 8 comments

It looks like responses can take a long time as theres no CDN etc for the service? Responses from Australia can take from 1100-2700ms plus.

I wouldn't even mind hosting the docker image on my own domain if this isn't something me/the community could help out with.

andrewgodman avatar Aug 21 '19 11:08 andrewgodman

@andrewgodman The question is, do you have such response times for cached answers too? Say, what happens if you do the same query twice:

$ curl cht.sh/ls
$ time curl cht.sh/ls

Because new questions, that can't be answered from the cache, take a couple of seconds anyway

chubin avatar Aug 21 '19 11:08 chubin

And to your question about your own server in Australia, it would be great if we could use it. We could make geo-based DNS resolution, so that DNS queries coming from Australia will get IP address of your server, when resolving cheat.sh and cht.sh

chubin avatar Aug 21 '19 11:08 chubin

2nd request: curl cht.sh/ls 0.01s user 0.01s system 0% cpu 3.867 total

My home internet isn't fast, I can try in the office tomorrow as it's on a pretty low latency fibre connection.

I'm happy to spin something up as long as the bandwidth costs aren't too high :)

andrewgodman avatar Aug 21 '19 11:08 andrewgodman

Yes, it is very slow. It can't be that slow:

That's how it looks like from Europe:

$ time curl cht.sh/ls
# Displays everything in the target directory
ls path/to/the/target/directory

# Displays everything including hidden files
ls -a

# Displays all files, along with the size (with unit suffixes) and timestamp
ls -lh 

# Display files, sorted by size
ls -S

# Display directories only
ls -d */

# Display directories only, include hidden
ls -d .*/ */

real	0m0.075s
user	0m0.010s
sys	0m0.005s

Additional problem that you probably have is that you don't use your own local DNS server, and even for DNS queries you have to use something external. This adds to your RTT.

Could you just ping cheat.sh and check what RTT you have?

chubin avatar Aug 21 '19 11:08 chubin

RTT is looking about 300-500ms. My DNS is set to my isp's dns. However they are known for their crappy routing.

andrewgodman avatar Aug 21 '19 11:08 andrewgodman

Running a time in the office was a bit better: curl cht.sh/ls 0.01s user 0.01s system 1% cpu 0.642 total.

RTT is stable at 311ms. Routing from Au to Europe is really bad at times as some ISPs have to route via USA due to limited supply to EU from here. I'd be keen to help out getting some local instances spun up if the costs aren't too high. Is it just a docker image?

andrewgodman avatar Aug 22 '19 08:08 andrewgodman

Just wondering if you had any thoughts on deploying the service overseas? I'm happy to spin up a container but I'm a bit unsure how you are deploying it as I note the container is mostly for local/dev

andrewgodman avatar Mar 02 '20 23:03 andrewgodman

@andrewgodman Yes it would be great.

  1. Could we make the service publicly available?
  2. Do you need a docker image?

chubin avatar Mar 03 '20 21:03 chubin