Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77207 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5911 invoked from network); 15 Sep 2014 03:59:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Sep 2014 03:59:20 -0000 Authentication-Results: pb1.pair.com header.from=themattficken@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=themattficken@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.175 as permitted sender) X-PHP-List-Original-Sender: themattficken@gmail.com X-Host-Fingerprint: 209.85.216.175 mail-qc0-f175.google.com Received: from [209.85.216.175] ([209.85.216.175:60024] helo=mail-qc0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 60/25-64534-71466145 for ; Sun, 14 Sep 2014 23:59:19 -0400 Received: by mail-qc0-f175.google.com with SMTP id w7so2156006qcr.6 for ; Sun, 14 Sep 2014 20:59:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=zYykMBKMMs1ZP+hqMUsbUhnpul154F74c9TlfPE5KWw=; b=Q4xb8aaytrS4Fp7NSRc+UP1XGCcS1HomdW2Gpo1KLwRENjxgikB2/mH9rXe+6fsoJF 3Gp7AkwfvmVwGbZ4q0FS8u+wPkVMrz8JFyUJdUyupJjT0Hf46Yannqre4/OQCw0Vg+Rk Mr0exiNOdW9SOV+NGzgLytKwPmrwsGv85A72fh7ZP4yRQb5zVfB0wpEb50S+gO+MRMav UWjoLPawXmJPVbdmUWCWbPpxl0FArhqocGMc25D4RmDeF8QP/zCBku0MPf5FMzX/L8bI 8L7zlyYj5zf97gUJ1D9xFSaL/KBktutpn9vrOGtJgjpfgI6IqvxAiRqoqTe18xdmoURa 2V0g== MIME-Version: 1.0 X-Received: by 10.224.161.11 with SMTP id p11mr29490511qax.40.1410753556633; Sun, 14 Sep 2014 20:59:16 -0700 (PDT) Received: by 10.140.201.74 with HTTP; Sun, 14 Sep 2014 20:59:16 -0700 (PDT) In-Reply-To: <541029AF.6080000@php.net> References: <05091D9021CD48208FCE220DE1CCC3CE@pc07654> <53BD9F71.1090401@sugarcrm.com> <541029AF.6080000@php.net> Date: Sun, 14 Sep 2014 20:59:16 -0700 Message-ID: To: Michael Wallner Cc: Stas Malyshev , Nuno Lopes , "internals@lists.php.net" , Sara Golemon Content-Type: multipart/alternative; boundary=089e0149d2e89be05e050312a80c Subject: Re: [PHP-DEV] Concurrency support for run-tests From: themattficken@gmail.com (Matt Ficken) --089e0149d2e89be05e050312a80c Content-Type: text/plain; charset=UTF-8 When building PFTT, the PHP Full Test Tool, one goal was maximizing speed so that we would be more likely to frequently Fully test PHP (Full-coverage of many scenarios), and to do that I built it to run tests concurrently... Concurrent/parallel execution can cause breaks that otherwise work with normal serial execution, so definitely don't enable concurrency in run-tests by default. run-tests.php's two main benefits are that it supports running the huge library of 15k+pecl PHPTs (compatiblity) and its a lightweight tool so that anyone who just built PHP can run `make test` to test their build (whereas PFTT Is a heavyweight tool). In making/merging major changes (like concurrency) the most important thing is to not break that compatibility and dependability: Your patch will fail without the /proc filesystem(mac osx?). On Windows, you can check the %NUMBER_OF_PROCESSORS% environment variable. For unices that don't have /proc there may not be a single simple way to check. For better performance, PFTT runs a pool of 3 to 4 processes per CPU, when the processes finish quickly, it runs fewer and when they slow down (due to pending IO ops), it runs more processes. See: http://git.php.net/?p=pftt2.git;a=blob;f=src/com/mostc/pftt/scenario/CLIScenario.java;h=30c81aabcb56698eebe4884d915298c92332b50d;hb=refs/heads/master#l61 and for other SAPI scenarios like Apache it runs 2 or 3 processes, see: http://git.php.net/?p=pftt2.git;a=blob;f=src/com/mostc/pftt/scenario/ProductionWebServerScenario.java;h=d509bddda2b3756f05321ddc273600aeb38372be;hb=refs/heads/master For more speed, rather than grouping all, fe open_basedir tests into a single `Concurrency Group` its better to have them all operate in separate temporary directories and database tables (then you could run 32 or 64 openbase dir tests at once). The ext/standard/tests/file and ext/mysql* PHPTs take the longest to run and mostly do IO operations so they benefit the most from maximizing concurrency. For databases, PFTT will create a new database (and for phpunit tests populate the database) for each test runner thread, See: http://git.php.net/?p=pftt2.git;a=blob;f=src/com/mostc/pftt/scenario/MySQLScenario.java;h=f768f58c4494cb2705a571ece22d533bfdc15192;hb=refs/heads/master#l164 On Wed, Sep 10, 2014 at 3:36 AM, Michael Wallner wrote: > On 09/07/14 22:00, Stas Malyshev wrote: > > Hi! > > > >> Having thought a bit about the subject, the heuristic I came up with > was to > >> 1) do not run tests from the same extension in parallel, and 2) do not > run > >> tests from certain extensions in parallel (e.g., mysql and pdo_mysql). > > > > How about making it a whitelist? For tests/extensions we know it's easy > > to paralellize (like ones not having external dependencies/servers/etc) > > simple script could whitelist a lot of them. For those more tricky, we > > could whitelist them gradually. > > > > So how about adding the concurrency switch, but leaving it disabled by > default? > > -- > Regards, > Mike > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --089e0149d2e89be05e050312a80c--