Re: Apache::Session::File hangs
Axel Huizinga wrote: The following code hangs after reloading and the try to tie again the previously created session! WHY? ... use vars qw( $id $sID $lockDir %session $sessionDir ); The session variable has to go out of scope for the lock to be released. I know it seems like the untie should do it, but try making %session a lexical instead of a global. - Perrin
Re: Apache::Session::File and free memory weirdness
Hi Perrin - > > Odd thing #2: (This part seems most bizarre to me.) At 5:15 AM, we run a > > Perl script that finds and deletes Apache::Session::File session and lock > > files that are older than 28 days. Usually there are about 50,000 old > > files that get deleted out of about 2,300,000 total. Almost immediately, > > free memory on the machine jumps back up to 1.3GB. What's up with that? > > Sounds like you're counting the buffers and cache in your "used" memory. > Depending on what OS you're on, you may want to look at a tool other than > top. The memory used for buffers and cache will be available to > applications if they need it. That's exactly it, thanks for the pointer Perrin! Turns out "free" memory as reported on Solaris includes the file system cache. On a busy system it will always look like there's no almost free memory, when in reality memory used by the file cache gets released immediately when an application needs it. I found some good general info at: http://www.sun.com/sun-on-net/performance/vmsizing.pdf Larry Leszczynski [EMAIL PROTECTED]
Re: Apache::Session::File and free memory weirdness
Perrin Harkins wrote: > > > Odd thing #1: As it gets into evening time, load on the machine drops off > > and there are fewer httpd children running, but I am not seeing free > > memory return to that 1.3GB level. At most it comes back up to 400MB or > > so. I don't think the httpd children are hanging on to memory, because > > they cycle through pretty quickly - MaxRequestsPerChild is set to 512 and > > none of the processes are ever more than a couple minutes old when I look > > in. Is there any reason to think the parent httpd process would hang on > > to anything? > > I have noticed that over time the new processes will spawn with less memory > shared. I'm not sure exactly why this is, but it does seem to happen. A > nightly complete restart of the server will reset things, but you may not > have that option. > I have noticed this also. I have a theory about its cause, but I haven't had the free time to hack with it yet. My theory is that when the VM subsystem swaps pages of the mod_perl parent process, those pages become forever unshared (even after they return to memory from swap). So I was going to test the mlockall() Linux system call to see if it made a difference. (Search the archives for "mlockall"). However, I am using the Linux platform - the VM behavior may be totally different on Solaris. If anyone else has some time to play with mlockall() on Linux, I'd like to know the results. It'll be a few more weeks till I get a chance. -Adi
Re: Apache::Session::File and free memory weirdness
> Odd thing #1: As it gets into evening time, load on the machine drops off > and there are fewer httpd children running, but I am not seeing free > memory return to that 1.3GB level. At most it comes back up to 400MB or > so. I don't think the httpd children are hanging on to memory, because > they cycle through pretty quickly - MaxRequestsPerChild is set to 512 and > none of the processes are ever more than a couple minutes old when I look > in. Is there any reason to think the parent httpd process would hang on > to anything? I have noticed that over time the new processes will spawn with less memory shared. I'm not sure exactly why this is, but it does seem to happen. A nightly complete restart of the server will reset things, but you may not have that option. > Odd thing #2: (This part seems most bizarre to me.) At 5:15 AM, we run a > Perl script that finds and deletes Apache::Session::File session and lock > files that are older than 28 days. Usually there are about 50,000 old > files that get deleted out of about 2,300,000 total. Almost immediately, > free memory on the machine jumps back up to 1.3GB. What's up with that? Sounds like you're counting the buffers and cache in your "used" memory. Depending on what OS you're on, you may want to look at a tool other than top. The memory used for buffers and cache will be available to applications if they need it. - Perrin
Re: Apache::Session::File
How do i change this locking mechanish of win32? Am i using the wrong module? From apache::session::* modules do you know which are supposed to work on win32? Thanks Gunther Birznieks wrote: > > You need to change the locking mechanism on Win32 to not use IPC. I believe > there are examples for using Flock based locking but am not sure. > > If you are using win32 mod_perl, locking is irrelevant anyway because all > requests are serialized through one engine. > > At 03:43 PM 2/5/01 +, harilaos wrote: > >Hello, > >I ma trying to use this module to store persident data on file > >on win32 environment. > >I use the code: > > > >use Apache; > >use Apache::Session::File; > >use CGI qw/:standard/; > >use CGI::Carp qw(fatalsToBrowser); > > > >print header(); > >print start_html; > > > > my %global_data; > > > > eval { > > tie %global_data, 'Apache::Session::File', 1, > > {Directory => '/temp/sessiondata'}; > > }; > > if ($@) { > > die "Global data is not accessible: $@"; > > } > > > >print "hello"; > > > >print end_html; > > > >I get error in apache logs : > >Can't locate IPC/SysV.pm in @INC > > > >do I need the IPC/SysV.pm module? > >I have searched the documentation but i don't see a simple clear example > >to do this. > > > >Can you help please? > > > >Thanks > > __ > Gunther Birznieks ([EMAIL PROTECTED]) > eXtropia - The Web Technology Company > http://www.extropia.com/
Re: Apache::Session::File
You need to change the locking mechanism on Win32 to not use IPC. I believe there are examples for using Flock based locking but am not sure. If you are using win32 mod_perl, locking is irrelevant anyway because all requests are serialized through one engine. At 03:43 PM 2/5/01 +, harilaos wrote: >Hello, >I ma trying to use this module to store persident data on file >on win32 environment. >I use the code: > >use Apache; >use Apache::Session::File; >use CGI qw/:standard/; >use CGI::Carp qw(fatalsToBrowser); > >print header(); >print start_html; > > my %global_data; > > eval { > tie %global_data, 'Apache::Session::File', 1, > {Directory => '/temp/sessiondata'}; > }; > if ($@) { > die "Global data is not accessible: $@"; > } > >print "hello"; > >print end_html; > >I get error in apache logs : >Can't locate IPC/SysV.pm in @INC > >do I need the IPC/SysV.pm module? >I have searched the documentation but i don't see a simple clear example >to do this. > >Can you help please? > >Thanks __ Gunther Birznieks ([EMAIL PROTECTED]) eXtropia - The Web Technology Company http://www.extropia.com/
RE: Apache::Session::File
My bad, it does seem to be using flock, but it still seems to be the consistent point of failure.. and I am untieing immediately after use o _ /|/ | Jerrad Pierce \ | __|_ _| /||/ http://pthbb.org . | _| | \|| _.-~-._.-~-._.-~-._@" _|\_|___|___| > -Original Message- > From: Jerrad Pierce [mailto:[EMAIL PROTECTED]] > Sent: Friday, June 02, 2000 12:43 > To: '[EMAIL PROTECTED]' > Subject: Apache::Session::File > > > Anybody know why Apcahe::Session::Lock::File.pm uses lock > FILES instead of > flocking the file? It seems to be causing problems with > rapdifre access... > > o _ > /|/ | Jerrad Pierce \ | __|_ _| > /||/ http://pthbb.org . | _| | > \|| _.-~-._.-~-._.-~-._@" _|\_|___|___| >