Permalink
Browse files

Pass resource limits directly to warden

Change-Id: Ifd6b27ca295d4201dddf54aefb936a7f50b1069d
  • Loading branch information...
1 parent a9075d5 commit 9fa8d182ede72c9c13c889c214c706dd2bf7f5e4 @pietern pietern committed Nov 5, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/dea/instance.rb
View
@@ -634,9 +634,7 @@ def promise_prepare_start_script
def promise_start
Promise.new do |p|
script = []
- script << "renice 0 $$"
- script << "ulimit -n %d" % self.file_descriptor_limit
- script << "ulimit -u %d" % 512
+
script << "umask 077"
env = Env.new(self)
@@ -657,6 +655,11 @@ def promise_start
request = ::Warden::Protocol::SpawnRequest.new
request.handle = attributes["warden_handle"]
request.script = script.join("\n")
+
+ request.rlimits = ::Warden::Protocol::ResourceLimits.new
+ request.rlimits.nofile = self.file_descriptor_limit
+ request.rlimits.nproc = 512
+
response = promise_warden_call(:app, request).resolve
attributes["warden_job_id"] = response.job_id

0 comments on commit 9fa8d18

Please sign in to comment.