songgao / water

A simple TUN/TAP library written in native Go.
BSD 3-Clause "New" or "Revised" License
1.94k stars 294 forks source link

low performance of tap device on windows #49

Open snail007 opened 6 years ago

snail007 commented 6 years ago

I tried water on windos,use tap device process some IP packet traffic, such as : using mysql GUI client connect to local mysql server through tap device's IP,when opening table (less data),it is very slow , but without tap, it is very fast, i chehcked the go pprof ,find out that 99% CPU time is used by io.Copy. Looking forward to your suggestion!

lixin9311 commented 6 years ago

Thank you for report this issue. If it is possible, can you provide the minimal code to reproduce the issue?

snail007 commented 6 years ago

Thanks for your reply, attachment (sample.zip) is my go code and go pprof file. My Environment : System : windows7 64bit TAP driver : https://build.openvpn.net/downloads/releases/tap-windows-9.22.1-I602.exe Go version : 1.10.3 Localhost : MySQL Server MySQL GUI Client : navicat

Constantly opening a new table in navicat will reveal a slow response.

Looking forward to your reply.

sample.zip

weiyixuan commented 5 years ago

You can change the TAP driver:https://build.openvpn.net/downloads/releases/tap-windows-9.9.2_3.exe For win7,the new drivers will cause low performance.