Trying to squeeze more into less

posted by Jeff | Friday, February 2, 2024, 2:48 PM | comments: 0

I found myself making some optimizations to the forum app this week. The short story is that I serve user photos and avatars out of the database, and optionally uploaded images in posts (though the better way is to serve it right out of some kind of storage, which is what I do on my sites). The way I've had it working forever is that it reads all of the bytes from the database, then sends them all to the user's browser. But for some time, there has been a mechanism to make this a stream, basically a pipe from the database to the browser, which is more efficient and doesn't take up potentially huge blocks of memory buffering big images. So I did some work to serve those images that way.

It does relieve some memory pressure, so it was a good idea regardless. But my intent was really to figure out how to squeeze all of that stuff running into a smaller "server" and save $24 a month. Yeah, that's where I am now with this stuff. The forums actually do this right now, which is awesome, but despite being on different URL's, they're all the same copy of the app running (technically there are two instances running for redundancy). To that end, its memory footprint is pretty small. They're running under 1 virtual CPU's and about 1.75 gigs of memory, easily.

Everything not the PB forums is running on a shared "server" with 2 CPU's and 3.5 gigs, also two instances at $24 each. I have the redundancy because that's just kind of the way stuff can and should work in the cloud. If one thing goes bad, another one picks up the slack, and there's no interruption. But I'm sure users have noticed interruptions because I've tried a couple of times to squeeze the shared stuff into the smaller service, and of course it chokes. This shouldn't really be a surprise, because all of CoasterBuzz (including its forum), the main PointBuzz site, their separate image sites,, my blog, the dev forum build, my music cloud and a bunch of random things that are just parked there, and CB and PB alone are gonna need a good chunk by themselves.

None of this really matters, but I still feel pretty strongly about delivering the best possible technical outcome, despite the shitty ad revenue. I mean, traffic was up 35% last year on CoasterBuzz, which is pretty fantastic. And ironically, some of that might be the Google juice you get when you have a fast site. But the same Google isn't paying dick for ads, and without covering the page in floating ads and video, there's no great way to improve that.


No comments yet.

Post your comment: