(or filehandle, or database handle) in the
parent process (during startup) and use it in the children. Each child will
have to make a new socket the first time.
Hope that helps,
Perrin
'; }
That's what I used when porting someone's old perl4-ish code to PerlRun.
Both of these quick fixes waste memory though.
- Perrin
? But yes, it creates a new socket ref each time?
It looks to me like you have a problem with scoping and closures. Try
making $sock a global, i.e. change my $sock; to use vars qw($sock);.
Then put your close and undef stuff back in.
- Perrin
returned true, but they are basically equivalent.
TMTOWTDI.
- Perrin
question on this thread was how to post-process CGI
output through SSI. I've done this using Apache::SSI, just collecting my
output in a string and then feeding it to Apache::SSI, which provides a
method you can call for this. You could also look at CGI::SSI_Parser, which
I have not used.
- Perrin
or as a filter with Apache::Filter. Does that help?
- Perrin
(P.S. I'm in Brooklyn too!)
are pretty
solid as well.
- Perrin
to do that is by using Apache::SSI and
Apache::Filter, as described here:
http://search.cpan.org/doc/KWILLIAMS/Apache-SSI-2.16/SSI.pm
- Perrin
IS there a way of pre-processing and post processing a handler?
Only by using something like Apache::Filter. Apache itself does not support
chaining handlers.
- Perrin
weren't trying to use Filter with
mod_include (i.e. not Apache::SSI) were you?
Anyway, there's another CPAN module you can use called CGI::SSI_Parser which
might fit your needs.
I'm definetely bathing in a Brooklyn Larger Bath when this is done.
I prefer the IPA, taken orally.
- Perrin
, since they won't be shared between
child processes.
- Perrin
2. Cause any httpd_perl child process which exceeds 20 megabytes in
memory usage to terminate after it's done.
Apache::SizeLimit (and others) can do this.
- Perrin
all use.
Alternatively, you could make your User class cache itself in pnotes and
just have everyone call new(), but that assumes you'll never want to use it
outside of mod_perl. Also see Class::Singleton.
- Perrin
=template
- Perrin
that content developers can use.
PSP shares the same basic elements with JSP...
Good grief! This sounds exactly like Apache::ASP with its XMLSubs feature.
I give up.
- Perrin
just want a simple solution
that stays out of their way.
Also, I believe that security issue Ged referred to was fixed by the author.
- Perrin
, the caching schemes of many of these systems don't work. That
does make a difference.
- Perrin
could pre-process the
templates to translate the form elements to TT syntax.
There's plenty of documentation for this module that covers the details of
plugins and filters.
- Perrin
in-line perl, because it doesn't eval anything or cache
anything. The only real downside of this module is that coding repeated
sections (loops) can't be done in-line, i.e. you have to use multiple files.
That's a bit of a pain.
- Perrin
Take a look at http://perl.apache.org/guide/ and read the stuff on libapreq.
- Perrin
that suits them.
- Perrin
no need to do a lookup or rely on PerlSetupEnv On I wouldn't think...
my $ssl = Apache::URI-parse($r)-scheme =~ m/^https/;
Or maybe just look at the port # of the request.
- Perrin
I need to save some status informations about each request (in my
filter each request passes through 3 phases : PerlTransHandler,
PerlAccessHandler and PerlHandler.
You want $r-pnotes.
- Perrin
run to prime each system. Or
do you feel a need to include the initial compilation time?
- Perrin
run to prime each system. Or
do you feel a need to include the initial compilation time?
- Perrin
Apache::ASP CGI mode?
- Perrin
here:
http://perl.apache.org/guide/porting.html#Transitioning_from_Apache_Regis
- Perrin
is there any good thorough documentation on building custom
config directives other than what's in the eagle book? i
left mine back in au and i don't really want to buy another
one :)
You're in luck, that chapter is on-line:
http://www.modperl.com/book/chapters/ch8.html
started
with is the MLDBM::Sync module, which uses dbm files for sharing.
- Perrin
, but with a query string added), then I get a 404
Not Found error.
Of course you do. Your regex ^/(.*)\.asp doesn't match that URL with the
query string.
- Perrin
at the moment.) Looking
back at your post, it seems like it still should have worked although it
would have had no query string in the proxied request. You might try
^/(.*)\.asp(.*)$ for matching the whole query string, but I wouldn't thing
it would be necessary with a greedy regex.
- Perrin
Anybody know if exist some module how CGI::Out for buffering output in CGI
script ?
Is there a reason you can't just append everything to a variable until the
end? If that won't work, you can tie STDOUT. Apache::Filter might help.
- Perrin
for using templates in general
Slouching towards 1.0,
Perrin
John Buwa wrote:
Isnt there a way to clear global variable to a null after a web transaction
is complete?
Apache::PerlRun does that.
- Perrin
you would be changing SQL without changing the
other code very often. Having your SQL right next to where it's being used
is convenient, and a HERE doc makes it easy to read.
- Perrin
for a description of the
available options.
- Perrin
encapsulation of the SQL
behind the object interface, and your high-level logic doesn't need to use
any SQL directly.
It would really be nice if someone could write an overview of the O/R
mapping tools for Perl. I know Dave Rolsky was working on one, but it's a
big job and he's busy with Mason.
- Perrin
.)
Using RPC calls instead of language commands also improves speed, and
solves the quoting problem, too.
The same goes for bind variables.
- Perrin
http://axkit.org/docs/presentations/tpc2001/anydbd.axp
Is this basically a hash of SQL statements, indexed by DBD type? Or is
there something more that I'm missing? (I should have gone to your TPC
talk...)
?
No. Put the connect stuff in a subroutine and call it from your
application. Things in the main section of a required file are only
supposed to run once.
- Perrin
the documentation on using LOBs in DBD::Oracle? Are
you sure that LongReadLen is set high enough?
- Perrin
Gunther Birznieks wrote:
At 07:16 PM 8/1/2001 -0400, Perrin Harkins wrote:
I have a CGI application where I do:
require 'db.pl';
where db.pl defines some functions and variables related to connecting to
the database, and then executes C$dbh = DBI-connect(...).
snip
I
and persistence layers in the users guide.
I vote to cover only the mod_perl specific stuff in there, as you said
above.
Perrin, would you like to be the database chapter pumpkin?
Possibly. We should talk more about what would go into that chapter
when you start working on the new guide.
- Perrin
Robert Landrum wrote:
The guide is a great thing, and removing items from it is risky.
Think of it as refactoring.
people have servers more in the range of 10-40MB, with a
bunch of that shared.
- Perrin
is
generally used for transient data where last-save-wins is fine as long as
the integrity of the data is protected during the actual writes. If you
need fancier locking, you could try ripping the lock stuff out of
Apache::Session.
- Perrin
discussion about this before, but I can't remember what the outcome was and
I can't find it in the archive.
- Perrin
similar), and print something to the client. Otherwise, your Set-Cookie
header will never get sent out.
Glad to see you're still mod_perl-ing.
- Perrin
Umm... Is
return OK;
the correct thing to return when using multiple handlers?
Yes, according the mod_perl docs. It only stops if you return something
other than OK or DECLINED.
- Perrin
. Try upgrading to mod_perl 1.26,
which fixes this bug.
- Perrin
So what is the REASON for this copy-on-first-call behaviour.(there have to
be some reason, if i'm not totaly dull to see it )
It's called a closure. You can read up on it in the Camel book or in Damian
Conway's OO book.
- Perrin
of these session ids is not desirable. ;)
So, it's not really a session ID then; it's your session data.
There are tons of two-way encryption modules on CPAN. Try looking at
Crypt::CBC.
- Perrin
are eating RAM ?
I'm absolutely sure that I'm not useing global variables.
You should read the guide at http://perl.apache.org/guide/ for more info
on memory growth. Some growth over time is normal and you might want to
use Apache::SizeLimit to control it.
- Perrin
and immidiately dies.
Does anyone have any ideas on how to figure out why this keeps happenning?
There is info in the distribution and in the guide (debug section) on how
to get stack traces of your code or of Perl itself.
- Perrin
On Tue, 14 Aug 2001, Rasoul Hajikhani wrote:
Are there any traps that I should be aware of when using s//g? I was
reading the online mod_perl docs and could not find anything to that
effect. But I do recall working with Perrin (correct me if I am wrong
Perrin) that there were some issues
I have a lot of large MP3 files, and want to restrict the number that
Apache
serves concurrently. Is this possible ? I'm posting it here since I assume
it would require some sort of module to achieve it. ?? (Win 32).
You want mod_throttle. I don't know if it works on Windows.
- Perrin
similar.
- Perrin
into account perhaps?
You can specify a full path to use/require. Check man perlfunc for the
details. You can also specify a path relative to the current working
directory if you don't like hard-coding full paths in your scripts.
- Perrin
error_log for messages.
- Perrin
for each script.
- Perrin
research with Devel::DProf and Time::HiRes is probably your next
step. You need to find out where all that work is going.
- Perrin
an unusual case and you can always write your
own cleanup code for it.
- Perrin
the Apache::DBI docs.
- Perrin
is. Open a connection in the child process instead.
You can use connect_on_init() from Apache::DBI if you like.
- Perrin
perl programs within Apache stops to work until I
restart Apache.
With two clients fetching a page both at one time, I'm 100% getting this
in
less than a minute.
Are you using Apache::DBI? Are you opening a connection in the parent
process (in startup.pl or equivalent)?
- Perrin
. With a
large result set, that could take up tons of RAM.
- Perrin
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
One of the shiny golden nuggets I received from said slice was a shared
memory cache. It was simple, it was elegant, it was perfect. It was also
based on IPC::Shareable. GREAT idea. BAD juju.
Just use Cache::Cache. It's faster and easier.
- Perrin
I dont know what I've done, but somehow my httpd.conf has led to a
number of warnings about me redefining a number of things.
Are you running the latest mod_perl? Do you have PerlFreshRestart on?
- Perrin
2 - Is there anyway to have apache dump to the lag exactly what it is
doing so that I can get some idea of why it has my web browser idling
away and not returning anything?
You can use strace, truss, or some similar tool.
- Perrin
in the
list archives which you can search through.
- Perrin
that prevents saving the fetched data.
Most caching apps are happy with last save wins though, so I guess
anything like that would need to be optional.
- Perrin
sorry, I think I misread the question - the verbosity threw me.
No, I think you got it right. He wants to share a hash between multiple
Apache children.
I recommend using either MLDBM::Sync or Cache::Cache for this.
- Perrin
?
This looks like a DBI installation problem, not an Apache::DBI problem.
Does DBI work when you don't use Apache::DBI?
- Perrin
don't
do that).
I've commented on this before, as have others, in the context of using
Error.pm. There is no workaround for this except don't do that.
- Perrin
for similar error messages.
- Perrin
processes. Apache::SizeLimit will detect processes that are getting too big
and make them cleanly exit after they finish the current request.
- Perrin
time ago.
- Perrin
Just wanted to ask to any embperl user, is there any real advantage
about using embperl instead of PHP ?
If you want a high-level summary of Embperl features, you could take a look
at my article on perl.com:
http://www.perl.com/pub/a/2001/08/21/templating.html
- Perrin
bother with Apache::Session::Lock::Semaphore at all?
Cache::Cache already provides atomic updates. You should be able to use
NullLocker with the same level of safety.
- Perrin
generate unique IDs across a cluster.
- Perrin
::Session uses shared read locks, so I think you can still have
problems there. It doesn't gurantee an atomic read-change-modify.
- Perrin
be helpful if
you could post the relevant parts of your httpd.conf and startup.pl too.
- Perrin
are outlined in the guide.
- Perrin
the server is shut down.
With Apache::DBI, you should get one connection per Apache process, and
they'll stay open. If you are changing the login parameters (i.e.
different user each time), you can't use Apache::DBI because you'll get
a huge build-up of connections.
- Perrin
and Registry vs.
PerlRun.
- Perrin
and Registry vs.
PerlRun.
- Perrin
and editing forms. If your TT templates seem
messy, it may be because you're trying to do too much application logic in
them. It's best to avoid things like the DBI plugin and do all the real
work before you run the template.
- Perrin
and editing forms. If your TT templates seem
messy, it may be because you're trying to do too much application logic in
them. It's best to avoid things like the DBI plugin and do all the real
work before you run the template.
- Perrin
think it's not working properly? You should get
one connection for each httpd process, and then no more.
- Perrin
.
Maybe the thing you're missing is that mod_proxy takes care of the lingering
close. Those of us who have tried the two-server setup have all seen
dramatic reductions in the number of mod_perl processes required.
- Perrin
.
- Perrin
be a little faster than it is. Are there any performance issues I
should
be aware of with IPC::Shareable or shared mem in general?
Yes, shared memory can be pretty slow. You should look at Cache::Cache
(specifically the file cache) or MLDBM::Sync.
- Perrin
be one @INC for
all VirtualHosts as well. Things like PerlVINC cheat by messing with @INC
on each request.
- Perrin
Template Toolkit to generate our
httpd.conf and startup.pl with local paths during the install. For simpler
localization, you could just use a couple of substitutions, or you could try
playing with MakeMaker.
- Perrin
-toolkit.org). You might even be able to write a
converter for your JSP pages. If you're interested in getting some
object/relational mapping features and a basic MVC structure thrown in as
well, you can check out OpenInteract (http://openinteract.org/).
- Perrin
What really makes mod_perl better than Java?
This is a common thread, which you should look up in the archives. It's
best to avoid starting up a discussion with this vague a question, since it
will lead to a flood of advocacy e-mails.
Didn't the eToys guys do some benchmarking? (Perrin?)
We
i am not sure what they are using mod_perl for.
Ticketmaster.com also owns CitySearch.com. They run CitySearch.com on
mod_perl. You may want to check back on Ticketmaster.com in a few months.
- Perrin
calls
$r-post_connection(). Is that replacing existing cleanup handlers? I
thought post_connection()/register_cleanup() pushed handlers on the
stack rather than replacing them.
- Perrin
debugging statements in to find out
what's being called? If you could put something in
Apache::SizeLimit::exit_if_too_big() and something in
CGI::_reset_globals(), maybe we can get to the bottom of this.
- Perrin
401 - 500 of 1298 matches
Mail list logo