pia-foss / desktop

Private Internet Access - Desktop VPN Client for Windows/macOS/Linux
Other
263 stars 50 forks source link

pia-daemon is too slow to stop #58

Closed TheDcoder closed 8 months ago

TheDcoder commented 1 year ago

Describe the bug

The pia-daemon is taking up a lot of time to stop, on my system it takes more than 15 seconds:

# time systemctl stop piavpn

________________________________________________________
Executed in   16.69 secs      fish           external
   usr time    5.10 millis  908.00 micros    4.19 millis
   sys time    8.12 millis  454.00 micros    7.67 millis

This is very annoying if you have the service running before shutdown, as it hogs up the shutdown until it stops.

To Reproduce

Not sure if it happens to everyone, but it happens to me and I did not do anything special. I only enabled the systemd service.

Expected behavior

It stops sooner.

Observed on:

kp-john-mair commented 10 months ago

Hi, have you tried the beta ? (Settings -> help -> receive beta updates). Let me know if you still experience issues with that one!

TheDcoder commented 10 months ago

@kp-john-mair I can't do that since I'm using Arch Linux and I doubt you have official support for it, also I'm not really the kind of person who uses the built-in updater, I prefer making my own packages.

So are the beta builds publicly downloadable?

TheDcoder commented 10 months ago

I tested with the latest 3.4-beta.1-07585 build and it still takes up a lot of time to stop:

# time systemctl stop piavpn

________________________________________________________
Executed in    6.10 secs      fish           external
   usr time    8.97 millis  135.00 micros    8.84 millis
   sys time   12.47 millis  612.00 micros   11.86 millis

The ~10 seconds reduction is due to me testing on a different PC with a more powerful CPU.

kp-john-mair commented 10 months ago

I can reproduce it, thanks, I’ll add a ticket for it and hopefully we’ll look into it soon!

TheDcoder commented 10 months ago

You don't develop in GitHub?

kp-john-mair commented 10 months ago

@TheDcoder we use jira as our ticketing system rather than github issues ☺️

kp-john-mair commented 8 months ago

Hi, we identified the issue as caused by iptables - it's very slow to remove some of our filters. Interestingly it's only slow on some distros, not others. There's not much we can do about it other than rewrite the firewall rules to use nftables instead (assuming nftables doesn't also have this issue). Closing for now! but thanks for the feedback!