Re: Sessio variables and Load Balancing
| From: | Chris Adams | Date: | Fri, 30 Jun 2000 21:38:17 +0000 |
| Subject: | Re: Sessio variables and Load Balancing | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4172@lists.php.net to get a copy of this message | ||
> I just took a look at those slashdot articles. Interesting information.
>
> >If you're using MySQL or a well-tuned Oracle install, this won't be a big
> >deal at all. Retrieving a record on an indexed column is extremely fast.
If
> >the single query necessary to retrieve a session's data measurably
affects
> >your site performance, your database is either severely underspeced or
your
> >DBA should be fired for gross incompetence.
>
> Of course it's fast, but I'm not just talking about query speed, there is
> more to it than that. Mysql (or Oracle) might be able to return results
> blazingly fast, but it's going to use as much memory and processor time as
> it can to do that. What about the number of processes it will take to
> serve all needed requests? What about the extra connections it would have
> to create to serve peak times? All that is going to take memory and
> processor time. What is you idea of spec? Quad Xenon w/ 2BG of RAM? A
> database server that is perfectly suited to normal website operations
might
> not be able to properly handle the load if you just indiscriminately
> started increasing the queries by a factor of 2 or more. Doesn't sound
> like it's the DBA's fault at all.. sounds like the programmer didn't
> consider what the impact of his design would be.
But it's not increasing the load by a factor of two. It's a single SELECT at
the start of processing for a page and a single UPDATE at the end. It uses
your existing persistent connection if you're using *_pconnect(). There is
no increase in the number of processes or connections and the queries are
indexed and mostly likely cached.
I did some quick benchmarks here - handling 20 requests a second for 100
seconds caused very little CPU usage on this PII350. rc5des continued to use
almost all of the CPU time. This box is not heavily tuned, is running
NT/ISAPI/MySQL and a ton of other crap (e.g. SQL Server, a few ssh sessions,
textpad, my email client, a couple browser windows). If we're talking about
a tuned server running Linux/Apache (e.g. PHP/MySQL's best-tuned
environment) it should not be noticeable unless your server is a $400
emachine.