try setting a higher swappiness, take other val for mem calculation

This commit is contained in:
Florian Staudacher 2012-04-06 01:50:35 +02:00
parent 248e9d9ae7
commit 518346deab
2 changed files with 3 additions and 2 deletions

View file

@ -14,9 +14,10 @@ sh -e /etc/init.d/xvfb start
# setup swapfile # setup swapfile
echo "creating a swapfile" echo "creating a swapfile"
sudo dd if=/dev/zero of=swapfile bs=1M count=128 sudo dd if=/dev/zero of=swapfile bs=1M count=96
sudo mkswap swapfile sudo mkswap swapfile
sudo swapon swapfile sudo swapon swapfile
sudo sysctl vm.swappiness=100
# Create a database.yml for the right database # Create a database.yml for the right database
echo "Setting up database.yml for $DB" echo "Setting up database.yml for $DB"

View file

@ -14,7 +14,7 @@ class DeferredGarbageCollection
def self.memory_threshold def self.memory_threshold
@mem = %x(free 2>/dev/null).to_s.split(" ") @mem = %x(free 2>/dev/null).to_s.split(" ")
return nil if @mem.empty? return nil if @mem.empty?
@mem[8].to_i / (@mem[7].to_i/100) @mem[15].to_i / (@mem[7].to_i/100)
end end
def self.reconsider def self.reconsider