Tag Archives: monitoring

Mail 550 filter

If you make a project with huge amount of email notification, you MUST control number of 550 reply from mail servers. Because if you skip this step, and continue sending to deleted mail boxes, big mail providers such as gmail.com, mail.ru, mail.ua, etc. will ban you domain at 0.5 – 1% “user unknown” reply.
So mail.log parsing is only solution.
In our project we add bad email addresses to database table (we use postgress)

1. make database replace rule, if email already added, (email is primary key) it is fastest way to prevent errors on INSERT duplicate email addresses.
Read more »

Mysql slave lag monitoring

Everybody know

SHOW SLAVE STATUS;

Also everybody know that ‘Seconds_Behind_Master’ shows difference in seconds between the slave SQL thread and the slave I/O thread.

Sometime it shows nonsense, and if you build monitoring It is not good practice to use ‘Seconds_Behind_Master’
Example from real life:
If replication becomes stalled due to connectivity problems, Seconds_Behind_Master shows 0 while replica is far away from master, changing timeout values not help. 🙁 i mean:

slave_net_timeout=300

So we implement following monitoring – every 3 second write current timestamp at master.
and check replica delay.
Or You can use percona heartbeat, It do almost the same.
Read more »

netperf – measuring network bandwidth

Netperf is much better way to measure network bandwidth, then using ftp/sftp, as many OPS do.

stx153:~# aptitude search netperf 
p   netperf                                                   - Network performance benchmark                                      
stx153:~# aptitude install netperf

Remove startup links, we don`t need netperf to be started at runtime.

stx153:~# update-rc.d -f netperf remove
 Removing any system startup links for /etc/init.d/netperf ...
   /etc/rc0.d/K20netperf
   /etc/rc1.d/K20netperf
   /etc/rc2.d/S20netperf
   /etc/rc3.d/S20netperf
   /etc/rc4.d/S20netperf
   /etc/rc5.d/S20netperf
   /etc/rc6.d/K20netperf
stx153:~# 
#/etc/init.d/netperf start

How to test:
There are a lot of netperf options, in general, but usually we need only test and CPU.

:~#man netperf
:~# netperf -H server.mydomain.com -c -C
TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to server.mydomain.com (10.253.46.1) port 0 AF_INET : demo
Recv   Send    Send                          Utilization       Service Demand
Socket Socket  Message  Elapsed              Send     Recv     Send    Recv
Size   Size    Size     Time     Throughput  local    remote   local   remote
bytes  bytes   bytes    secs.    10^6bits/s  % S      % S      us/KB   us/KB
 87380  87380  87380    10.09        86.29   8.67     2.37     65.847  18.012