3 ms·
curious to know your setup
by brilliantcode 10y ago
curious to know your setup
- jamiesonbecker 10y agoFrom a load perspective, if the request pattern is even, 225 million req/month are only about 85 req/s (assuming ~730hrs/mo). Any $5/mo VPS running even a very heavy and suboptimal web framework can handle that. It's likely more spikey than that (i.e., peak/off-peak times), but certain server-to-server loads have a very consistent load pattern. (For example, at Userify[1] - SSH key management -- servers check for updates every 90 seconds or so or 10 seconds for premium plans or self hosted, so the load pattern is literally a flat line.. extremely predictable. We'll probably switch over clients that can handle it to websockets and maybe hashed etags and cut that load pattern into oblivion, but for now it works and is simple/auditable code/extremely reliable, which is a very important factor in our case.) To GP's point, spiraling costs are definitely a factor with most of Amazon's services such as DynamoDB and especially Lambda... they are sometimes an effective use of devtime, especially in the beginning of a project (and when dealing with a mature platform like DynamoDB and maybe not so much Lambda), but you have to carefully consider the cost factor as you scale. For example, Lambda is often literally several orders of magnitude[2] more expensive than an equivalent ELB. (i.e., it can be more than 100x more expensive.. for small scale or maintenance tasks, that may not matter.. for a heavy/core service, it definitely matters!) So, as they taught us in AWS SA, design for cost: use the more advanced services when it makes sense, but optimize across all axes, not just devtime. TL;DR: most cheap cloud instances can do 85req/s. 1. https://userify.com https://userify.com 2. https://twitter.com/JamiesonBecker/status/802185522139582464 https://twitter.com/JamiesonBecker/status/802185522139582464
- brilliantcode 10y agohmm interesting. I guess I haven't really thought of this from cost point of view. It is nice knowing that I can have a Flask endpoint up on AWS Lambda + API Gateway that can scale using only my credit card. That peace of mind, once you write a code you won't have to worry about scaling seems like a pretty good deal and should carry a premium. I'd be happy to have 85req/s hopefully by then I'd be charging lot of money.
- jamiesonbecker 10y agoExactly - and don't forget about things like Elastic Beanstalk as you grow. Those automate even the setup of things like the ELB/ALB etc, trading a higher fixed monthly cost for a lower cost per transaction. Still, if your business model supports it and if it ain't broke, just leave it where it is... AWS does give you many good choices.
- brilliantcode 10y agoI just begun to look at ELB and curious to know how it's able to scale my php app straight out of the box. Having said that it's a struggle to figure out how to get Laravel running on ELB
- stanmancan 10y agoHandling the spikes is the tricky part. People apparently like to run cron jobs on the hour so a few times a day I need to handle up to around 1200 req/s
- brilliantcode 10y agohow did you handle the spike?
- stanmancan 10y agoJust made sure it was fast enough to handle it. I have benchmarked it and it should be able to do close to 2250 req/sec. After that I'll have to drop a load balancer in front I guess.
- stanmancan 10y agoHandling the spikes is the tricky part. People apparently like to run from jobs on the hour so a few times a day I need to handle up to around 1200 req/s
- stanmancan 10y agoIt used to run in PHP/redis but when the load got too high I rewrote the server in GO. No database needed as the server downloads and loads the files in memory.