Re: RELENG_10 performance regression (was Re: 35-40% performance drop releng9 vs releng10 openvpn
On Fri, Mar 20, 2015 at 04:53:42PM -0700, Xin Li wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 03/20/15 14:02, Mike Tancsa wrote: OK, I think I found where the RELENG_10 performance loss happened. It seems https://lists.freebsd.org/pipermail/svn-src-stable-10/2015-March/004778.html is the issue. Testing with a kernel from r279796 I get 76-77Mb of throughput. With r279848 it drops to about 60Mb Hrm, looking at 'diffgraph.svg', it suggest that writing through devfs have incurred a tax on writev(2), which is basically this codepath, if my reading is correct, in sys/fs/devfs/devfs.c: 1676 static int 1677 devfs_write_f(struct file *fp, struct uio *uio, struct ucred *cred, 1678 int flags, struct thread *td) 1679 { ... 1703 if (uio-uio_resid != resid || (error == 0 resid != 0)) { 1704 vfs_timestamp(dev-si_ctime); 1705 dev-si_mtime = dev-si_ctime; 1706 } Further looking at the code, in devfs vfs_timestamp() is also called when reading from a device node. When the setting was 0, the code would return time_second directly instead of attempting to read the timestamp. For the purpose of devfs, does it make sense to bump timestamps like normal filesystems for each read/write operation? Looks like Mac OS X will bump timestamps for each operation but Debian don't. First question is, what timecounter hardware is used. I would accept some slowdown from hardware like HPET, but it is indeed surprising if caused by TSC. ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org
Re: RELENG_10 performance regression (was Re: 35-40% performance drop releng9 vs releng10 openvpn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 03/20/15 17:15, Konstantin Belousov wrote: For the purpose of devfs, does it make sense to bump timestamps like normal filesystems for each read/write operation? Looks like Mac OS X will bump timestamps for each operation but Debian don't. First question is, what timecounter hardware is used. I would accept some slowdown from hardware like HPET, but it is indeed surprising if caused by TSC. It was HPET (see earlier discussion where a FlameGraph is posted). I've done a survey on a few other operating systems, including OpenIndiana, Debian and OS X. Neither OpenIndiana nor Debian update timestamp for read/write events so I'd propose this change to make it a runtime configurable behavior and disable by default: https://reviews.freebsd.org/D2104 Cheers, - -- Xin LI delp...@delphij.nethttps://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -BEGIN PGP SIGNATURE- Version: GnuPG v2.1.2 (FreeBSD) iQIcBAEBCgAGBQJVDLscAAoJEJW2GBstM+nsGtMQAKyh3kW6VWPnCd353KELqeoE 3n295iHqVjAF6vszt71cfiAqlz0oSH+5i2SfR1LKVXH4cb2gMbXYbMeJVQiV7L93 8xEsBNtPF4Z/fxwyEBfFb3WcXHo+TGjvaCEbsuJIFKhqa4GPY230/7JELN/LXuNd HJlP7YECNPgeVWyYuCdZkLu/BMOPjL44/wcC/YuXSQP65TK54kx59KLg671o9Z2R ffpljAmJSqpNjas41qyVN+SNxr9ga8oQA0LTf8lbn3r4o2mx+te8yzNcyIn/gCU8 jawDGfGNiEvCTr76ST6rvELy4jFbmZyNFrbu+TA6VDT2/CCh1x5qhDceXTnZKPtX iJFpDKsl87R5aXdRQjwCZKkTdaJ7AuRAG0lrmumxIlblgDmaDsVbmaqR1CU0JzWI rvGblL6iwm/4pL+O9Igkr6oN6+yd1/9KM2yCB5BZDokLnoj6INWOft4z6jGyOUWh T3oNVfB48g/j5NKRyU/vFvJIUix2mbE5ziem+RyLU6x/UOdYQJsKRIlN6xPiIx73 /G7kpT1JbsoS47fyere5jeUV2UOurRuH5UfBHjJCJ0X44tzrsMhTm3Vs2cOzJP7K 6SNbyxyCbX3uJN1Aq9nhg2scIVieV1/BRLoeI6LEVVZKTTig4LA8ekzb0P6e1Fwg f9rvXNwpdeZPmsDwdpff =Uxnt -END PGP SIGNATURE- ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org
Re: RELENG_10 performance regression (was Re: 35-40% performance drop releng9 vs releng10 openvpn
Mike Tancsa wrote on 03/20/2015 22:02: OK, I think I found where the RELENG_10 performance loss happened. It seems https://lists.freebsd.org/pipermail/svn-src-stable-10/2015-March/004778.html is the issue. Testing with a kernel from r279796 I get 76-77Mb of throughput. With r279848 it drops to about 60Mb I am surprised by this huge performance drop. If it is really caused by this change (VFS timestamp precision from seconds to microseconds), wasn't this change tested before commit? Miroslav Lachman ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org
Re: RELENG_10 performance regression (was Re: 35-40% performance drop releng9 vs releng10 openvpn
On 3/20/2015 8:15 PM, Konstantin Belousov wrote: For the purpose of devfs, does it make sense to bump timestamps like normal filesystems for each read/write operation? Looks like Mac OS X will bump timestamps for each operation but Debian don't. First question is, what timecounter hardware is used. I would accept some slowdown from hardware like HPET, but it is indeed surprising if caused by TSC. David Wolfskill suggested trying the problem commit with vfs.timestamp_precision=0 and it does indeed restore performance to what it was. The raw dtrace files are available and FlameGraphs can all be found at http://tancsa.com/time/ ---Mike -- --- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, m...@sentex.net Providing Internet services since 1994 www.sentex.net Cambridge, Ontario Canada http://www.tancsa.com/ ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org
rctl logs swapuse even if swap is empty
I tried RCTL for the first time, so maybe it is error on my side. I have system with 2 jail with the following rctl.conf jail:fox:swapuse:log=32M jail:fox:swapuse:deny=512M jail:fox:memoryuse:log=3G jail:fox:memoryuse:deny=4096M jail:olymp:swapuse:log=32M jail:olymp:swapuse:deny=512M jail:olymp:memoryuse:log=2G jail:olymp:memoryuse:deny=3072M Both jails are small webservers with PHP + Apache. They do not use much memory and they really do not user any swap space. (according to top and swapinfo) # swapinfo -h Device 1K-blocks UsedAvail Capacity /dev/mirror/gm0s1b 16777216 0B 16G 0% # rctl -hu jail:fox | grep swap swapuse=0 Processes in both jails are logged as using more than 32MB of swap: Mar 21 01:18:55 neon kernel: rctl: rule jail:fox:swapuse:log=33554432 matched by pid 20783 (httpd), uid 80, jail fox Mar 21 01:18:55 neon kernel: rctl: rule jail:fox:swapuse:log=33554432 matched by pid 20787 (httpd), uid 80, jail fox Mar 21 01:18:58 neon kernel: rctl: rule jail:fox:swapuse:log=33554432 matched by pid 19207 (httpd), uid 80, jail fox Mar 21 01:18:58 neon kernel: rctl: rule jail:fox:swapuse:log=33554432 matched by pid 20790 (sh), uid 0, jail fox Mar 21 01:18:58 neon kernel: rctl: rule jail:fox:swapuse:log=33554432 matched by pid 20792 (sh), uid 0, jail fox Mar 21 01:18:58 neon kernel: rctl: rule jail:olymp:swapuse:log=33554432 matched by pid 20793 (sh), uid 0, jail olymp Mar 21 01:18:58 neon kernel: rctl: rule jail:olymp:swapuse:log=33554432 matched by pid 20795 (sh), uid 0, jail olymp Is it expected? I do not think so. Or am I doing something wrong with rctl? # uname -srmi FreeBSD 10.1-RELEASE-p8 amd64 GEN_RCTL Kernel is GENERIC + RCTL options Miroslav Lachman ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org
Re: RELENG_10 performance regression (was Re: 35-40% performance drop releng9 vs releng10 openvpn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 03/20/15 14:02, Mike Tancsa wrote: OK, I think I found where the RELENG_10 performance loss happened. It seems https://lists.freebsd.org/pipermail/svn-src-stable-10/2015-March/004778.html is the issue. Testing with a kernel from r279796 I get 76-77Mb of throughput. With r279848 it drops to about 60Mb Hrm, looking at 'diffgraph.svg', it suggest that writing through devfs have incurred a tax on writev(2), which is basically this codepath, if my reading is correct, in sys/fs/devfs/devfs.c: 1676 static int 1677 devfs_write_f(struct file *fp, struct uio *uio, struct ucred *cred, 1678 int flags, struct thread *td) 1679 { ... 1703 if (uio-uio_resid != resid || (error == 0 resid != 0)) { 1704 vfs_timestamp(dev-si_ctime); 1705 dev-si_mtime = dev-si_ctime; 1706 } Further looking at the code, in devfs vfs_timestamp() is also called when reading from a device node. When the setting was 0, the code would return time_second directly instead of attempting to read the timestamp. For the purpose of devfs, does it make sense to bump timestamps like normal filesystems for each read/write operation? Looks like Mac OS X will bump timestamps for each operation but Debian don't. Cheers, ---Mike On 3/20/2015 1:36 PM, Mike Tancsa wrote: OK, just to refocus, I had been tracking down what I thought was a regression between RELENG9 and RELENG10, but looks more like an issue that cropped up somewhere between the beginning of March and now. For RELENG9, I was actually using a kernel from sources back on Jan 29th by accident. If I bring RELENG9 upto today, I get a similar performance loss. Again, I am testing a simple VPN router setup server1 --- apu --- server2 where server1 connections to the apu via an OpenVPN tunnel and server1 sends packets via netblast across the tunnel to server2. I get the following throughput using netblast through the tunnel on 10 Using # netblast 1.1.2.2 500 1200 15 (server1 to server2) on 10.x KernelMb/s rev r277684 76.7563 r279978 59.3233 All good at r278533, r278534, r279467 But at r279978 its quite a bit slower. So somewhere between r279467 and r279978. I will keep trying to narrow it down... ---Mike On 3/19/2015 8:26 PM, Mike Tancsa wrote: On 3/18/2015 5:14 PM, John-Mark Gurney wrote: # dtrace -x stackframes=100 -n 'profile-997 /arg0/ { @[stack()] = count(); } tick-60s { exit(0); }' -o out.kern_stacks Also, another thing you can do is to compare the two using differential flame graphs: http://www.brendangregg.com/blog/2014-11-09/differential-flame-graphs.html Which will highlight where the performances differ... OK, some more data points. It seems a performance regression happened in RELENG_10 somewhere between r277684 (late January 2015) and now. Using r277684 on RELENG_10, I can get about 75Mb/s of throughput on OpenVPN. Still not as good as the 83-85Mb on RELENG_9, but much better than the 61Mb using RELENG_10 from the start of this week, For the differential graph, see http://tancsa.com/diffgraph.svg and http://tancsa.com/10-r277684.svg http://tancsa.com/10-r277684-kern.svg ---Mike - -- Xin LI delp...@delphij.nethttps://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -BEGIN PGP SIGNATURE- Version: GnuPG v2.1.2 (FreeBSD) iQIcBAEBCgAGBQJVDLMDAAoJEJW2GBstM+nsmjgQAKGNdw70A2lfrVn8ngLympDM HeJKVCRtjaZselJpVnkyy8igBU6TX0Ae66R4IPNBpi9aLcGb/xscDgYKNh2dZc4H LjfyiXW62JwggXt+PCUjrLF3sbrlCI8ySTNLnILTs/CRFwdJXALFHWXDEtuMg+AT Mto3HxKlRZlEbWHaKbWmR4uysks6KNYJXSCnw/VtSFvlVUSwpyNz+soygrajZPKC PPOpjDqx2rvVxQwFaHF+ysTzKhvQSuJg+C5M9iKu4wgHd5QNuJ8IliAocVvPig9u gushcc2MxGPyzG24Telc3Vc5T+pbCexiP3hRtFY0/okADG4O47tuoJOY09gp28Tq 5X3eXCXkBGfCtriv6aPf//jAQ6duDrGTDmYcI+FGIDp3/FG71adNTqZ6fcqFAL/+ JHO39qpytOruVVjFyjEvQBslYEKWUZJBGZ82q6kuE+811TZxdMGVLh3PICxiJw0l SJcTR52UEYNp1kX+KhFXpz6cvV0Za5bJh/qHnC/1uzHvLYE7MDTinwDPb7LyK01G fg+Kls6YCAv6rh4mDzWJCg8aTaWmbtfn2+ETwx74if6Z8LjTB1VdmZ4y336YRY2f mFhV6eYAvvziIIMUvTQjAwyIcCtc65dvseOpgDdnWPFq/N+K4Jfg9Ast6mSHBYF2 FjvUzNg8OYvyfq5/TdPB =djPp -END PGP SIGNATURE- ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org
Re: dtrace on RELENG9 possible ?
On 3/20/2015 12:49 AM, Mark Johnston wrote: This is releng9 from today after a fresh buildworld/kernel I'm not quite sure what you mean by releng9. Is it 9.0? 9.3? Does your kernel configuration file contain options KDTRACE_HOOKS? Hi, By RELENG9, I mean checkout svn://svn.freebsd.org/base/stable/9 I am using a stock GENERIC kernel which seems to have those options. I am building RELENG_9 on a RELENG8 machine, I wonder if this has something to do with it, but I use the same machine to build RELENG_10 images and dtrace works fine on it. options KDTRACE_FRAME # Ensure frames are compiled in options KDTRACE_HOOKS # Kernel DTrace hooks options INCLUDE_CONFIG_FILE # Include this file in kernel options KDB # Kernel debugger related code options KDB_TRACE # Print a stack trace for a panic options DDB_CTF # kernel ELF linker loads CTF data -- --- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, m...@sentex.net Providing Internet services since 1994 www.sentex.net Cambridge, Ontario Canada http://www.tancsa.com/ ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org
Re: RELENG_10 performance regression (was Re: 35-40% performance drop releng9 vs releng10 openvpn
OK, I think I found where the RELENG_10 performance loss happened. It seems https://lists.freebsd.org/pipermail/svn-src-stable-10/2015-March/004778.html is the issue. Testing with a kernel from r279796 I get 76-77Mb of throughput. With r279848 it drops to about 60Mb ---Mike On 3/20/2015 1:36 PM, Mike Tancsa wrote: OK, just to refocus, I had been tracking down what I thought was a regression between RELENG9 and RELENG10, but looks more like an issue that cropped up somewhere between the beginning of March and now. For RELENG9, I was actually using a kernel from sources back on Jan 29th by accident. If I bring RELENG9 upto today, I get a similar performance loss. Again, I am testing a simple VPN router setup server1 --- apu --- server2 where server1 connections to the apu via an OpenVPN tunnel and server1 sends packets via netblast across the tunnel to server2. I get the following throughput using netblast through the tunnel on 10 Using # netblast 1.1.2.2 500 1200 15 (server1 to server2) on 10.x KernelMb/s rev r277684 76.7563 r279978 59.3233 All good at r278533, r278534, r279467 But at r279978 its quite a bit slower. So somewhere between r279467 and r279978. I will keep trying to narrow it down... ---Mike On 3/19/2015 8:26 PM, Mike Tancsa wrote: On 3/18/2015 5:14 PM, John-Mark Gurney wrote: # dtrace -x stackframes=100 -n 'profile-997 /arg0/ { @[stack()] = count(); } tick-60s { exit(0); }' -o out.kern_stacks Also, another thing you can do is to compare the two using differential flame graphs: http://www.brendangregg.com/blog/2014-11-09/differential-flame-graphs.html Which will highlight where the performances differ... OK, some more data points. It seems a performance regression happened in RELENG_10 somewhere between r277684 (late January 2015) and now. Using r277684 on RELENG_10, I can get about 75Mb/s of throughput on OpenVPN. Still not as good as the 83-85Mb on RELENG_9, but much better than the 61Mb using RELENG_10 from the start of this week, For the differential graph, see http://tancsa.com/diffgraph.svg and http://tancsa.com/10-r277684.svg http://tancsa.com/10-r277684-kern.svg ---Mike -- --- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, m...@sentex.net Providing Internet services since 1994 www.sentex.net Cambridge, Ontario Canada http://www.tancsa.com/ ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org
Re: rc.conf: select fib for dhclient
Hi, On Fri, 20 Mar 2015 11:31:32 +1100 Brendan Inglese brendan.ingl...@gmail.com said: brendan I want to select a particular fib for dhclient to use in rc.conf. I want it brendan to create a whole new routing table brendan If I do: brendan ifconfig_if1=DHCP fib 1 brendan It will run dhclient but not create a default route in the second table. brendan If I pop: brendan setfib 1 dhclient if1 brendan Into rc.local, on reboot it does exactly what I want it to do. Perhaps, following works for you: ifconfig_if1=DHCP dhclient_fib=1 Sincerely, -- Hajimu UMEMOTO u...@mahoroba.org ume@{,jp.}FreeBSD.org http://www.mahoroba.org/~ume/ ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org
RELENG_10 performance regression (was Re: 35-40% performance drop releng9 vs releng10 openvpn
OK, just to refocus, I had been tracking down what I thought was a regression between RELENG9 and RELENG10, but looks more like an issue that cropped up somewhere between the beginning of March and now. For RELENG9, I was actually using a kernel from sources back on Jan 29th by accident. If I bring RELENG9 upto today, I get a similar performance loss. Again, I am testing a simple VPN router setup server1 --- apu --- server2 where server1 connections to the apu via an OpenVPN tunnel and server1 sends packets via netblast across the tunnel to server2. I get the following throughput using netblast through the tunnel on 10 Using # netblast 1.1.2.2 500 1200 15 (server1 to server2) on 10.x KernelMb/s rev r277684 76.7563 r279978 59.3233 All good at r278533, r278534, r279467 But at r279978 its quite a bit slower. So somewhere between r279467 and r279978. I will keep trying to narrow it down... ---Mike On 3/19/2015 8:26 PM, Mike Tancsa wrote: On 3/18/2015 5:14 PM, John-Mark Gurney wrote: # dtrace -x stackframes=100 -n 'profile-997 /arg0/ { @[stack()] = count(); } tick-60s { exit(0); }' -o out.kern_stacks Also, another thing you can do is to compare the two using differential flame graphs: http://www.brendangregg.com/blog/2014-11-09/differential-flame-graphs.html Which will highlight where the performances differ... OK, some more data points. It seems a performance regression happened in RELENG_10 somewhere between r277684 (late January 2015) and now. Using r277684 on RELENG_10, I can get about 75Mb/s of throughput on OpenVPN. Still not as good as the 83-85Mb on RELENG_9, but much better than the 61Mb using RELENG_10 from the start of this week, For the differential graph, see http://tancsa.com/diffgraph.svg and http://tancsa.com/10-r277684.svg http://tancsa.com/10-r277684-kern.svg ---Mike -- --- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, m...@sentex.net Providing Internet services since 1994 www.sentex.net Cambridge, Ontario Canada http://www.tancsa.com/ ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org
Re: rc.conf: select fib for dhclient
Hi, I've tried that actually and it seemed to run dhclient on fib 1 for all interfaces. I gave up on the fib option I've recently just found a solution using pf. Cheers, Brendan. On Sat, Mar 21, 2015 at 5:23 AM, Hajimu UMEMOTO u...@freebsd.org wrote: Hi, On Fri, 20 Mar 2015 11:31:32 +1100 Brendan Inglese brendan.ingl...@gmail.com said: brendan I want to select a particular fib for dhclient to use in rc.conf. I want it brendan to create a whole new routing table brendan If I do: brendan ifconfig_if1=DHCP fib 1 brendan It will run dhclient but not create a default route in the second table. brendan If I pop: brendan setfib 1 dhclient if1 brendan Into rc.local, on reboot it does exactly what I want it to do. Perhaps, following works for you: ifconfig_if1=DHCP dhclient_fib=1 Sincerely, -- Hajimu UMEMOTO u...@mahoroba.org ume@{,jp.}FreeBSD.org http://www.mahoroba.org/~ume/ ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org
Re: rc.conf: select fib for dhclient
I do this: ifconfig_em0=SYNCDHCP fib 0 ifconfig_ix0=SYNCDHCP fib 1 -Alan On Fri, Mar 20, 2015 at 2:30 PM, Brendan Inglese brendan.ingl...@gmail.com wrote: Hi, I've tried that actually and it seemed to run dhclient on fib 1 for all interfaces. I gave up on the fib option I've recently just found a solution using pf. Cheers, Brendan. On Sat, Mar 21, 2015 at 5:23 AM, Hajimu UMEMOTO u...@freebsd.org wrote: Hi, On Fri, 20 Mar 2015 11:31:32 +1100 Brendan Inglese brendan.ingl...@gmail.com said: brendan I want to select a particular fib for dhclient to use in rc.conf. I want it brendan to create a whole new routing table brendan If I do: brendan ifconfig_if1=DHCP fib 1 brendan It will run dhclient but not create a default route in the second table. brendan If I pop: brendan setfib 1 dhclient if1 brendan Into rc.local, on reboot it does exactly what I want it to do. Perhaps, following works for you: ifconfig_if1=DHCP dhclient_fib=1 Sincerely, -- Hajimu UMEMOTO u...@mahoroba.org ume@{,jp.}FreeBSD.org http://www.mahoroba.org/~ume/ ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org