Idle Whacker
What the?
Idle whacker polls a given url periodically so that the app server never goes to sleep.
How the?
Idle whacker installs a crontab entry on a given (host) machine which then uses ab
(apache-bench) to generate traffic to a given URL periodically.
Installation
Idle whacker depends on ab
being available on the command line. ab
(apache-bench) can be installed via apt-get install apache2-utils
- this is a really small util, with libreadline at its only dependency.
gem install idle_whacker
Usage
> rake -T
rake idle_whacker:install # Install the whack
rake idle_whacker:remove # Removes all whacks
rake idle_whacker:show # Shows all the whacking installed
rake idle_whacker:test # Test a sample whack
A sample session of installing a whack
> rake idle_whacker:install
URL to whack, eg(http://www.foobar-server.com/lazy_boy.html): http://www.nest.com/about/ #URL to poll for.
Whacker install host eg(www.foobar-server.com): www.whacker.com #Machine where the crontab will be installed
Username: deployer #Login to the above install host
Password (Leave this blank if ssh keys are setup):
Installing crontab entry..
*/5 * * * * echo '[idle_whacking]' && ab -c 5 -n 25 http://www.nest.com/about/
Done.