Expected Performance #164
Replies: 1 comment 8 replies
-
Hi @derWebdesigner, A sudden huge drop in performance usually means you're starting to swap. If you're doing 10 resizes at once I can see it maybe passing your 1gb ram limit. I would benchmark ram use on your target hardware, then have something to limit the number of resizes you try to run at once to make sure you stay within your memory budget. You might need a separate resize worker process that picks up at most N jobs at once from a DB table. I tried on this PC (a threadripper pro with a fast NVME drive):
So 100 1450 x 2048 pixel images (close to your case). I see:
Threading doesn't help a lot with thumbnailing (it's limited by jpeg decode and encode), so you can save a bit of memory by turning down the threadpool. It needs 40mb of memory and c. 50ms. With gnu parallel I see:
So 400ms to resize 100 images. Though I don't know anything about digitalocean :( Maybe they have something to throttle processes which use more than a few ms of CPU? |
Beta Was this translation helpful? Give feedback.
-
Dear Community,
I just started to implement my own Image Resizer with libvips and after quite a lot of learning steps I finally have everything working in a Docker image and pushed it to DigitalOcean App Plattform. When I have a page with 10 jpg images that are around 2048x1365px and the Image Resizer wants to size them down to 1000px wide webp images, the answer for all 10 images suddenly took between 6-8s when using a single core instance with 1GB RAM. The CPU doesn't even touch the 30% usage mark, so I was wondering if this is what I can expect and if this is realistic. I worked for quite a few days now on this because I thought there is something I did wrong, but maybe I am just having the wrong expectations after it took only 300ms locally for many images but that's on a quite fast MacBookPro M1 Max.
Scaling up from 1 instance to 2 instances cut the processing time in half so that all 10 images now were calculated in 3.5s and therefore I would love to know if you think that simply more small instances are the best choice. My gut tells me so after seeing that the CPU isn't even used a lot and simply makes all parallel requests slower.
Thank you so much for sharing your experience and thank you as well to everybody for working on this awesome project.
Manuel
Beta Was this translation helpful? Give feedback.
All reactions