Jump to content

Ubuntu Server 18 related tweek


tdiguy

Recommended Posts

tdiguy

It seems this is a semi common issue on bionic beaver, and one i recently noticed. Seems some people are having issues with dnsmasq using a lot more resources than it should: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1670959

Not really emby related but if you have this problem it might make the server less responsive than normal.

The fix is also listed in that thread but for simplicity i will also quote it right here. I used this on my server and the cpu usage dropped immediately. Course you can see if your having this issue by using top or htop and see what cpu percentage dnsmasq is using.

Looking at the initscript from dnsmasq, there seem to be a few options to disable it for local dns resolving, like the one suggested in https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1670959/comments/32, which I reproduce below:
Added this line to /etc/default/dnsmasq:

    DNSMASQ_EXCEPT=lo

Then restarting dnsmasq:

    sudo systemctl daemon-reload
    sudo systemctl restart dnsmasq

Hope this helps someone :)

Just noticed that this workaround took out my ability to look up dns names For now i put a static entry in resolve.conf, it seems there is a new tool for dns in 18 called netplan. Will have to look up how to use that.

 

Found a better fix at: https://askubuntu.com/questions/157154/how-do-i-include-lines-in-resolv-conf-that-wont-get-lost-on-reboot

by editing the: /etc/resolvconf/resolv.conf.d/head and adding a line of nameserver 127.0.0.53

Now my server idles at 4% with emby running again rather than 33% which it has been since upgrading to 18. Some weird bugs seem to always make their way into updates.

Edited by tdiguy
Link to comment
Share on other sites

  • 4 weeks later...

Ok, I found a solution that worked better for me than the previous one. Seems using ubuntu's own stub process ( or whatever the 27.0.0.53 address is ) is good only if your hosting dns on your own ubuntu box, which i am not. 

I found rather that modifying /etc/resolvconf/resolv.conf.d/head worked far better.

for example my /etc/resolvconf/resolv.conf.d/head looks like:

nameserver 8.8.8.8
nameserver 4.4.2.2
nameserver 27.0.0.53


I  am not 100% sure what the 27.0.0.53 does, so i decided to keep it in there and just put it at the bottom. The name servers here of course are just an example, they are googles name servers feel free to put in whatever ones you normally use.

Then to re-generate the resolveconf file use: sudo resolvconf -u

 

This has made a noticeable difference for me in network performance. I was seeing speeds of 3mbps down and up. I subscribe to 150/5. I now am seeing 140 / 5 and the interface from my client devices seems more responsive, but that might actually just be in my head because i cant imagine emby uses dns much on the local level.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...