Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-21 Thread Michael Ludwig
Perrin Harkins schrieb: On Tue, Jan 20, 2009 at 4:19 PM, Michael Ludwig m...@as-guides.com wrote: On the other hand, performance isn't what you'd call great, as access to the database is effectively serialized. Are you sure about that? I'm sure about the queries seeming *effectively*

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-20 Thread Michael Ludwig
Mark Hedges schrieb: Just curious, did you try eliminating every other module that you might be loading (anywhere in any module loaded by Apache)? i.e. did you try a simple setup that only tries to open your database and does absolutely nothing else and loads no other CPAN modules. With use

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-20 Thread Michael Ludwig
A sidenote: I've built more or less the same Apache as a prefork MPM, and I'm not seeing any SEGVs any more. On the other hand, performance isn't what you'd call great, as access to the database is effectively serialized. Thirty queries will take thirty seconds, regardless of concurrency level.

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-20 Thread Perrin Harkins
On Tue, Jan 20, 2009 at 4:19 PM, Michael Ludwig m...@as-guides.com wrote: On the other hand, performance isn't what you'd call great, as access to the database is effectively serialized. Are you sure about that? Berkeley DB doesn't work that way. It has read and write locks which can be set

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-19 Thread Michael Ludwig
I've referenced this thread on the Oracle Berkeley DB forum. Chances are it'll catch the attention of one of the BDB experts. If you're interested, please see: http://forums.oracle.com/forums/thread.jspa?threadID=848390 Michael Ludwig

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-19 Thread Torsten Foertsch
On Sun 18 Jan 2009, Michael Ludwig wrote:  From perldoc perlthrtut: In this model each thread runs in its own Perl interpreter, and any data sharing between threads must be explicit. This does not sound to me as if there is a significant advantage over spawning child processes, at least not on

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-19 Thread Michael Ludwig
macke...@animalhead.com schrieb: Yes it is now Abend again. Timewise this is like relationships I have had with Philips (now NXP) European colleagues... And a new morning again, and it goes round and round ... On Jan 18, 2009, at 10:56 AM, Michael Ludwig wrote: macke...@animalhead.com

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-19 Thread Michael Ludwig
Torsten Foertsch schrieb: On Sun 18 Jan 2009, Michael Ludwig wrote: Hmm. Not sure what to make of this threaded Perl. In fact, it is worse than fork()ing off unix processes because the interpreter data is completely copied while a new interpreter is created. On the other hand a forked

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-19 Thread Torsten Foertsch
On Mon 19 Jan 2009, Michael Ludwig wrote: In fact, it is worse than fork()ing off unix processes because the interpreter data is completely copied while a new interpreter is created. On the other hand a forked process copies only those pages that are written to. Thanks. If I'm

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-19 Thread Michael Ludwig
Torsten Foertsch schrieb: Of course it depends on your setup. If you configure only a small number of interpreters then the overall memory footprint can be lower then with prefork where each process runs its own interpreter. But the effect of the copied interpreters outweighs this very soon. I

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-18 Thread Michael Ludwig
macke...@animalhead.com schrieb: What I did to get worker and event working under FreeBSD 6.3, was to eliminate the child_init handler, and at the start of the response handler do something like my $env; sub handler { # this is the response handler my ($r) = @_; if (!$env) {

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-16 Thread Michael Ludwig
Mark Hedges schrieb: On Thu, 15 Jan 2009, Michael Ludwig wrote: PerlRequire /home/milu/www/eumel/startup.pl PerlChildInitHandler Eumel::Gurke::bla; PerlChildExitHandler Eumel::Gurke2::bla; No trailing semicolons? That was a copy and paste error when composing the mail. But this is an

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-16 Thread Michael Ludwig
macke...@animalhead.com schrieb: Apache is forgiving/robust about specifying nonexistent phase handlers in httpd.conf and inserts thereto. Thanks. I noticed. :-) I was using event, and had to let each thread open its own DBs based on an undefined global. Then I found that the identical

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-16 Thread Adam Prime
macke...@animalhead.com wrote: Apache is forgiving/robust about specifying nonexistent phase handlers in httpd.conf and inserts thereto. I was using event, and had to let each thread open its own DBs based on an undefined global. Then I found that the identical traffic-test exerciser could get

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-16 Thread mackenna
I started with 'worker', and it had similar performance to what I saw thereafter with 'event'. Actually slightly better, perhaps because 'event' gained no advantage from KeepAlive because each test process stayed locked to one connection. 'worker' and 'event' were experiments that I decided to

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-16 Thread Michael Ludwig
Mark Hedges schrieb: *** glibc detected *** free(): invalid pointer: 0x084e6a14 *** If this didn't work in a response handler, I'd guess there's something else wrong. That's the kind of error you get when you use things under threads that are not thread-safe in some way, I remember that sort

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-16 Thread mackenna
What I did to get worker and event working under FreeBSD 6.3, was to eliminate the child_init handler, and at the start of the response handler do something like my $env; sub handler { # this is the response handler my ($r) = @_; if (!$env) { $env = DbEnv-new;

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-15 Thread Michael Ludwig
Mark Hedges schrieb: Probably what you're thinking of is a PerlChildInitHandler so that each mod_perl child process does your connection for you when the child process first forks. Yes, that's what I thought. But then I noticed that the PerlChildInitHandler I set up is ignored. Apache

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-15 Thread Michael Ludwig
Mark Hedges schrieb: On Wed, 14 Jan 2009, Michael Ludwig wrote: I want to build a mod_perl2 application using Sleepycat::DbXml. This is However, I don't know how to do this. Currently, I'm trying to set up things in startup.pl (loaded via PerlPostConfigRequire), store the database environment

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-15 Thread mackenna
Apache is forgiving/robust about specifying nonexistent phase handlers in httpd.conf and inserts thereto. I was using event, and had to let each thread open its own DBs based on an undefined global. Then I found that the identical traffic-test exerciser could get 66 files/second back in event

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-15 Thread Mark Hedges
On Thu, 15 Jan 2009, Michael Ludwig wrote: PerlRequire /home/milu/www/eumel/startup.pl PerlChildInitHandler Eumel::Gurke::bla; PerlChildExitHandler Eumel::Gurke2::bla; No trailing semicolons? Probably if you first do PerlLoadModule Foo::Bar it will fail and inform you my $container =

Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-14 Thread Michael Ludwig
I want to build a mod_perl2 application using Sleepycat::DbXml. This is the Perl bindings to the C++ interface to Berkeley DB and Berkeley DB XML, developed by Sleepycat, now owned by Oracle (keywords: DbEnv, XmlManager, XmlContainer). Has anyone ever used this combination? Note I'm using

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-14 Thread Mark Hedges
On Wed, 14 Jan 2009, Michael Ludwig wrote: I want to build a mod_perl2 application using Sleepycat::DbXml. This is However, I don't know how to do this. Currently, I'm trying to set up things in startup.pl (loaded via PerlPostConfigRequire), store the database environment handle in a

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-14 Thread Michael Peters
cr...@animalhead.com wrote: I have a vague recollection of reading about the circumstances in which filehandles can be inherited, but can't remember where. I've been bitten by this a few times. Filehandles (and thus sockets) are inherited across forks. If your system isn't very busy you