Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process queue to offload ImageMagick #258

Closed
icarito opened this issue May 3, 2018 · 7 comments
Closed

Process queue to offload ImageMagick #258

icarito opened this issue May 3, 2018 · 7 comments

Comments

@icarito
Copy link
Member

icarito commented May 3, 2018

This is a note that in production we're seeing large images (I observed upwards of 15000x15000 if I believe htop) - causing convert to take a huge time and RAM and bringing the app down.

Benjamin Sugar suggested offloading to a process queue of some sort. I a not familiar with it but I think Redis is popular.

It'd be nice to not worry about this kind of downtime.
Thanks!

@icarito
Copy link
Member Author

icarito commented May 3, 2018

Note that alternative or interim measures to better contain ImageMagick are appreciated. Currently we use /etc/ImageMagick-6/policy.xml to limit resource usage. But I think the problem occurs because we run several processes at once.

I've further throttled to 25% cpu load and added a 2GB RAM limit per process:

  <policy domain="resource" name="thread" value="1"/>
  <policy domain="resource" name="throttle" value="30"/>
  <policy domain="resource" name="memory" value="2GiB"/>

I hope it will hold for now.

@jywarren
Copy link
Member

jywarren commented May 3, 2018 via email

@icarito
Copy link
Member Author

icarito commented May 3, 2018 via email

@jywarren
Copy link
Member

jywarren commented May 3, 2018 via email

@icarito
Copy link
Member Author

icarito commented May 3, 2018 via email

@jywarren
Copy link
Member

jywarren commented Jan 12, 2019

I'm wondering if we could create a Google Cloud mini app that includes imagemagick, gdal, and some Ruby, to offload key portions of this into a cloud-based queue.

We're also looking at how to implement this in JavaScript, but I want to be thorough and explore both means. And JavaScript won't be able to generate GeoTiffs and map tiles the way GDAL will.

Maybe starting with this? https://github.com/geo-data/gdal-docker

Then installing imagemagick on a variant of that, and Ruby?

Maybe we could integrate it with this? https://github.com/googleapis/google-cloud-ruby

https://cloud.google.com/ruby/getting-started/hello-world

@jywarren
Copy link
Member

Merging into #296 and #298!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants