Closed antenore closed 1 year ago
Actually, I am not sure if the current AWS Lambda can provide waifu2x.udp.jp and reduce costs.
The current server uses GPC Preemptible VM instance (n1-standard-4, 3CPU, 1x NVIDIA Tesla T4, about $500/month, instance cost $100 + data transfer cost $400).
EDIT:
100,000 requests
This is the number of requests for recapcha, so actual API requests may be less.
Wow! That's a lot!!! I'll check later, but probably you are right
I think you should give it a try.
I've chosen ARM as it's what AWS advises for High computing Lambda functions (AI, and so forth).
Lambda functions are mainly billed per RAM used and storage, in this calculation I've chosen 1 GB of RAM, for CPUs it scales as much as needed, and ephemeral storage 10 GB.
S3 may be or not needed, it depends on how long you want to keep the images. In my example, I've clearly exaggerated to just have a pessimistic prevision.
Some details…
Lambda: Architecture (Arm), Architecture (Arm), Number of requests (100000 per month), Amount of ephemeral storage allocated (10 GB)
S3: S3 Standard storage (2 TB per month) DT Inbound: Internet (2 tb_month), DT Outbound: US East (N. Virginia) (2 tb_month)
Regarding the storage, it's probably overestimated.
100000 per month
This is daily, not monthly. I counted the log of "POST /api" in nginx log for " 26/Jul/2022". It was 72477. about 2200000 per month.
100000 per month
This is daily, not monthly. I counted the log of "POST /api" in nginx log for " 26/Jul/2022". It was 72477. about 2200000 per month.
Sorry I misread it. In that case it would be much more expensive! :-( Just for the Lambda function it'd cost around 3,645.09 USD per Month.
Closing as answered.
For small or personal servers, I think the cost can be less. My concern is that the CPU processing is probably very slow for super-resolution processing.
First, thanks so much for this project! Thanks to you, I'm saving some money, and I'll for sure devolve part of it to your Patreon project.
I was wondering how is set up the infrastructure behind http://waifu2x.udp.jp/index.html
As far as I understand, you're planning to move to Google virtual machines, wouldn't AWS Lambda Functions something much less expensive than a Virtual machine?
The huge advantage is that you would pay only when a user submits an image to be converted, therefore you would have to pay for the temporary storage, the extremely low fee of AWS Lambda, and that's all. And with that free tier plan, you would even not pay at all in the beginning or till when you would get a huge amount of traffic/requests.
I'm not an advocate of Amazon, but it's the only cloud service that I know quite well at the moment, so what I say may apply as well to other cloud provider. My argument is only Functions vs VMs.
https://aws.amazon.com/blogs/machine-learning/using-container-images-to-run-pytorch-models-in-aws-lambda/