Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70122 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44992 invoked from network); 14 Nov 2013 19:55:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Nov 2013 19:55:23 -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.215.48 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.48 mail-la0-f48.google.com Received: from [209.85.215.48] ([209.85.215.48:46933] helo=mail-la0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 01/C0-40965-9AA25825 for ; Thu, 14 Nov 2013 14:55:22 -0500 Received: by mail-la0-f48.google.com with SMTP id n7so2009365lam.35 for ; Thu, 14 Nov 2013 11:55:18 -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=mM9warCoAjOBV76AnsLzHr+hcAmySPhZAPf4FrML9A4=; b=fqUbmequUGZtSC7DVlXikFEjpvvZc5TlrsaT6z6Hhgs2Rf7Z6c/rui4GGTU02kZ2kw SXZn18Y6SHIsNZptEclRcwPJfIBzMHJPSRQd4I/AnflNlDAdNPVw9djqHrASL6qLclF/ q6sJtWmzTaqUHoZ2KA/kMgTEHoIdH7xcnNfSTtCVD30NpNWa029ZZZbsWbr6bFAiftGV 5vA7tpHteBbRX1Xd9R7+m+kd6vxBfUYb5qgMTF78TR0YoolznU6xkdxo4EzMKc0vQq/a znJT1HBkj8Nsont1CuLUSMX5CNuh9sEwS6RTHtQYzZKn8Apq8TEEyG7kzBA6xrDNLCVb Rg9Q== X-Received: by 10.152.8.18 with SMTP id n18mr1885590laa.24.1384458918137; Thu, 14 Nov 2013 11:55:18 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.154.201 with HTTP; Thu, 14 Nov 2013 11:54:38 -0800 (PST) In-Reply-To: References: Date: Fri, 15 Nov 2013 04:54:38 +0900 X-Google-Sender-Auth: iAFRQe9Hpl5VTD2A_Fo-Tr12Q-A Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c34ede059ab604eb287620 Subject: Re: Session cache, lock and write From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c34ede059ab604eb287620 Content-Type: text/plain; charset=UTF-8 Hi all, On Fri, Nov 15, 2013 at 4:42 AM, Yasuo Ohgaki wrote: > Session module can be faster in several ways. > > It can ignore writing session data when session data is not changed. > It also can remove reading session data by caching as most web > servers support keep alive. Current session save handlers lock > session data, but it could be unlocked. > > There are many applications that transnational consistency of session > data is not mandatory. > > Session module could have ini settings > - session.read_cache = int (by default 0 = no cache. 5 for 5 seconds) > Read cache will be updated if session data has changed. > - session.lock = On/Off (On by default. Some save handlers already have > this) > - session.write_short_circuit = On/Off (Off by default) > > Users may verify save handler feature by viewing phpinfo() and > source code level compatibility will be kept. > > These features boost web application performance a lot by ignoring > session data consistency. It's just like transnational vs. > non-transnational SQL. > > session.read_cache and session.lock may be consolidated since > enabling session.read_cache disables session.lock. There are slight > difference between them but it may be ignored. > (With session.lock=On, writes from other web server(PHP) can be blocked > even when session.read_cache=5, but reading session cache on the same > keep alive session will not be blocked, for example.) > > Any comments? > I also would like to add "session deletion delay" to mitigate session deletion race condition by adding deletion time in session data. (i.e session_regenerate_id(true) may create multiple valid sessions. This can be mitigated by having this) session.deletion_delay = int (by default 0 = delete immediately. 10 for 10 sec later) If there is $_SESSION['__SESSION_EXPIRE__'] and expired, new session ID is created automatically. I would like to hear comments for this also. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c34ede059ab604eb287620--