Latest blog entry

Howto: Check Memory/RAM usage in Linux

April 26, 2010    |   Posted by admin   |    Category: Linux Administration

How to check Memory (RAM) usage in Linux OR different ways to check RAM usage in Linux?

Memory OR widely known as RAM is known to be one of the important component on the server which make sure the tasks performed on your server are processed fast enough. Higher the availibility of physical memory, more stable is your server during high resource usage processes.

Linux offer various tools to check Memory/RAM usage of your server such as free, top, sar, vmstat etc using which you can deside whether to optimize softwares to use less memory OR whether it’s time to upgrade memory on the server.

1) ‘free’ command: one of the easiest way to check the RAM usage:

free -m
will display physical memory as well as Swap

free -m -t
same as above but it will display the total of physical and swap memory at the bottom.

2) ‘top’ command: The top command displays the real time values of the running system and are continously updated (by default 3 seconds). The two rows “Mem and Swap” displays the total, used and free amount of RAM/Swap. Though the values displayed are in kbs and not human readable, it is just one another way to check the usage.

3) ‘sar’ command: is included in the ‘sysstat’ package and is not installed by default. To install ‘sysstat’ package, execute:

yum install sysstat

Once ‘sysstat’ package is installed, start the service

service sysstat start

sysstat package when installed, provider ‘sar’ command which collects system activity information and saves it in a file before displaying it on a standard output.

sar -r
displays Memory/Buffer/Swap information horizontally.

4) /proc/meminfo file: which displays everything about the RAM on your server.

cat /proc/meminfo

Related Links:

How to find out CPU utilization in Linux?

Once ‘sysstat’ package is installed, start the service

service sysstat start

Comments Off on Howto: Check Memory/RAM usage in Linux

version.c:30:16: error: db.h: No such file or directory

April 9, 2010    |   Posted by admin   |    Category: Linux Administration

If the db4 packages (db4 and db4-devel) are missing on the server it results in “version.c:30:16: error: db.h” error message while installing any package. The error looks like:

version.c:30:16: error: db.h: No such file or directory
make: *** [version.o] Error 1

See if the db4 packages are installed

# rpm -qa | grep db4-devel
 db4-4.2.52-7.3.el4
 db4-devel-4.2.52-7.3.el4

If the above commands returns nothing, you have to install the db4 and db4-devel packages. Search the packages using yum and it should list both of them:

# yum search db4

It will list both the db4 and db4-devel packages

db4.x86_64
db4-devel.x86_64

Now, install them

# yum install db4.x86_64
# yum install db4-devel.x86_64
Comments Off on version.c:30:16: error: db.h: No such file or directory

Starting sshd: Privilege separation user does not exist

April 5, 2010    |   Posted by admin   |    Category: Linux Administration

The error message “Starting sshd: Privilege separation user sshd does not exist FAILED” is received on restarting the SSHD service. It indicates that the user ‘sshd’ does not exist. To fix the add the ‘sshd’ user on the server.

If it’s a VPS, your hosting provider can login through the main server and fix it. If it’s a dedicated server, you have to add the user via single user mode unless you were already logged in before the problem occurred.

Add the following to the /etc/passwd file

sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin

add the below line to /etc/group file

sshd:x:74:

Restart the sshd service.

# /etc/init.d/sshd restart
 Stopping sshd: [ OK ]
 Starting sshd: [ OK ]

An alternate solution is to disable UsePrivilegeSeparation in the SSHD configuration. Edit the file /etc/ssh/sshd_config and change

UsePrivilegeSeparation yes
to
UsePrivilegeSeparation no

It is less secure but just another option.

Comments Off on Starting sshd: Privilege separation user does not exist