How to limit cpu usage for a process with cpulimit (Ubuntu / Debian server)

cpulimit is a tool that can be used to limit cpu usage (throttle cpu usage) for a single process (by its PID). cpulimit is useful to ensure that a single process would not hogs the cpu cycles, which can be use by other processes. cpulimit is different from ‘nice’ as it limits the real cpu usage for a process, while ‘nice’ controls scheduling priorities for a particular process.

How to use cpulimit?
Basic usage:
[bash]
cpulimit -p [pid] -l [ cpu percentage]
cpulimit -p 12345 -l 25
[/bash]

Running cpulimit on background:

[bash]
cpulimit -p 12345 -l 25 -z -b
[/bash]

Note: The cpu percentage is the same one as reported by the ‘top’ command.

cpulimit can be installed from Ubuntu and Debian 6.0 (Squeeze) repository through apt-get. The official website of cpulimit is http://limitcpu.sf.net

Pingness.com: Free service to monitor website uptime

It is undeniable that uptime is important for business and personal websites. For example, a website with low uptime may mean that the host is having technical problem or the web server is overwhelmed by client requests (serving web pages may incur a lot of overhead)

Pingness.com service does not require sign-up, you need to submit your email address and website url, and pingness will send reports of your site downtime (if any) and when the website is back-online.

pingness

Grake – a tool for scanning web pages for Youtube Video URL

grake is a command-line tool for scanning web pages for embedded Youtube video link. As a scanning tool, grake is meant to complement other tool that would accept Youtube URL as its parameter, notably cclive.

Usage Example:

[bash]
# general command line example
grake [YOUTUBE URL]
[/bash]

[bash]
# typical / normal use
grake http://youtube.com/
[/bash]

[bash]
#output as json (for programmatic consumption)
grake –json http://youtube.com/
[/bash]

[bash]
#tell cclive to download youtube urls from grake output

grake http://youtube.com/ | cclive
[/bash]

This of course require the latest release of cclive in order for the download example to work.