On Tue, 2003-07-01 at 16:56, Ilia Alshanetsky wrote:
> >From a performance standpoint you are correct, SQLite looses to files. The 
> actually performance seems to be quite drastic (very surprising to me). That 
> said, keep in mind that for most applications even 150 requests/second is an 
> unattainable limit anyway. For example smarty templating system demo peaks at 
> about 2.5 requests/second and phpMyAdmin front page does a whooping 10 
> requests/second and a list goes on an on.

So of course we should just say 'screw performance' :)  Again, if it
were useful, I would say "yes, totally."  100% and bucket o' bits.  But
it doesn't give you anything, and it can be in PEAR/PECL for those who
really want it. 

I'm not suggesting it never exist (although I would be happier if that
were the case).  What I am saying is that it should not exist by default
in PHP.  Its shooting yourself in the foot without any real world reason
too.

> So what do we do, I still think having sqlite session handler is a good idea 
> especially since all the tools necessary for it's operation are bundled by 
> default. Not so with MySQL and PostgreSQL which require working server, 
> password, logins etc... Which is why I believe we should still keep in the 
> main trunk rather then move to PECL.
> As far as sqlite session handling benefits go, there are several:
> 1) Single file vs many file (rm -f will fail if there are too many files in a 
> particular directory), which makes for easier maintenance.

Directory hashing is the answer, not putting it all into one file.

> 2) Much easier to find & manipulate sessions outside of normal sessions 
> framework.

When have you needed this?  Also, in the odd chance you do, what's so
hard about:

$data = session_decode(file_get_contents("/tmp/sess_$id"));

> 3) Extremely easy to move sessions from one server to another

tar cfz sessions.tar.gz sessions/

> 4) Marginally more secure then plain files

Not at all.  :)  More files more better, you can have different
permissions on each file, rather than the neive implementation of using
one file for all sessions.  Sure you can use save_path per virtual host,
but that's if you do it.  The default implementation is less secure, and
that's what we have to count on.

-Sterling

> 
> Ilia
> 
> P.S. On the benchmark note it should be mentioned that the sqlite session 
> handler does appear to use indexes, which could explain why session lookups 
> are so slow. But it may average out, since that would make inserts faster.
-- 
"I can't give you a brain, so I'll give you a diploma"  
    - The Great Oz, The Wizard of Oz

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to