From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id E6126203C1; Thu, 14 Jul 2016 23:11:23 +0000 (UTC) Date: Thu, 14 Jul 2016 23:11:23 +0000 From: Eric Wong To: Antonio Terceiro , 830353@bugs.debian.org Cc: Lucas Nussbaum , kgio-public@bogomips.org Subject: Re: Bug#830353: ruby-kgio: FTBFS: ERROR: Test "ruby2.3" failed. Message-ID: <20160714231123.GA11770@whir> References: <20160708092805.GA27159@xanadu.blop.info> <20160708185329.GA29627@dcvr.yhbt.net> <20160714215356.GA20096@debian.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160714215356.GA20096@debian.org> List-Id: Antonio Terceiro wrote: > On Fri, Jul 08, 2016 at 06:53:29PM +0000, Eric Wong wrote: > > Thanks for the report. Can you try the patch below? > > Didn't help. > > I can't, however, reproduce this locally on my workstation. Thanks for following up. > > I'd be interested to know what non-standard sysctl knobs are set > > for kernel socket buffer sizes (in /proc/sys/net/{core,ipv4}/*mem*) > ==> /proc/sys/net/ipv4/tcp_rmem <== > 4096 12582912 16777216 > > ==> /proc/sys/net/ipv4/tcp_wmem <== > 4096 12582912 16777216 Yikes at the gigantic default (middle) values. Anyways, I've set those locally and notice the problem with my previous patch: I missed some spots where temporary strings/arrays were created inside the tests themselves. > In Debian we don't even have 2.2 anymore. The only things using kgio are > unicorn and rainbows. Maybe if their dependency on kgio could be skipped on > Ruby 2.3, we could drop kgio from Debian. Yes, I still have to check and make sure I don't introduce performance regressions and such when dropping kgio. I still need to support Ruby 1.9.3 and 2.0.0 outside of Debian (or on wheezy LTS/jessie) The following ought to work (I tested locally with those sysctl values) but I'll see about making the tests more robust against larger kernel buffers. -------8<-------- --- a/test/lib_read_write.rb +++ b/test/lib_read_write.rb @@ -7,7 +7,12 @@ $-w = true require 'kgio' module LibReadWriteTest - RANDOM_BLOB = File.open("/dev/urandom") { |fp| fp.read(10 * 1024 * 1024) } + RANDOM_BLOB = File.open("/dev/urandom") do |fp| + nr = 31 + buf = fp.read(nr) + # get roughly a 20MB block of random data + (buf * (20 * 1024 * 1024 / nr)) + (buf * rand(123)) + end def teardown @rd.close if defined?(@rd) && ! @rd.closed? @@ -369,7 +374,7 @@ module LibReadWriteTest @nr += 1 IO.select(nil, [self]) end - buf = "." * 1024 * 1024 * 10 + buf = RANDOM_BLOB thr = Thread.new { @wr.kgio_write(buf) } Thread.pass until thr.stop? readed = @rd.read(buf.size) @@ -385,7 +390,7 @@ module LibReadWriteTest @nr += 1 IO.select(nil, [self]) end - buf = ["." * 1024] * 1024 * 10 + buf = [ RANDOM_BLOB, RANDOM_BLOB ] buf_size = buf.inject(0){|c, s| c + s.size} thr = Thread.new { @wr.kgio_writev(buf) } Thread.pass until thr.stop? -- EW