draw text slow as _www
Posted: 2014-11-21T10:16:36-07:00
I was doing some apache cgi-bin image manipulations in python via shell. It was extremely slow.
Then I isolated the issue to drawing text with convert as the user _www.
I am not sure where to go from here. What is special about _www using draw text?
$ date;sudo -H -u _www /sw/bin/convert image.tiff -format png -scale 600 -draw "text 25,60 'Magick'" -depth 8 /tmp/tmp.png;date
Thu Nov 20 16:06:39 PST 2014
Thu Nov 20 16:07:36 PST 2014 <----------------
In the process viewer, "top", convert is running 89-100% for that duration.
In comparison:
Drawing no text
$ date;sudo -H -u _www /sw/bin/convert image.tiff -format png -scale 600 -draw "text 25,60 ''" -depth 8 /tmp/tmp.png;date
Thu Nov 20 16:07:46 PST 2014
Thu Nov 20 16:07:46 PST 2014
Drawing text as normal user or su
$ date;sudo /sw/bin/convert image.tiff -draw "text 25,60 'x'" /tmp/tmp.tiff;date
Thu Nov 20 16:09:46 PST 2014
Thu Nov 20 16:09:47 PST 2014
Version: ImageMagick 6.5.8-2 2011-01-05 Q16
Features: HDRI OpenMP
Mac OSX 10.8.5
Then I isolated the issue to drawing text with convert as the user _www.
I am not sure where to go from here. What is special about _www using draw text?
$ date;sudo -H -u _www /sw/bin/convert image.tiff -format png -scale 600 -draw "text 25,60 'Magick'" -depth 8 /tmp/tmp.png;date
Thu Nov 20 16:06:39 PST 2014
Thu Nov 20 16:07:36 PST 2014 <----------------
In the process viewer, "top", convert is running 89-100% for that duration.
In comparison:
Drawing no text
$ date;sudo -H -u _www /sw/bin/convert image.tiff -format png -scale 600 -draw "text 25,60 ''" -depth 8 /tmp/tmp.png;date
Thu Nov 20 16:07:46 PST 2014
Thu Nov 20 16:07:46 PST 2014
Drawing text as normal user or su
$ date;sudo /sw/bin/convert image.tiff -draw "text 25,60 'x'" /tmp/tmp.tiff;date
Thu Nov 20 16:09:46 PST 2014
Thu Nov 20 16:09:47 PST 2014
Version: ImageMagick 6.5.8-2 2011-01-05 Q16
Features: HDRI OpenMP
Mac OSX 10.8.5