Skip to content

Commit

Permalink
add threads param
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Dyedov committed Jan 4, 2013
1 parent c819744 commit 6325cf1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion definitions/uwsgi_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
:die_on_term => false,
:close_on_exec => false,
:lazy => false,
:disable_logging => false do
:disable_logging => false,
:threads => nil do
include_recipe "runit"

# need to assign params to local vars as we can't pass params to nested definitions
Expand All @@ -40,6 +41,7 @@
extra_params += " --die-on-term" if params[:die_on_term]
extra_params += " --close-on-exec" if params[:close_on_exec]
extra_params += " --disable-logging" if params[:disable_logging]
extra_params += " --threads %d" % (threads) if params[:threads]

runit_service "uwsgi-#{params[:name]}" do
template_name "uwsgi"
Expand Down
8 changes: 7 additions & 1 deletion templates/default/sv-uwsgi-run.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@ if [ -f $PID ]; then kill -9 `cat $PID`; rm $PID; fi

cd $ROOT
exec 2>&1
exec $UWSGI --socket <%= @options[:host] %>:<%= @options[:port] %> --uid <%= @options[:uid] %> --gid <%= @options[:gid] %> --pidfile $PID<%= @options[:extra_params] %> --processes=<%= @options[:worker_processes] %> -w <%= @options[:app] %>
exec $UWSGI \
--socket <%= @options[:host] %>:<%= @options[:port] %> \
--uid <%= @options[:uid] %> \
--gid <%= @options[:gid] %> \
--pidfile $PID \
--processes=<%= @options[:worker_processes] %><%= @options[:extra_params] %> \
-w <%= @options[:app] %>

0 comments on commit 6325cf1

Please sign in to comment.