LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   OpenVPN server on Ubuntu 18.04 and Odroid H3 (https://www.linuxquestions.org/questions/linux-server-73/openvpn-server-on-ubuntu-18-04-and-odroid-h3-4175659455/)

bomberb17 08-20-2019 04:53 AM

OpenVPN server on Ubuntu 18.04 and Odroid H3
 
Hello,
I'm running an openvpn server on Ubuntu 18.04 and ODROID H3 which has a 16GB SD card.
I want to minimize wear on the SD so I want to keep disk writes as low as possible.
Using iotop I found that openvpn makes freqent disk writes (for logging?)

Code:

Total DISK READ :      0.00 B/s | Total DISK WRITE :      0.00 B/s
Actual DISK READ:      0.00 B/s | Actual DISK WRITE:      0.00 B/s
  PID  PRIO  USER    DISK READ  DISK WRITE  SWAPIN    IO>    COMMAND
 1269 be/4 root          0.00 B    20.00 K  0.00 %  0.00 % [flush-179:0]
 1850 be/4 nobody        0.00 B    200.00 K  0.00 %  0.00 % openvpn --daemon ovpn-server --status /run/openvpn/server.status 10 --cd /etc/openvpn --script-security 2 --config /etc/openvpn/server.conf --writepid /run/openvpn/server.pid

Can someone tell what these writes are about and suggest how to minimize these disk writes?
Thank you

Skaperen 08-20-2019 05:19 PM

OpenVPN is normally quiet. maybe you should have a look at those logs to see what is going on.

berndbausch 08-20-2019 07:58 PM

/proc/PID/fdinfo contains information about each file descriptor, including the current position. To find out which file OpenVPN writes to, try checking which file descriptor's position changes most often. You could then either reconfigure OpenVPN so that it does not perform those writes, or move that file to a RAM-based /tmp or so.

I am sure that lsof is also a great tool for this, but I can't tell you the required command-line options.

bomberb17 08-21-2019 09:13 AM

Quote:

Originally Posted by Skaperen (Post 6027512)
OpenVPN is normally quiet. maybe you should have a look at those logs to see what is going on.

I checked /var/log/syslog and /var/log/syslog.1 , there are only a few logs regarding a couple of connections I did myself. These are not consistent with these persistent disk writes... (31M disk writes so far since yesterday)

Quote:

Originally Posted by berndbausch (Post 6027552)
/proc/PID/fdinfo contains information about each file descriptor, including the current position. To find out which file OpenVPN writes to, try checking which file descriptor's position changes most often. You could then either reconfigure OpenVPN so that it does not perform those writes, or move that file to a RAM-based /tmp or so.

I am sure that lsof is also a great tool for this, but I can't tell you the required command-line options.

Ok but I'm not sure how to reconfigure openvpn to write to RAM or omit these writes entirely..

berndbausch 08-21-2019 10:30 AM

Quote:

Originally Posted by bomberb17 (Post 6027768)
Ok but I'm not sure how to reconfigure openvpn to write to RAM or omit these writes entirely..

Often, /tmp and other directories that contain data that need not be persistent are implemented as RAM filesystems, usually tmpfs. My Odroid has such a /tmp; I'd recommend it for SD-card-based servers.

You may be able to configure OpenVPN so that the file in question resides on a RAM filesystem.


All times are GMT -5. The time now is 12:31 PM.