Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Had to write image server myself and it wasn't really hard.

Nginx to handle existing files. Python + Pillow + cherrypy (or could be any other microframework) to handle image processing on the fly and then caching processed image to the disk.

All in all around 350 lines of code in python. And something like 100 lines in nginx (because of a heavy filename processing and inner url rewriting).

Result - facebook-like image processing:

Simple resize: http://media.example.com/w400x200/id_token_string.jpg Crop (based on coords): http://media.example.com/20.20.380.300/id_token_string.jpg Or crop resize from center: http://media.example.com/c200x200/id_token_string.jpg

and so on...

Fun project.



It's about total cost of ownership

A: Imgix = cost of imgix subscription + integration time * hourly rate (it's dead simple)

B: Rolling your own = dev time * hourly rate + maintenance/ops time * hourly rate

For most orgs B > A. For most individual programmers since hourly rate is not a factor A < B.


That's certainly true. I'm not saying that this service doesn't have any value. Just wanted to share my experience with writing similar solution.

It's good to be dev and have spare time for stuff like that. You learn stuff while making such projects, you save money and it just works.

About money, judging by the pricing on imgix page (and if I understand pricing correctly, I'm saving around $300 per month ($50 for cheapest plan + $250 for traffic).


If you have to pay for hardware to run it on, that would be part of B.


What was the max throughput your server could handle? We ended up using Go because we serve 400 - 600 reqs/sec and Python/Ruby solutions didn't have high throughput.


I've never tested its throughput - there was no reason to do that because all of the processed images are saved and stored as long as those files are accessed at least once a week.

So, the answer is pretty much this: it'll handle as many rps as nginx serving static files can handle.

If we are talking about unique requests each requesting to process unique image - I'm pretty sure linode server CPU it's running on will choke.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: