> I have a shell script run by some python code using imagemagick's convert
> to
> resize images.  If I run the python code from the cli, it uses 4 cpu
> cores.  If
> I run the script through a webpage via nginx+uwsgi it uses 1 core.  If I
> set
> 'cpu-affinity' to '2', convert uses two cores.  Any value higher than 2
> results
> in two cores being used.  Is uWSGI limiting the number of cores used?
> nginx?
>
>
> Operating system:   Arch Linux
> CPU architecture:   x64
> Webserver:          nginz
> uWSGI version:      2.0.1
>
> $ cat /etc/uwsgi/common.ini
> [uwsgi]
> print = @@@ %n.ini loading @@@
> strict = true
> socket = /tmp/%(my_config_name).socket
> chmod-socket = 666
> chown-socket = http:http
> plugins = python2
> mount = /=wsgihandler:application
> processes = 1
> #harakiri = 60
> harakiri = 600
> post-buffering = 4096
> cpu-affinity = 2
> stats = /tmp/stats.socket
> max-requests = 2000
> limit-as = 512
> reload-on-as = 256
> reload-on-rss = 192
> no-orphans = true
> enable-threads = true
> threads = 4
> _______________________________________________
>


If i remember correctly imagemagick (if compiled with openmp) can run its
functions in multiple threads, so i suppose your problem is that those
threads do not spawn or spawn in a 'strange' way.

I would start removing the limit-as option, expecially on 64bit systems is
generally a bad idea. There are more efficient (and less-invasive) ways to
limit memory (and generally you want to limit physical memory, not the
virtual one that has various usages)


-- 
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to