From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: yahns-public@yhbt.net Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 54FF56338BD for ; Tue, 21 Jul 2015 21:39:13 +0000 (UTC) From: Eric Wong To: yahns-public@yhbt.net Subject: [PATCH] test_client_expire: favor Process.spawn over fork+exec Date: Tue, 21 Jul 2015 21:39:13 +0000 Message-Id: <1437514753-884-1-git-send-email-e@80x24.org> List-Id: Process.spawn is faster under Linux since it may use vfork to avoid marking pages copy-on-write. --- test/test_client_expire.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/test_client_expire.rb b/test/test_client_expire.rb index 4f20803..c23a727 100644 --- a/test/test_client_expire.rb +++ b/test/test_client_expire.rb @@ -125,9 +125,8 @@ class TestClientExpire < Testcase opts = { out: "/dev/null", err: "/dev/null", close_others: true } begin pids = 2.times.map do - fork do - exec(*%W(ab -c #{nr} -n 9999999 -v1 -k http://#{host}:#{port}/), opts) - end + Process.spawn(*%W(ab -c #{nr} -n 9999999 -v1 -k + http://#{host}:#{port}/), opts) end re1 = %r{consider raising open file limits} -- EW