TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Handling 350k Requests for $3 using Lambda

145 pointsby karakanbabout 5 years ago

18 comments

mertyabout 5 years ago
This isn’t actually one of those solutions where Lambda shines, pricing wise.<p>I would simply trigger a Lambda function once a minute (or every X minutes) using CloudWatch to fetch the latest articles and save them to an S3 bucket which I would expose and cache using CloudFront or any other CDN service.<p>This would lead to:<p>- No Lambda costs as it would be covered by the monthly free tier of 1M requests.<p>- No storage costs as the size of the stored data would be extremely small.<p>- Really fast responses as the “response” would actually be a static file cached at the CDN.<p>- The only parameter defining your cost would be your CDN of choice, which would cost somewhere between free and as low as $10&#x2F;TB. For a project like the one in the article, that’s hundreds of millions of requests for just $10.
评论 #22448391 未加载
评论 #22447374 未加载
评论 #22447843 未加载
评论 #22448732 未加载
vander_elstabout 5 years ago
It&#x27;s like 0.13qps on average. Assuming a constant load and no spikes, a raspberry pi should also be able to handle this load, it would be nice to compare the performance
评论 #22446916 未加载
评论 #22446634 未加载
SahAssarabout 5 years ago
Seems like a better argument for not using FaaS after reading it all.<p>It&#x27;s also filled with &quot;once you&#x27;ve done X Y is simple!&quot; like:<p>&gt; Once you have the template ready, you can simply deploy your code by running: serverless deploy<p>which is true for all automatable tasks. The same can be said for any VM or shared hosting.
评论 #22445974 未加载
评论 #22447448 未加载
fabioyyabout 5 years ago
3$ for 350k request is VERY expensive
评论 #22445753 未加载
评论 #22445353 未加载
评论 #22445431 未加载
评论 #22445479 未加载
评论 #22445937 未加载
评论 #22445393 未加载
评论 #22445372 未加载
_v7guabout 5 years ago
Based on my experience here, figuring out how to run your service very cheaply is quite simple:<p>1. Set up a somewhat convoluted, definitely not efficient, but kind-of cheap setup<p>2. Write a blog post bragging about it<p>3. Submit on HN<p>4. Take notes as HN users inevitably tell you how to run your setup for much cheaper, while even providing double-checked rate estimates (you wouldn&#x27;t want someone commenting that your estimates were wrong, would you?)
评论 #22451613 未加载
whalesaladabout 5 years ago
(This comment is unrelated to the use of lambda, and more of a note to the author)<p>The author comments that they prefer the light mode to their own dark mode. I think that the dark mode would benefit greatly from being designed (color wise) bottom-up as a dark mode, versus just trying to toggle certain things to be darker.<p>The big tell is that the lines separating each row of content appear to be the same color in both areas. This tells me that the color of the line is not determined based on the color behind it (either via transparency, via color manipulation manually, or via dynamic color manipulation from a tool like sass (ie, opacity(), darken(), etc...)<p>I do agree w&#x2F; the author that light mode looks better. I also tend to prefer dark mode UIs. I think that by mindfully revisiting color a lot of the visual noise will go away and result in a more pleasant experience.<p>tl;dr dark mode is not just inverting certain light colors to dark, it should be done with more care.
shooabout 5 years ago
I have a silent low-power ex-thin-client box sitting in my living room that is used to perform batch jobs. It&#x27;s been running for about 2.5 years, cost about $26 to buy the hardware second hand, and maybe costs around $20 &#x2F; yr in electricity. Internet is $0 as I&#x27;d pay for that anyway and it doesn&#x27;t need much bandwidth. It executes about 85,000 batch jobs every fortnight, so call that about 5.5 million jobs total. So that&#x27;s about 72k jobs to the dollar. Handwaving 1 request as being comparable work to 1 batch job, the lambda setup described here is doing about 117k requests to the dollar. I&#x27;m massively over-spending!<p>The box is currently using about 10% cpu (postgres processes) and has 2 gb of memory available. I guess I over-provisioned and should go looking for some customers to onboard onto my &quot;cloud&quot; to get better utilisation and help amortise my operating costs.
chasersabout 5 years ago
Cloudflare is $0.50 per million.
评论 #22447774 未加载
sonikudiabout 5 years ago
IMHO this is poorly researched article. Couple of things mentioned as disadvantages of serverless are already solved in the market. 1. You can use serverless framework or other framework available in market instead of doing everything in GUI 2. Its easy in most cases to invoke locally by using serverless invoke local --function functionName.You don’t have to redeploy. 3. For monitoring you can create different Dashboards on AWS. Also a great solution is integration to Datadog or you can create alerts for specific number of errors or number of invocations and forward it to specific email address.
blacklionabout 5 years ago
I dream, that, maybe, sites which have something like &quot;news feed&quot; could export content not only in human-readable HTML&#x2F;CSS&#x2F;JS but, maybe, some machine-readable format too?<p>And such plugins, software products and extensions, as Devo will consume this unambiguous and common format, and will not need custom APIs, APIs keys, backends, HTML scraping &amp; parsing and all custom work for each site they support, but one common way for all sites?<p>Is it possible on our technological level, or it is wild dream?<p>OH, WAIT! RSS!
jayd16about 5 years ago
If the author is already making an extension, could they have the extension set the security policy for these sites and simply display them in iframes? No cost at all.
评论 #22445809 未加载
评论 #22447713 未加载
kladskull666about 5 years ago
I could tell you how I have handled millions of requests on a free AWS tier ubuntu system, but its not interesting enough. Just like this...
moltarabout 5 years ago
That’s just 8 requests per minute. Can do that easily on a $2.50 vultr VPS. Beat that :D
评论 #22449991 未加载
jessmayabout 5 years ago
Can the extension not make the http requests to get this info? Am I missing the need for a backend for this type of work?
评论 #22445736 未加载
评论 #22445734 未加载
7532yahoogmailabout 5 years ago
Title needs a rate ... 350k requests&#x2F;month.<p>Ok: the rest of the article was great. Thanks
treyhuffineabout 5 years ago
Friend link (no paywall): <a href="https:&#x2F;&#x2F;levelup.gitconnected.com&#x2F;handling-350k-requests-for-3-using-lambda-c258ace3da58?source=friends_link&amp;sk=2e3ce7eeb3e83ccad61b9dc2547aec1e" rel="nofollow">https:&#x2F;&#x2F;levelup.gitconnected.com&#x2F;handling-350k-requests-for-...</a>
评论 #22445325 未加载
danolsabout 5 years ago
Is there anyone but me who uses the premium article on medium.com as a filter for what is NOT worth my time?<p>I believe in the tech space the majority of readers who write in depth worth to read articles are not incentivised by a few dollars kickback from their hard work from medium.com. They often write it for personal profile enhancement or company blog marketing reasons and want to reach maximum audience and will keep it free for all.<p>The problem nowadays though is that medium.com is often able to trick them by making the article premium through deceptive ui even when that is not their intention. Just look at the googlecloud medium blog and you constantly see premium articles there which seems bizarre.
评论 #22446266 未加载
评论 #22447030 未加载
评论 #22448895 未加载
评论 #22446013 未加载
marknadalabout 5 years ago
Huh, 350K for $3 is good?<p>I&#x27;m handling Millions for $0 :&#x2F; with my <a href="https:&#x2F;&#x2F;github.com&#x2F;amark&#x2F;gun" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;amark&#x2F;gun</a> .
评论 #22449454 未加载