snarfed / huffduff-video

📺 Extract the audio from videos on YouTube, Vimeo, and other sites and send it to Huffduffer.
https://huffduff-video.snarfed.org/
95 stars 6 forks source link

port to AWS lambda or t2.nano #11

Closed snarfed closed 8 years ago

snarfed commented 8 years ago

lambda docs. it'd be pretty nice to not have to run the EC2 instance, and it would cut our cost down a bit once our free tier year is up.

it would only cut our cost down by ~1/3, though. our bill is currently ~$17/mo, 90% of which is bandwidth, and our t2.micro will only add ~$9/mo.)

also, i'm not sure if lambda is ready for us yet. notably, there's a 5m request deadline and 512MB disk quota. i think most requests finish in <5m, but i'm not sure. i don't have good metrics on request latency. :/ and our output files are pretty much all <512MB, but i'm not sure how much more space the intermediate files take up.

an alternative is the new t2.nano instance type.

just collecting data here for now.

snarfed commented 8 years ago

t2.nano is looking like a pretty good candidate. its key characteristic is that it has low CPU quota ("credits"), but it can burst up to a full core for up to 72m. that's perfect for huffduff-video; actually transcoding the videos is CPU hungry when someone asks us to, but request volume is low and sparse. e.g. here's CPU for the last week:

screen shot 2015-12-17 at 1 42 24 pm
snarfed commented 8 years ago

CPU credit balance for last two weeks. ranges between 75 and 150.

screen shot 2016-03-24 at 6 02 26 pm
snarfed commented 8 years ago

based on that graph of our CPU credit balance over the last 2w, we tend to hang out between 79 (early 3/21) and 144 (the cap). t2-nano's cap is 72, ie half, so we should fit into that ok. CPU credit handling details.

t2-micro is $9/mo, t2-nano $4.50, ie $54/yr, or $38/yr reserved. pricing details.

snarfed commented 8 years ago

incidentally, we did 245GB outbound data transfer in jan, 240GB in feb, and we're on track to do 290GB in march. free quota is 15GB/mo, so losing that won't add much new cost.

snarfed commented 8 years ago

done! just waiting for DNS to propagate. updated the readme with some details.