Re: Sessio variables and Load Balancing
| From: | Chris Adams | Date: | Fri, 30 Jun 2000 23:18:37 +0000 |
| Subject: | Re: Sessio variables and Load Balancing | ||
| References: | 1 2 3 4 5 6 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-23103@lists.php.net to get a copy of this message | ||
> At 02:40 PM 06/30/2000 -0700, you wrote:
> >The session read handler should be called once at the start of the page
and
> >the write handler once at the end. With a decent session handler, it's 2
> >queries per page (SELECT,UPDATE), with an additional INSERT when the
session
> >is first created and a DELETE when session_destroy() is called.
>
> Right, that is more efficient instead of re-inserting the data at every
> register or unregister call. But, if you work the numbers for a site that
> gets 25K worth of pageviews per day you are making an average of 1 query
> every 2 seconds just for session information. And that's average.. not
> what it would be during peak times and not including existing queries for
> content related stuff. That sounds sort of high just for serving
> pages. Maybe I'm wrong.
25K page views is low these days. The time spent on the queries in question
is under .01 seconds. If your site can handle the processing & queries to
generate your content, two more won't kill it. Also, I think you'd find that
with a fast database like MySQL and persistent connections it would actually
take longer to use the files handler which must open/read/close the session
file each time.