Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86599 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53006 invoked from network); 11 Jun 2015 12:27:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jun 2015 12:27:34 -0000 Authentication-Results: pb1.pair.com header.from=kluev.andrew@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=kluev.andrew@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.65 as permitted sender) X-PHP-List-Original-Sender: kluev.andrew@gmail.com X-Host-Fingerprint: 209.85.215.65 mail-la0-f65.google.com Received: from [209.85.215.65] ([209.85.215.65:35198] helo=mail-la0-f65.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5D/C2-35910-4BE79755 for ; Thu, 11 Jun 2015 08:27:33 -0400 Received: by lams18 with SMTP id s18so832709lam.2 for ; Thu, 11 Jun 2015 05:27:29 -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 :content-type; bh=YmVOpGD2HMLNUF5amiWhHIMU8rX/6qhLUFLo8xtWzlY=; b=bXHdaxw7JKva9Hfx6hUnAHwUJSTiSAd5CX38T6tVarL3Ju0/WizDghBTQ3v9XIqGyg GLI8QfkS6/rAIKCs1LzcepRKTd7ez2S82HiEkO9Q9wkPKD3y8KfD6CugM/Ti6CJBygkL vgzETHRWIsnZNExMqbIknMO6grPtV4AWKPB60rbxjiko0oy0yXCim5Boty2pddvVyaCq 4Ule7fDAIFbXcprsEO/aRvkxmDndwiUZLaPENM3AQBwADR7Vjn3AZI3yRVDkiKhHR0Ih DtassX1kWmSiiFgXXzVMx/HmRcdb4wezAa4qbfXrTdvs3Z0uU8z87abYm0UGLXIU30bX NF4A== MIME-Version: 1.0 X-Received: by 10.152.23.167 with SMTP id n7mr9678503laf.108.1434025649452; Thu, 11 Jun 2015 05:27:29 -0700 (PDT) Received: by 10.114.184.81 with HTTP; Thu, 11 Jun 2015 05:27:29 -0700 (PDT) In-Reply-To: <1434024606.23759.2.camel@kuechenschabe> References: <1434022957.18853.14.camel@kuechenschabe> <1434024606.23759.2.camel@kuechenschabe> Date: Thu, 11 Jun 2015 15:27:29 +0300 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=089e0160a5e66f3d1705183d1de7 Subject: Re: [PHP-DEV] Some strange bug From: kluev.andrew@gmail.com (Andrew Kluev) --089e0160a5e66f3d1705183d1de7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Wow! Now I understand. Thank you for the explanation 2015-06-11 15:10 GMT+03:00 Johannes Schl=C3=BCter : > As said: It looks at CPU time. sleep doesn't require CPU time. Try with > something like while(true){} which keeps PHP on CPU > > > $ cat test.php > echo 'php_sapi_name: '.php_sapi_name().PHP_EOL; > echo 'max_input_time: '.ini_get('max_input_time').PHP_EOL; > echo 'max_execution_time: '.ini_get('max_execution_time').PHP_EOL; > > set_time_limit(2); > > echo 'max_input_time: '.ini_get('max_input_time').PHP_EOL; > echo 'max_execution_time: '.ini_get('max_execution_time').PHP_EOL; > > while (true) {} > > echo 'how it works?'.PHP_EOL; > > $ ./sapi/cli/php -v > PHP 7.0.0-dev (cli) (built: Jun 11 2015 14:04:07) (DEBUG) > Copyright (c) 1997-2015 The PHP Group > Zend Engine v3.0.0-dev, Copyright (c) 1998-2015 Zend Technologies > > $ time ./sapi/cli/php test.php > php_sapi_name: cli > max_input_time: -1 > max_execution_time: 0 > max_input_time: -1 > max_execution_time: 2 > > Fatal error: Maximum execution time of 2 seconds exceeded in test.php on > line 11 > > real 0m2.062s > user 0m2.005s > sys 0m0.016s > > > On Thu, 2015-06-11 at 14:55 +0300, Andrew Kluev wrote: > > It is very informative, but not resolve the problem, php completely > > ignored my max_execution_teme setup with any SAPI, in all cases > > > > > > 2015-06-11 14:42 GMT+03:00 Johannes Schl=C3=BCter : > > On Thu, 2015-06-11 at 14:25 +0300, Andrew Kluev wrote: > > > sleep(3); > > [...] > > > This is a bug or something I do not know about php? > > > > Max execution time is working a bit dependent on the operating > > system. > > On Windows it is using the elapsed time ("wall clock time") on > > Linux > > systems the CPU time. Thus on windows the sleep counts whereas > > on Linux > > no time is spent during sleep(). The same difference happens > > when other > > processes are on CPU and your PHP script was taken off CPU for > > other > > reasons. > > > > For details see MSDN on CreateTimerQueueTimer for Windows and > > the > > setitimer man page with (ITIMER_PROF option) for Linux/Unix > > for a start. > > > > > https://msdn.microsoft.com/en-us/library/windows/desktop/ms682485% > > 28v=3Dvs.85%29.aspx > > http://linux.die.net/man/2/setitimer > > > > > > johannes > > > > > > > > > --089e0160a5e66f3d1705183d1de7--