-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If you can write to the hard drive, you can make a swapfile:

Make a 512MB swapfile
dd if=/dev/zero of=/vps.swp bs=1M count=512

Make it swap
mkswap /vps.swp

Mount it
swapon /vps.swp

Verify it is being used
swapon -s

That HAS to work...add it to the fstab and you're cooking with grease

If this doesn't work then kill me

Bryan

Chris Miller wrote:
| Bryan Smith wrote:
|> Chris,
|>
|> Everyone gave great answers, but why reinvent the wheel when there are
|> awesome packages that will do exactly what you want with a web-interface
|> as well. Enter monit(apt-get install monit)...it does exactly what is
|> sounds like it does; monitor daemons.
|>
|> Monit will actually attempt to connect to your daemons at a set
|> interval(1 minute on my system) and lie dormant if there is no alarm.
|> When monit fails to connect it sends an email that the process is down
|> and restarts it for you...it also send an email letting you know that
|> the process is back up. It does ssl as well...this is what you need, it
|> is a script indeed but has a bit more intelligence than the run of the
|> mill cronjob. I use it for snmp, ldap, nscd, apache, postfix, blah and
|> blah blah. This thing is totally customizable and there are tons of
|> examples out in the wild.
|
| Sounds great.  I'll look into it.
|
|> There is one file to config and it is super easy at that. A LOT of
|> people use monit to keep mongrels stuff rolling. We are not really
|> addressing the problem though Chris...how can you just run out of
|> memory? No swap partition? Swap not big enough? Did you make a swap file
|> even? How do you know these things are crashing because they are out or
|> memory? What error does apache throw to you?
|
| It's literally the system running out of memory.  It's a $15/month VPS,
| so memory is little.  I get 317 MB for RAM and no swap space (I tried to
| create a file, mkswap and swapon - no luck... makes sense, how would
| they make their money otherwise?)  I'm pretty certain they're out of
| memory because I'm always running within 30 MB of the total main memory
| limit.  All that has to happen is for one process to spike, to not
| garbage collect soon enough, etc. and then the system will run genuinely
| and completely out of memory.  The kernel will try and find a scapegoat
| to butcher at the High Tribunal of Memory Abusers, and it usually ends
| up being one of my more important processes.  I haven't really got a
| problem if the server fails to deliver a page every once in a while, but
| it needs to pick itself back up (immediately if at all possible) to make
| the user happy when he/she hits "refresh."
|
|> Bryan
|>
|> Chris Miller wrote:
|> | Robert Citek wrote:
|> |> On Sat, Sep 6, 2008 at 2:34 AM, Chris Miller
|> |> <[EMAIL PROTECTED]> wrote:
|> |>> I was wondering if anyone knew of a tool that could provide a bit
more
|> |>> immediate results, constantly verifying that a process or daemon is
|> |>> running, and to start it if it's not.  I'd settle for something that
|> |>> runs every minute (that isn't a cron job, since they leave me feeling
|> |>> very icky, kind of like a lame hack.  It works, but there should be a
|> |>> better solution).
|> |> Most system processes (e.g. those in /etc/init.d/) create a .pid file
|> |> in /var/run:
|> |>
|> |> $ ls -la /var/run/*.pid
|> |>
|> |> You can use that as a way to check if a system is up and running.
|> |> Using apache as an example:
|> |>
|> |> ps -p $(cat /var/run/apache2.pid 2> /dev/null ) >& /dev/null ||
|> |> echo "restart apache"
|> |>
|> |> Why the beef with crontab?
|> |
|> | It leaves me with the icky feeling of a bad hack.  I keep feeling that
|> | there should be a more elegant, problem-specific, fine-tuned solution.
|> | Something written in a real programming language like C with cryptic
|> | configuration file documentation and near ubiquitous, yet hilariously
|> | unspoken use all over the place.
|> |
|> | Yes, I am aware that I just described crontab.
|> |
|> |>> I was thinking that there's bound to be a kind of "process nazi" tool
|> |>> that'll keep things running smoothly, but I don't know of any.  I'm
|> |>> running Debian 5.
|> |> I'm guessing there's a reason you are running Debian 5 despite it
|> |> being labeled as "testing":
|> |
|> | Heh.  You've probably never tried to set up Ruby on Rails on Debian.
|> | Let's just say that the maintainers weren't aware that there was a
|> | hideous flaw in the supplied software, and I'm too lazy to downgrade to
|> | a supposedly more stable version after having done the work to upgrade.
|> |
|> | The tale of joys and woes to get my site working is here:
|> |
|> | http://lordsauron.wordpress.com/2008/06/18/zero-to-redmine-in-22-steps/
|> |
|> | Please notice that I disclose all my configuration secrets not because
|> | I'm confident my server is super-secure (I'm not) but because it was a
|> | PITA to get running, and I don't want anyone to ever have to beat
|> | through all that nonsense without documentation again.
|> |
|>
|
| |
|
|

- --
A healthy diet includes Linux, Linux and more Linux.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIwue9h+MLjl5SKYQRAkSRAJ0Tw9qFbzOyzQQOJ/jLMgSPbuZ70QCfVl9R
ST71n3rYGu/PgbN4aEfWU8k=
=9tLU
-----END PGP SIGNATURE-----

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [EMAIL PROTECTED]
For more options, visit our group at 
http://groups.google.com/group/linuxusersgroup
-~----------~----~----~----~------~----~------~--~---

Reply via email to