Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am operating a system with heavy image editing processed by imagemagick.

Now for a new server I was wondering which system requirements are most important to boost performance of imagemagick and image editing such as converting and composing gifs, jpgs and pngs.

The resolution of the images is usually between 800x400 and 1980x1080 px. Multiple images may be processed at the same time.

I was thinking that a lot of (fast) RAM would be most important but then even full hd in 32bit only takes around 8MB, so maybe CPU is more important?

Any insights are highly appriciated!

Update:
htop shows that CPU is the most probably the bottleneck.
Since imagemagick needs a lot of resources I could imagine that I would hit CPU limits with one server pretty quickly. Any ideas how I could balance the load dynamically (there could be huge peaks)? Something like Amazon Web Services but quicker since images are rendered on the fly?

share|improve this question
1  
What is your current bottleneck? Benchmark, see what limits you and then improve this. –  Sven Jun 28 '13 at 13:03
    
@SvW From htop it looks like the CPU would be the bottleneck. It goes up to 100% work load meanwhile RAM is under 1% on a 4 CPU, 4 GB RAM server. –  horen Jul 1 '13 at 11:21
1  
I think you've answered your own question. –  Michael Hampton Jul 5 '13 at 7:39
    
Well, other variables also leads to CPU bottleneck. Just saying what htop reports is not the full truth. CPU could be waiting on I/O, then it's your block device subsystem that is holding CPU back. More CPU will allow you to context switch faster, to instantiate more parallel process, but it won't help anymore if your HDDs are 5400 rpm, for instance. Your bottleneck appears to be CPU but CPU waits for disk I/O, synchronously, you should dig deeper. –  Marcel Jul 10 '13 at 17:43

4 Answers 4

Processing such small images (and 1920x1080 is small) doesn't require much memory, CPU is dominant.

You need lots of CPU power, if you have many pictures to convert at a time, running the conversions in parallel is a good idea. Also, because it's easy to run it in parallel having CPU with more cores vs higher frequency will give you higher performance. You just need to make sure to run many jobs at the same time.

In other words, look for machines with minimal amount of memory (4-8GB) and many cores or even many CPUs. If you're using Amazon, then High-CPU Instances is what you're looking for. For very large load, it may be good idea to look at cluster instances.

Depending on the specific number of conversion requests, you may have better luck scaling horizontally - getting more machines and spreading your load over them. But that depends on your exact use case, collocation costs or VM costs, etc.

share|improve this answer

From htop it looks like the CPU would be the bottleneck. It goes up to 100% work load ...

If your CPU is pegging and everything else is at nominal values then you need to add Moar CPU.

share|improve this answer
    
@lain: since imagemagick needs a lot of resources I could imagine that I would hit CPU limits with one server pretty quickly. Any ideas how I could balance the load dynamically (there could be huge peaks)? Something like Amazon Web Services but quicker? –  horen Jul 5 '13 at 8:19
    
@horen, you would need to create/utilize a queueing system where workers will poll some place to look for more work to do. That way you can have exact and controlled number of imagemagik workers to utilize all the available CPUs/cores without overwhelming them. Read up on Message Queues, available products and services. –  Mxx Jul 9 '13 at 20:26

I've done photobooth project, based on opensource software, we use ImageMagick for image processing. We've experimented with both x86 and ARM v6/v7 platforms. Different image sizes, different effects, combining of images etc. We've tested with 256 RAM for both old x86 PC and ARM (Raspberry Pi). CPU was the bottleneck and we were practically unable to use 1 core for instant processing - it was taking about 30 secs to complete on ARMv6, 10 secs on P3 and 1 sec for 1 GHz newest Core. It's a CPU. If you are running ImageMagick apps from command line, then you should check /tmp, which is usually tmpfs/shared memory. For us it was taking about 64MB per one large print image, combined from four jpegs from Canon cameras. If you are running several processes at once - just add more cores.

How to balance the load? Depends on your configuration, how your system works. Do you use web services, running ImageMagick with php or have your own programs etc... Please clarify...

share|improve this answer

HAProxy will let you 'load balance' between multiple servers from the networking side... And provide fail over.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.