Friday, May 27, 2016

Postfix configuration


Requirements:


  1. Allow RELAYing for mydomain.com
  2. Allow such relaying ONLY for hosts in the local network

Setup:

/etc/postfix/main.cf


inet_interfaces = all

 mynetworks = 10.0.0.0/16  (local network IP)

smtpd_recipient_restrictions =
        permit_sasl_authenticated
        check_recipient_access hash:/etc/postfix/recipient_access
        reject_unauth_destination

/etc/postfix/recipient_access:

mydomain.com   OK

sudo postmap /etc/postfix/recipient_access
sudo service postmap restart






Sunday, March 27, 2016

kswapd0 high cpu consumption


OS: Ubuntu 15.10
Linux Kernel: 4.2.0-25-generic

Running MongoDB gets the CPU consumption high, with the culprit being kswapd0 process

Fix: 

add this to /etc/rc.local:
echo madvise > /sys/kernel/mm/transparent_hugepage/enabled

As per this URL: https://www.reddit.com/r/chrubuntu/comments/3ru04q/help_kernel_process_kswapd0_randomly_consuming/


The next attempt:

echo 3 > /proc/sys/vm/drop_caches

One more attempt:

worked around by commenting out line 2 in /lib/udev/rules.d/40-vm-hotadd.rules.

And the last attempt really worked:

Just updated to the last kernel update on ubuntu 15.10 :-)