Date: Fri, 13 Mar 2015 19:46:37 +0100 From: Eduardo Morras <emorrasg@yahoo.es> To: freebsd-questions@freebsd.org Subject: Re: Limiting CPU on some processes on web server Message-ID: <20150313194637.a509370f64ad0697e3c09a70@yahoo.es> In-Reply-To: <20150311122656.96F2020341@smtp.hushmail.com> References: <20150311122656.96F2020341@smtp.hushmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 11 Mar 2015 12:26:56 +0000 opendaddy@hushmail.com wrote: > Hi! > > I run this web app that depends on ImageMagick to process images and > ffmpeg to process videos. These processes, unfortunately, consume > 100% of my CPU, rendering my web app unusable (gateway timeout). > > Tried `nice -n 19` but to no avail. > > What other options do I have? You can use cpuset from shell script, if use imagemagick: cpuset -c -l 1 /usr/local/bin/ImageMagick <insert parameters> to restrict imagemagick to use cpu 1. If process is running, use cpuset -c -l 0,2 -p <pid of your webapp> To force your webapp to run only on cpus 0 and 2 Check man cpuset and man 2 cpuset for more information. > Thanks! > > O.D. --- --- Eduardo Morras <emorrasg@yahoo.es>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150313194637.a509370f64ad0697e3c09a70>