Archive

Archive for the ‘Linux’ Category

Out of Memory

August 21st, 2008 No comments

As performance engineer I come across various problems.� Here is one when the server crashed due to lack of free memory. See the error here.
Read more…

How do I know what services I have running?

August 21st, 2008 No comments

To get a list of all running processes, enter the command “ps auxw”. You might also want to try using “ps auxf” (or “ps auxfw” if the lines get truncated) – this prints everything in a nice tree format that may give you a better understanding of how and why things are running.

To get a complete listing of all listening network services using netstat, enter: netstat -altpu

You can also get similar information using lsof by entering: lsof -i | egrep -i ‘LISTEN|UDP’

Using Shell Variables with AWK

June 21st, 2008 No comments

Pattern matching example:

1
awk '/foo1/ && /foo2/ { print $1 }'

To use shell variables simply do the following:

1
2
3
4
foo1={pattern1}
foo2={pattern2}
 
awk "/$foo1/ && /$foo2/"'{ print $1 }'

Crontab

June 13th, 2008 No comments

Crontab syntax :
A crontab file has five fields for specifying day , date and time followed by the command to be run at that interval.

crontab 300x110 Crontab

* in the value field above means all legal values as in braces for that column.

The value column can have a * or a list of elements separated by commas. An element is either a number in the ranges shown above or two numbers in the range separated by a hyphen (meaning an inclusive range).

Example:
55 23 * * * $HOME/automation/getStats.sh > $HOME/automation/logs/cron.logs 2>&1
* to avoid getting emails on Linux from cron, you can disable by appending    ’>/dev/null 2>&1′ .



Benefits of Logical Volume Management

June 8th, 2008 No comments

Logical Volume Management provides benefits in the areas of disk management and scalability. It is not intended to provide fault-tolerance or extraordinary performance. For this reason, it is often run in conjunction with RAID, which can provide both of these. Read more…