How to calculate the CPU and RAM usage needed to process images in a server?

If im going to build an image hosting website, I need to find out how much processing power I need. Let say a user uploads 500 photos in a bulk. How much resources (CPU and RAM) will it take to process these images? (For example, we need to take all those images, create separate versions with separate resolutions and upload them to amazon S3). I need to find this out to pick a good VPS for the site. Also please note that not only one, several users might upload at the same time.

At that level, as much as you can afford. Get more when you slow down. Bandwidth will also be a big concern. You will more than likely need several servers.

Run benchmarks periodically by creating test scripts to upload images and sending responses when done and monitoring the server load.

NewRelic is pretty amazing.

Step 1: get a server
Step 2: put some users on the server
Step 3: measure cpu and ram use
Step 4: calculate likely maximum load on server

For a brand new site with no users, chances are you’ll have more resources than you need on any vps or server. Only once your site becomes popular will you need to know the answer to the question. And only once it becomes popular will you be able to measure the cpu usage.

1 Like

yeah only way is to measure and test in real life

it’s cheap and easy to do with VPS providers that charge hourly rates such as Vultr, DigitalOcean, Linode etc.

just spin up a VPS for a few hours for testing to get the numbers :smile: