Monitoring for Web
Applications
Контроль и мониторинг Linux процессов
для Рython разработчиков
•sudo apt-get install nginx
•ls /etc/init.d/nginx
•sudo service nginx restart
•sudo apt-get install mongodb-10gen
•ls /etc...
Monitoring system which just works
•sudo apt-get install monit
•ls /etc/init.d/monit
•service monit status
•cat sudo cat /etc/monit/monitrc
1.set daemon 120 ...
Monit Web Server
MongoDB process detail
•/home/user/venv/bin/pip install tornado
•ls venv/lib/python2.7/site-packages/tornado
•venv/bin/python my_web_project/app....
A process control system
•supervisord
•supervisorctl
•Web Server
•XML RPC Interface
•/home/user/venv/bin/pip install super...
Supervisor Web Interface
Configuring Supervisor
Celery supervisor config
Plugin source code
Linux processes control and monitoring
Upcoming SlideShare
Loading in...5
×

Linux processes control and monitoring

284

Published on

Контроль и мониторинг Linux процессов для Рython разработчиков

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
284
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Linux processes control and monitoring

  1. 1. Monitoring for Web Applications Контроль и мониторинг Linux процессов для Рython разработчиков
  2. 2. •sudo apt-get install nginx •ls /etc/init.d/nginx •sudo service nginx restart •sudo apt-get install mongodb-10gen •ls /etc/init.d/mongodb •sudo service mongodb status •ls /etc/mongodb.conf •sudo apt-get install rabbitmq-server •ls /etc/init.d/rabbitmq-server •service rabbitmq-server status
  3. 3. Monitoring system which just works
  4. 4. •sudo apt-get install monit •ls /etc/init.d/monit •service monit status •cat sudo cat /etc/monit/monitrc 1.set daemon 120 # check services at 2-minute intervals 2.set logfile /var/log/monit.log 1.check process nginx with pidfile /var/run/nginx.pid 2. start program = "/etc/init.d/nginx start" 3. stop program = "/etc/init.d/nginx stop" 4. if failed port 80 protocol http then alert 5. if cpu usage is greater than 60 percent for 2 cycles 6. then alert 7. if cpu usage > 98% for 5 cycles then restart 8. if 2 restarts within 3 cycles then timeout 9. alert admin@bar.com Installation & Configuration
  5. 5. Monit Web Server
  6. 6. MongoDB process detail
  7. 7. •/home/user/venv/bin/pip install tornado •ls venv/lib/python2.7/site-packages/tornado •venv/bin/python my_web_project/app.py •/home/user/venv/bin/pip install celery •ls venv/lib/python2.7/site-packages/celery •venv/bin/celery worker -A myproject.tasks -- config=myproject.celeryconfig Virtualev based Python stack
  8. 8. A process control system •supervisord •supervisorctl •Web Server •XML RPC Interface •/home/user/venv/bin/pip install supervisor •ls venv/lib/python2.7/site-packages/supervisor •/venv/bin/echo_supervisord_conf > supervisord.conf •venv/bin/supervisord -c supervisord.conf •venv/bin/supervisorctl -c supervisord.conf shutdown
  9. 9. Supervisor Web Interface
  10. 10. Configuring Supervisor
  11. 11. Celery supervisor config
  12. 12. Plugin source code
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×