Singapore Flyer

Tuesday, August 6, 2013

Who is eating my memory in linux

I have a OEL5.8 64bit having 16GB memory.
In free -m command i can see almost 15GB used, but no software are installed.

[root@Server-2 tmp]# ps axu | awk '{print $2, $3, $4, $11}' | head -1 && ps axu | awk '{print $2, $3, $4, $11}' | sort -k2 -nr |head -5
PID %CPU %MEM COMMAND
PID %CPU %MEM COMMAND
96 0.0 0.0 [scsi_eh_3]
95 0.0 0.0 [scsi_eh_2]
91 0.0 0.0 [scsi_eh_1]
9 0.0 0.0 [migration/2]

[root@Hawai-2 tmp]# ps -eo pmem,pcpu,vsize,pid,cmd | sort -k 1 -nr | head -5
 0.1  0.0  32780  2608 iscsiuio
%MEM %CPU    VSZ   PID CMD
 0.0  0.0  90152 24214 sshd: root@pts/1
 0.0  0.0   8528  3151 /usr/bin/hidd --server
 0.0  0.0  84456  3494 /usr/bin/Xorg :0 -br -audit 0 -auth /var/gdm/:0.Xauth -nolisten tcp vt7

[root@Hawai-2 tmp]# /etc/init.d/iscsid status
iscsid (pid  2617) is running...
[root@Hawai-2 tmp]# /etc/init.d/iscsid stop
Stopping iSCSI daemon:
[root@Hawai-2 tmp]#                                        [  OK  ]
[root@Hawai-2 tmp]#

After this i have rebooted the machine. Checked the free -m i can see a lot of free memory in the box.

Friday, August 2, 2013

How to allow open relay for a particular IP in QmailToaster

Open the file /etc/tcprules.d/tcp.smtp
Add the IP,
IP:allow,RELAYCLIENT=""
Save the file

tcprules /etc/tcprules.d/tcp.smtp.cdb /etc/tcprules.d/tcp.smtp.tmp < /etc/tcprules.d/tcp.smtp

This will allow relay from that IP.

Do you need to test this?

[root@bkserver1 ~]# telnet mailserver 25
Trying IP...
Connected to mailserver (IP).
Escape character is '^]'.
220 server.com - Welcome to Qmail Toaster Ver. 1.3 SMTP Server ESMTP
mail from:user@gmail.com
250 ok
rcpt to:user@yahoo.com
250 ok
data
354 go ahead
subject:This is a test
to:user@yahoo.com
from:user@gmail.com
This is the msg body of test
.
250 ok 1375419193 qp 22691
quit
221 server.com - Welcome to Qmail Toaster Ver. 1.3 SMTP Server
Connection closed by foreign host.
[root@bkserver1 ~]#