Jump to content
Not connected, Your IP: 54.161.98.96
Sign in to follow this  
dagadog

Setting "nice" and "fast-io" - AirVPN connection started as a service

Recommended Posts

Hi



I've added the following directives to my openVPN client configuration file in order to maximise the VPN throughput on my Ubuntu 16.04 based VPN router/gateway.


 

fast-io
nice -20

Starting my VPN with sudo service openvpn restart, initiates the VPN correctly, but the "nice" directive isn't applied. Relavent lines of log are below.






Feb 14 12:30:09 srvbuntu ovpn-airvpn[23065]:   nice = -20
...
Feb 14 12:30:09 srvbuntu ovpn-airvpn[23065]:   fast_io = ENABLED
...
Feb 14 12:30:09 srvbuntu ovpn-airvpn[23067]: WARNING: nice -20 failed: Operation not permitted: Operation not permitted (errno=1)



If I start the VPN from the CLI using "sudo openvpn airvpn.conf" the "nice" directive is implemented:




Tue Feb 14 12:37:25 2017 us=588423 nice -20 succeeded



What is preventing the nice directive from being followed when I start it as a service?

 

Share this post


Link to post

Would it be possible to elaborate? I can elevate it's priority as root, and using the basic AirVPN file the process runs as the root user (can't drop its privileges).

Share this post


Link to post

You have to adjust your permissions in /etc/security/limits.conf

 

See examples here:

https://linux.die.net/man/5/limits.conf

 

Thanks zhang. although your were incorrect, you did point me in the right direction. systemd ignores /etc/security/limits.conf, but you pointed me in the right direction.

 

For systems using systemd, you set capabilities for a service in /usr/lib/systemd/system/openvpn@.service. I achieved what I needed to by adding " CAP_SYS_NICE" to the line beginning "CapabilityBoundingSet="

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image
Sign in to follow this  

×
×
  • Create New...