Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #6952

Re: database-based sessions for 3rd party php app

From The Natural Philosopher <tnp@invalid.invalid>
Newsgroups comp.lang.php
Subject Re: database-based sessions for 3rd party php app
Date 2012-09-05 13:51 +0100
Organization albasani.net
Message-ID <k27hs2$a73$4@news.albasani.net> (permalink)
References <548c30d9-7b7f-4542-b4fd-2aa72a817cc8@googlegroups.com> <k27fgu$m8$1@dont-email.me> <b0a2881e-f90c-4e9b-b24a-59444a2e3b3b@googlegroups.com>

Show all headers | View raw


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.
> 

Remember you still have to write the handler and make sure its included 
in your app.

>> 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.
> 
That has some performance downsides on scripts that dont need it.

>> 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. 
> 
Hmm. yes. at that level a database with appropriate indexing should be 
faster than a file system

> 
> thanks for your help!
> Axel.
> 
> 


-- 
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to 
lead are elected by the least capable of producing, and where the 
members of society least likely to sustain themselves or succeed, are 
rewarded with goods and services paid for by the confiscated wealth of a 
diminishing number of producers.

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

database-based sessions for 3rd party php app Axel <axel.bock.ba@gmail.com> - 2012-09-05 04:21 -0700
  Re: database-based sessions for 3rd party php app The Natural Philosopher <tnp@invalid.invalid> - 2012-09-05 12:37 +0100
    Re: database-based sessions for 3rd party php app Axel <axel.bock.ba@gmail.com> - 2012-09-05 04:58 -0700
      Re: database-based sessions for 3rd party php app The Natural Philosopher <tnp@invalid.invalid> - 2012-09-05 13:45 +0100
    Re: database-based sessions for 3rd party php app Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-09-05 14:26 +0200
      Re: database-based sessions for 3rd party php app The Natural Philosopher <tnp@invalid.invalid> - 2012-09-05 13:46 +0100
      Re: database-based sessions for 3rd party php app The Natural Philosopher <tnp@invalid.invalid> - 2012-09-05 14:01 +0100
  Re: database-based sessions for 3rd party php app Jerry Stuckle <jstucklex@attglobal.net> - 2012-09-05 08:11 -0400
    Re: database-based sessions for 3rd party php app Axel <axel.bock.ba@gmail.com> - 2012-09-05 05:39 -0700
      Re: database-based sessions for 3rd party php app The Natural Philosopher <tnp@invalid.invalid> - 2012-09-05 13:51 +0100
        Re: database-based sessions for 3rd party php app Axel <axel.bock.ba@gmail.com> - 2012-09-05 06:13 -0700
        Re: database-based sessions for 3rd party php app "Peter H. Coffin" <hellsop@ninehells.com> - 2012-09-05 10:21 -0500
      Re: database-based sessions for 3rd party php app Jerry Stuckle <jstucklex@attglobal.net> - 2012-09-05 10:21 -0400
  Re: database-based sessions for 3rd party php app Jonathan Stein <jstein@image.dk> - 2012-09-05 22:27 +0200

csiph-web