From: Boris Z. <bo...@2b...> - 2004-12-17 17:53:59
|
Hi Shimon, Am Freitag, 17. Dezember 2004 16:20 hast Du geschrieben: > On Fri, Dec 17, 2004 at 12:58:50PM +0100, Boris Zentner wrote: > > The session's are a tricky thing. But are you really sure that you did > > not use sessions at all? > > > > Off Hand, PageKit does not create a session unless you use the session. > > If you are logged in, the user must have a session, since at least the > > last_activity_time is stored in the session. > > In one site, I don't have user logins, and don't call $model->session ever. > So, I'm pretty sure I never use sessions. In another site, I have logins There you should not see any sessions. > but don't store any data in $model->session. I don't make use of the > last_activity_time there - none of the pages or sections require a recent > login. But you could use it on a page, pagekit can not know and store the time into the session. ( perhaps we can store the last_activity_time in the pkit_user table. And/Or make the last_activity thing a config option. ) > > > > - Can I manually disable instantiation of session if I don't use it? > > > (Or is pagekit using it internally for some reason?) > > > > > > > > > - Could PageKit be made a little smarter in order to eliminate my > > > reason for considering that option? > > > > try > > > > sub pkit_session_setup { > > {} > > } > > > > in Common.pm to trash the session. This might give lots of warnings, but > > perhaps it works. Please let me know. > > This gave me the following warning in the apache error log: > > failed to set up session - session_store_class and session_lock_class must > be defined at /usr/lib/perl5/site_perl/5.8.3/Apache/PageKit.pm line 1258. > Thats ok, just comment out the warning and mensure the time four your requests. Is there a large speedup now? > This warning was printed twice per page request - I'm not sure why (there > are at least three PKIT_COMPONENTs, but only one HTTP request, involved in > the pages I tried, if that's useful). > I take a look, why you see two calls to pkit_session_setup. > For additional info, I added a Carp::confess to that the subroutine that > contains line 1258 of PageKit.pm. The output is below. I don't have time > to trace this call stack now, but perhaps it will be useful to Boris in > understanding why the session setup got called although I didn't use the > session. It is ok to call the pkit_session_setup, if you are a logged user. With pkit_session_setup returning a empty hash, we make the session only valid for this request and it is not slower than using a hash in perl. Please mensure if sub pkit_session_setup { {} } is a large speedup. And Ignore or comment out the warning. > > thanks, > shimon. > > [Fri Dec 17 10:16:27 2004] [error] [client 66.249.64.197] setup_session at > /usr/lib/perl5/site_perl/5.8.3/Apache/PageKit.pm line > 1253\n\tApache::PageKit::setup_session('Apache::PageKit=HASH(0xa59dc34)','u >ndef') > > called at /usr/lib/perl5/site_perl/5.8.3/Apache/PageKit.pm line > 529\n\tApache::PageKit::prepare_page('Apache::PageKit=HASH(0xa59dc34)') > > called at /usr/lib/perl5/site_perl/5.8.3/Apache/PageKit.pm line 216\n\teval > {...} > > called at /usr/lib/perl5/site_perl/5.8.3/Apache/PageKit.pm line > 210\n\tApache::PageKit::handler('Apache::PageKit','Apache::RequestRec=SCALA >R(0xa59dd60)') > > called at -e line 0\n\teval {...} called at -e line 0\n -- Boris |