Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81293 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17368 invoked from network); 28 Jan 2015 09:36:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jan 2015 09:36:50 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.171 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.214.171 mail-ob0-f171.google.com Received: from [209.85.214.171] ([209.85.214.171:58897] helo=mail-ob0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1E/9B-45774-0BDA8C45 for ; Wed, 28 Jan 2015 04:36:48 -0500 Received: by mail-ob0-f171.google.com with SMTP id va2so18257555obc.2 for ; Wed, 28 Jan 2015 01:36:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=rSlk3VjYohXLTaGEtjcZ+kc32nTfUjkP6yCNY4Jzoh4=; b=Gmi52SauVaYHLGuLGhdbvEgPng0ybOdWGlB/l0noYbXTGKumIGj3Q/o4OT5mBNkz8q OwEMB+HXsEyhVQI9YlsTwZPaFzKI9171wx6g1KjbhWaqpnIcAYR+SWtGq22vk9rHCHRN +CCITWb5tQaEJ+II0DKT2NCndzpmLhMGBTchIobMih1R0Tpht+zJiUBzvLn8cZ+URSKq s69gVTBUhQ6wHCpIAS74PZfDFwn/rvSXgMLE3h972DPlME9Rn50Hxg0wvkJYnpo5kTb3 QJmgSFTE/SktxXjJFvuJaITL/a8xSE9yRvJ6zXGXRReGc4XNjaO+SeML9Ot5TKBNVjox rgew== X-Received: by 10.202.63.195 with SMTP id m186mr1338296oia.111.1422437805481; Wed, 28 Jan 2015 01:36:45 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.202.229.9 with HTTP; Wed, 28 Jan 2015 01:36:04 -0800 (PST) In-Reply-To: References: Date: Wed, 28 Jan 2015 18:36:04 +0900 X-Google-Sender-Auth: 8bT6yX1l5nfqHDfAW0tGkFzPKqA Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a113d6f641c7f2d050db31c7b Subject: Re: [PHP-DEV] [VOTE] RFC: Introduce session_start() options - read_only, unsafe_lock, lazy_write and lazy_destroy From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a113d6f641c7f2d050db31c7b Content-Type: text/plain; charset=UTF-8 Hi all, On Mon, Jan 26, 2015 at 6:42 AM, Yasuo Ohgaki wrote: > On Thu, Jan 22, 2015 at 2:05 PM, Yasuo Ohgaki wrote: > >> I've made patch for master since PHP 5.6 is released already. >> >> https://wiki.php.net/rfc/session-lock-ini >> https://github.com/php/php-src/pull/1016 >> >> Except comments, changes are almost minimal, but includes a few bug fixes >> that tests equality of PS(session_status) against "php_session_none". The >> comparison must be "PS(session_status) != php_session_active" as it has >> php_session_disabled. I also removed 2 needless session globals. >> >> Comments are appreciated. >> This patch boosts PHP application performance a lot when session data >> have not changed. It's faster than benchmark in the wiki because hashing >> has removed. >> >> If I don't have any comment in a few days, I'll merge it to master. >> > > I've updated UPGRADING and UPGRADING.INTERNALS and ready to merge. > I'll wait a day more. Please comment on github if you have. > I've tried to get some benchmarks. It seems current system is too fast to get obvious performance difference. Test command: ab -c 7 -n 500000 http://localhost:8888/session.php Test script: 0]); // Change mode here //$_SESSION['test'] = ++$_SESSION['test']; $_SESSION['a'] = str_repeat('a', 102400); echo '
';
var_dump(session_id(), $_SESSION['test']);
?>


Old behavior was around 15000 reqs/sec.

"read_and_close" improved it to about 20000 reqs/sec. i.e 33% faster.

"lazy_write" did not improve # of reqs, but per process httpd disk writes
was reduced from 100 MB/s to 5 MB/s. i.e. There were 12 httpd processes,
1200 MB/s writes was reduced to 60 MB/s writes. Note: Linux kernel(btrfs)
does not actually write data to disk when the data is the same.

I think this would be good enough benchmark for merging.

Regards,

--
Yasuo Ohgaki
yohgaki@ohgaki.net

--001a113d6f641c7f2d050db31c7b--