FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » database-based sessions for 3rd party php app
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: database-based sessions for 3rd party php app [message #179028 is a reply to message #179021] Wed, 05 September 2012 14:21 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 9/5/2012 8:39 AM, Axel wrote:
> Am Mittwoch, 5. September 2012 14:11:11 UTC+2 schrieb Jerry Stuckle:
>
>> You can set session.save_handler in the php.ini file to point at a
>> different handler. Define your handler and write the data to the
>> database. Instructions are in the PHP doc.
>
> really? I found just a bunch of stuff describing the general principle. I'll have another look, thanks.
>
>> Alternatively, you can also set an auto prepend file to include your
>> session handler code in every file.
>
> ah! That's kind of what I had in mind :) . I didn't know that - I'm not a php developer.
>
>> However, are you sure this will help performance? Why do you think your
>> current session handling is causing performance problems? Not that I
>> like using NFS shares, but they're typically faster than remote databases.
>
> Hm. That's a good question. _Right Now_ we have 57000 active sessions, and a "dir" on the directory with them takes 20+ seconds. Also the NFS serves most of our content, so bottom line - I have no clue, but I think this might improve performance - which is kind of neccessary. So basically I wanted to change and have a look.
>
>
> thanks for your help!
> Axel.
>
>

The other question is - why do you have 57K sessions? What's your
session expiration time? Too long, maybe?

Or is your garbage collection set too low so it's not cleaning up
expired sessions?

57K concurrent sessions would be a *very busy* website - probably tens
of millions of hits per day.

But if they are valid, then using a database *might* speed things up.
But remember - most of the time spent with the dir will be in
transferring the entire directory listing over the network and
displaying it - neither of which needs to be done by a session handler.

The real test would be how long it takes to open a session file in the code.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Net Connect API -php
Next Topic: Php
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 06:40:25 GMT 2024

Total time taken to generate the page: 0.03999 seconds