Determining memory available for cache

2000-11-24 Thread nigel

This mail is probably naive. Sorry.

I want to set up a cache, storing html templates and perl widgets (held
in MySQL) that are regularly eval'd. I want to attach timestamps and hit
counts to each stored scalar, to help decide which are the most
important values to cach, and allow updates to the cache if values are
changed. I'm also looking at IPC::Cache.

Now, I only have 128MB RAM. When I'm populating the hash, I can limit
the size of the cache to available RAM by reading freemem from
/proc/meminfo, so I don't run into swap space.

However, when I undef a range of hash values, the free memory in
/proc/meminfo doesn't increase - it seems permanently allocated.

Does anyone have any thoughts on how I can judge whether I have space to
add a value to a cache, or whether I need to clean out unused vales from
the cache.

--Nigel Wetters


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: AuthCookie

2000-11-24 Thread Adi Fairbank

Check your apache logs.. I don't think your server is actually sending the
protected page, Netscape is showing you a cached version.  I think this is a bug
in Netscape 4.7 (for linux anyway), because that happens to me occasionally even
with "Cache-Control: no-cache" and no "Expires:" header.  If you click reload,
it will actually hit the server and show you your login script page again.

HTH, -Adi

Kiran Kumar wrote:
 
 Hi,
   I have Installed AuthCookie Module but it does not work on netscape (4.7)
 but works on IE .
In netscape  after I logout and later i request a protected page i still
 get the page ,Can anyone help me on this .
 
 Thanks in advance
 
 Kiran
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Problem with Apache::DBI under mod_perl!!

2000-11-24 Thread Edmar Edilton da Silva

Hi all,

I am sending again the previous message because I still didn't know how

to resolve the below problem. Can anyone any idea how help me?

I have installed on the my machine the following modules:
apache 1.3.12-2
perl-5.00503-10
mod_perl 1.21-10
DBI 1.14

DBD::Oracle
Apache::DBI 0.87

Oracle Client Software

For enable the mod_perl module, I added the below code in the
configuration file of apache ("httpd.conf"):

# If the perl module is installed, this will be enabled.

IfModule mod_perl.c
  PerlFreshRestart On
  Alias /perl-bin/ /home/httpd/perl-bin/
  Location /perl-bin
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI
  /Location
/IfModule

For load the Apache::DBI module, I also added this line in the
"httpd.conf" file:
PerlRequire /etc/httpd/conf/startup.pl

Inside of "startup.pl" file, I added the following code:
#!/usr/bin/perl

use strict;

# Extend @INC if needed
use lib qw(/dir/foo /dir/bar);

# Make sure we are in a sane environment.
$ENV{MOD_PERL} or die "not running under mod_perl!";

# For things in the "/perl-bin" URL
use Apache::Registry;

# Load Perl modules of your choice here
# This code is interpreted *once* when the server starts
use Apache::DBI ();
$Apache::DBI::DEBUG = 2;
$Apache::AuthDBI::DEBUG = 2;
use DBI ();

# Tell me more about warnings
use Carp ();
$SIG{__WARN__} = \Carp::cluck;

# Load CGI.pm and call its compile() method to precompile
# (but not to import) its autoloaded methods.
use CGI ();
CGI-compile(':all');

#Initialize the database connections for each child
Apache::DBI-connect_on_init
("dbi:Oracle:ora8", "travel", "travel",
   {
   PrintError = 1, # Warn() on errors
   RaiseError = 0, # Don't die on error
   AutoCommit = 1, # Commit executes immediately
   }
);

But, when I try loading a HTML page of WWW server, the server refuse my
request. I think that the problem is in the WWW server that don't load
their child process because to the Apache::DBI to be with some problem.
During the installation of all the modules didn't have any problem. The
apache start correctly, but when I try stoping them, I get a error
message that the process failed. If I don't load the DBI and Apache::DBI module

in the apache, it works correctly. Using only the DBI and
DBD::Oracle modules, I can access the Oracle database no problems. Really the

problem must be in the Apache::DBI ( when it is loaded ), but I don't know exactly

where. Can anybody help me? Locking the configuration files, can anyone tell me

what is happening? Any help will very appreciated.


Edmar Edilton da Silva
Bacharel em Ciência da Computacão - UFV
  Mestrando em Ciência da Computacão - UNICAMP






Re: Problem with Apache::DBI under mod_perl!!

