[Seaside] Monit on Ubuntu / Debian to monitor Seaside images

Rajeev Lochan lochan94 at gmail.com
Wed Feb 6 21:19:07 UTC 2008


Thanks Sebastian for your prompt reply. I am a Linux newbie, so I didn't
understand completely what you conveyed. If you could please spare some time
to explain in some more detail, it would help newbies like me.

I install monit using
sudo aptitude install monit

once installed /etc/monit/monitrc  is the place where monitrc file is
located.

Then I do
sudo pico /etc/monit/monitrc  and its the place where I put code sent by
you.


Till now, I have understood. How to go about further, when it comes to
Seaside view point. The monitrc file you have pasted, I suppose is just for
1 seaside image. Could you please explain how you created OJ7WRE in
/etc/init.d
. Is it a process ? By the way what is OJ7WRE ?

How do you accomplish this, if you have a seaside_cluster with say 4 images?


Thanks again for your time,
Rajeev


On Feb 7, 2008 2:28 AM, Sebastian Sastre <ssastre at seaswork.com> wrote:

>  Hi Rajeev,
>
>     Monit its simple and yet powerful.
>
>     This is how the monitrc file looks like to monitor a squeak image:
>
>
> ###############################################################################
> ## Monitoring DEVELOPMENT Service OJ7WRE
>
> ###############################################################################
>
>  check process OJ7WRE with pidfile /var/run/services/OJ7WRE.pid
>  group server
>  start program = "/etc/init.d/OJ7WRE start"
>  stop program = "/etc/init.d/OJ7WRE stop"
>
>  if cpu > 60% for 2 cycles then alert
>  if cpu > 80% for 5 cycles then restart
>  if totalmem > 200.0 MB for 2 cycles then restart
>
>  if loadavg(5min) greater than 10 for 8 cycles then restart
>  if 5 restarts within 5 cycles then timeout
>
> ###############################################################################
>
>     the start and stop script is doing more or less what you are doing
> manually. I send a kill -15 to close image gently. Also I needed to make the
> pid file when the image starts and remove before image quits. I have an
> object in the image dedicated to startup and shutdown production stuff
> inside the image.
>
>     For a "more monitored" services you can make monit to send you an
> email to your cell phone if it reach some point (like a service restart or
> fail to start or CPU 100% for more than 5 min or apache is down or
> whatever).
>
>     cheers,
>
>
> Sebastian Sastre
>
>
>  ------------------------------
> *De:* seaside-bounces at lists.squeakfoundation.org [mailto:
> seaside-bounces at lists.squeakfoundation.org] *En nombre de *Rajeev Lochan
> *Enviado el:* Miércoles, 06 de Febrero de 2008 17:36
> *Para:* Seaside - general discussion
> *Asunto:* [Seaside] Monit on Ubuntu / Debian to monitor Seaside images
>
> Hi,
> I have been working towards setting up a dedicated server (Ubuntu) to host
> my Seaside app as per Ramon's Blog
> http://onsmalltalk.com/programming/smalltalk/scaling-seaside-redux-enter-the-penguin/
>
> Till now, I have been successful in having Apache serve static content and
> Load balance between 3 images of my Seaside App. Sticky sessions are working
> and everything is going well so far. But I had a problem when installing
> Daemontools (which Ramon has written in his blog and also Lukas has written
> in Mailing lists), the recent versions of Ubuntu, dont support Daemontools
> out of the box.
>
> In one of the comments to Ramon's post, I could learn that some of the
> seasiders have used Monit to do much more than want Daemontools does. Could
> you please guide me how to go about.
>
> I came across a blog on Rails using Monit
> http://www.igvita.com/2006/11/07/monit-makes-mongrel-play-nice/
> In that, what is the equivalent code to Seaside of the following code ?
>
> start program = "/usr/local/bin/ruby /usr/local/bin/mongrel_rails start -d -e production -p 8010 -a 127.0.0.1 -P /home/user/current/log/mongrel.8010.pid -c /home/user/rails/current"
>
>     stop program  = "/usr/local/bin/ruby /usr/local/bin/mongrel_rails stop -P /home/user/current/log/mongrel.8010.pid"
>
> Till now, I have been starting the images manually by
> /seaside$ squeakvm  -nodisplay seasidedemo "" port 9090 &
>
> and to kill it, i use $ pkill squeakvm    or $ kill [PID of SqueakVM]
>
> I suppose, we will also have to change the following code
>
> if totalmem is greater than 60.0 MB for 5 cycles then restart
>
> When an image is running on my server (Pentium Dual Core 2.8 GHz with 1 GB
> RAM), it shows almost 3-4% CPU and 3-4% RAM , should we shift the memory cap
> from 60 MB to 100 MB / image ?
>
>
> Is there any other options we have ?
>
> Thanks for the help,
>
> Rajeev
>
> Co-founder, AR-CAD.com
>
> http://www.ar-cad.com
> +91 9243468076 (Bangalore)
> 080 65355873
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>


-- 
Rajeev Lochan

Co-founder, AR-CAD.com

http://www.ar-cad.com
+91 9243468076 (Bangalore)
080 65355873
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20080207/d51e33f9/attachment.htm


More information about the seaside mailing list