Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

RMagick & Rails performance #29

Closed
rnhurt opened this Issue · 2 comments

2 participants

@rnhurt

I have a question on Server Fault where I'm having problems with RMagick consuming all CPU resources, but I thought I would ask the experts here some more pointed questions. I have a very simple one liner that can consume all 8 ECUs on a extra large Amazon server:

image = Magick::Image.read("pattern:checkerboard") { self.size = "400x400" }.first
image.format = "jpg"
send_data image.to_blob 

Running ApacheBench (ab -n 100 -c 10 "http://my.aws.box/checkerboard") causes the box to consume all 8 CPUs for 15 seconds. It almost acts as if RMagick is single threaded and can't process more than one thing at a time. But if I run it with one concurrent request the CPUs all get part of the load but don't fill up completely.

I'm really stumped by this RMagick performance and am grasping at straws. Any help at all would be appreciated. :)

@mmaiza
Collaborator
@rnhurt

Yes, I recompiled and performance shot up. OK, for future generations, running RMagick on AWS with multiple cores doesn't work (well) unless you disable OpenMP. I could literally respond to more requests with a single ECU than with 16 ECUs. Amazing! I also turned the quality down to 8bit to squeeze out a bit more performance.

Later...
Richard

@rnhurt rnhurt closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.