2000-11-24 Thread Edmund Mergl

Edmar Edilton da Silva wrote:
 
 Hi all,
 
 I am sending again the previous message because I still didn't know how
 
 to resolve the below problem. Can anyone any idea how help me?
 
 I have installed on the my machine the following modules:
 apache 1.3.12-2
 perl-5.00503-10
 mod_perl 1.21-10
 DBI 1.14
 
 DBD::Oracle
 Apache::DBI 0.87
 
 Oracle Client Software
 
 For enable the mod_perl module, I added the below code in the
 configuration file of apache ("httpd.conf"):
 
 # If the perl module is installed, this will be enabled.
 
 IfModule mod_perl.c
   PerlFreshRestart On
   Alias /perl-bin/ /home/httpd/perl-bin/
   Location /perl-bin
 SetHandler perl-script
 PerlHandler Apache::Registry
 PerlSendHeader On
 Options +ExecCGI
   /Location
 /IfModule
 
 For load the Apache::DBI module, I also added this line in the
 "httpd.conf" file:
 PerlRequire /etc/httpd/conf/startup.pl
 
 Inside of "startup.pl" file, I added the following code:
 #!/usr/bin/perl
 
 use strict;
 
 # Extend @INC if needed
 use lib qw(/dir/foo /dir/bar);
 
 # Make sure we are in a sane environment.
 $ENV{MOD_PERL} or die "not running under mod_perl!";
 
 # For things in the "/perl-bin" URL
 use Apache::Registry;
 
 # Load Perl modules of your choice here
 # This code is interpreted *once* when the server starts
 use Apache::DBI ();
 $Apache::DBI::DEBUG = 2;
 $Apache::AuthDBI::DEBUG = 2;
 use DBI ();
 
 # Tell me more about warnings
 use Carp ();
 $SIG{__WARN__} = \Carp::cluck;
 
 # Load CGI.pm and call its compile() method to precompile
 # (but not to import) its autoloaded methods.
 use CGI ();
 CGI-compile(':all');
 
 #Initialize the database connections for each child
 Apache::DBI-connect_on_init
 ("dbi:Oracle:ora8", "travel", "travel",
{
PrintError = 1, # Warn() on errors
RaiseError = 0, # Don't die on error
AutoCommit = 1, # Commit executes immediately
}
 );
 
 But, when I try loading a HTML page of WWW server, the server refuse my
 request. I think that the problem is in the WWW server that don't load
 their child process because to the Apache::DBI to be with some problem.
 During the installation of all the modules didn't have any problem. The
 apache start correctly, but when I try stoping them, I get a error
 message that the process failed. If I don't load the DBI and Apache::DBI module
 
 in the apache, it works correctly. Using only the DBI and
 DBD::Oracle modules, I can access the Oracle database no problems. Really the
 
 problem must be in the Apache::DBI ( when it is loaded ), but I don't know exactly
 
 where. Can anybody help me? Locking the configuration files, can anyone tell me
 
 what is happening? Any help will very appreciated.
 
 
 Edmar Edilton da Silva
 Bacharel em Ciência da Computacão - UFV
   Mestrando em Ciência da Computacão - UNICAMP
 


if you have problems with Apache::DBI start with 
a very simple configuration.
First of all make sure your script runs without Apache::DBI.

Then add 
use Apache::DBI ();
$Apache::DBI::DEBUG = 1;

to your startup.pl and watch the eror_log for the appropriate 
messages.

If this works go ahead and use connect_on_init() and any other
option.


Edmund


-- 
http://www.edmund-mergl.de
fon: +49 700 edemergl

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Determining memory available for cache

2000-11-24 Thread Perrin Harkins

On Fri, 24 Nov 2000 [EMAIL PROTECTED] wrote:
 I want to set up a cache, storing html templates and perl widgets (held
 in MySQL) that are regularly eval'd. I want to attach timestamps and hit
 counts to each stored scalar, to help decide which are the most
 important values to cach, and allow updates to the cache if values are
 changed. I'm also looking at IPC::Cache.

File::Cache is a better choice than IPC::Cache for most things.  In this
case, you can free yourself from worrying about managing memory between
mod_perl and your cache by using File::Cache and letting the OS handle
keeping commonly used pages in RAM.  It wil buffer the frequently used
files and page out unused mod_perl code.  Much simpler.

- Perrin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]