Monitor the production server

kej edited this page May 9, 2012 · 14 revisions
  • To view generell passenger setup:
sudo /usr/local/bin/passenger-status
  • To see which process is attached to which site and using how much memory:
sudo /usr/local/bin/passenger-memory-stats
  • If processes seem to take to much memory restart apache:
sudo /etc/init.d/apache2 restart

wait a few seconds and check with passenger-memory-stats if the process has disappeared.

  • If the process does not disappear, last resort is to use:
sudo kill -9 process_id
  • To activate restarting passenger processes regularly (every ten requests) do
sudo vi /etc/apache2/apache2.conf

and find the line at the very bottom

# Try and avoid mem leaks
#PassengerMaxRequests 10

and uncomment PassengerMaxRequests

  • To search the logfile for a specific date and near some time (here around three):
cat log/production.log | grep  "2012-02-01 15" --after-context=10 --before-context=1