CORE::format() and CORE::write() under 5.6.x

2001-04-22 Thread Stas Bekman

There is this entry in the guide:


The interface to file handles which are linked to variables with
Perl's tie() function is not yet complete. The format() and write()
functions are missing. If you configure Perl with Csfio, write() and
format() should work just fine.


Is this still true under 5.6.x?

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/





Re: Fast DB access

2001-04-22 Thread Murali V

We fully support this view.

Why Databases... just read this mail.
There are only 2 tracks
a) Totally off-track discussing oracle.
b) Other track making us defend our benchmarks.(Wish we had not used the
word benchmark)

People are saying either this benchmark is bad or all benchmarks are
useless.

I get a feeling that the point we were trying to make is going to be missed.
MLDBM is not a bad alternative to databases under specific conditions !!

Murali
- Original Message -
From: Perrin Harkins [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; Joe Brenner [EMAIL PROTECTED]
Sent: Thursday, April 19, 2001 4:13 AM
Subject: Re: Fast DB access


  "Chutzpah" is an interesting way of putting it.  I've been thinking
  of them as "slimeballs in the busy of conning webkids into
  thinking they have a real RDBM product".
 
  (It isn't a moot point, because it's the same people working on
  it: human character issues are actually relevant when making
  technical decisions.)

 Why does discussion of databases - possibly the most boring subject on the
 planet - always degenerate to name-calling?

 MySQL is an excellent solution for a wide range of problems, as are dbm
 files and flat files.  The developers give the code away for free, and do
 not hide the fact that it doesn't support transactions.  There's no need
for
 this kind of vitriol.

 - Perrin





Re: Fast DB access

2001-04-22 Thread Murali V



Hi,

We've continuing this discussions

Reponses to queries raised in the last 24 
hours.

WIM  Could you post the SQL statements used to 
create the tables as well?
See our posting on April 17th. Our attachments have 
the create table sql too.

CLAYTON  [drfrog]$ perl fast_db.plCLAYTON  postgresCLAYTON   16 wallclock secs ( 0.05 usr + 
0.00 sys = 0.05 CPU) @ 400.00/s (n=20)CLAYTON 
 mysqlCLAYTON 
 3 wallclock secs ( 0.07 usr + 0.00 sys 
= 0.07 CPU) @ 285.71/s (n=20)CLAYTON  
postgresCLAYTON   
17 wallclock secs ( 0.06 usr + 0.00 sys = 0.06 CPU) @ 333.33/s 
(n=20)CLAYTON  mysqlCLAYTON  3 wallclock secs ( 0.01 usr + 
0.01 sys = 0.02 CPU) @ 1000.00/s (n=20)
MATHEW  Again, checkout PostgreSQL 7.1 -- I 
believe "commit" and "rollback" (asMATHEW  
you put it) are available. BTW, I would like to see that comment 
aboutMATHEW  MS-Access posted to 
pgsql-general... I dare ya. :P
We were saying the mySQL is a shocker that they 
were justifying lack of commit and rollback. We have no complaints with pg on 
the features front. 

Several people have recommended pg 7.1
We take this as valid feedback. We'll install and 
use pg 7.1 

MATHEW  I'm on several postgresql mailing lists and couldn't find a 
recent postMATHEW  from you complaining about 6.5.3 performance problems 
(not even by anMATHEW  archive search). Your benchmark is worthless 
until you try postgresqlMATHEW  7.1. There have been two major releases 
of postgresql since 6.5.x (ie.MATHEW  7.0 and 7.1) and several minor 
ones over a total of 2-3 years. It's noMATHEW  secret that they have 
tremendous performance improvements over 6.5.x. SoMATHEW  why did you 
benchmark 6.5.x?
I've not posted anything to postgres newsgroups for a long... time. I was 
too cheesed off. They kept defending postgres without accepting/solving 
problems. Let's not go into this

We are as of now ignoring any discussions into Oracle... etc., We would be 
glad to hear more suggestions on our benchmark.

Several people complain that this is not a fair test. We are not 
professionals in benchmarking. Rather we are software developers using 
benchmarks as a way of choosing among alternatives.
If peoplehave specific suggestions on ways of improving our benchmark 
we will be very happy.
Also, welcome are links on how to design and run these benchmarks for 
amateurs like us.

Thanks and Regards,

S Muthu Ganesh  V Murali
Differentiated Software Solutions Pvt. Ltd.,90, 3rd Cross,2nd Main, 
Ganga Nagar,Bangalore - 560 032Phone : 91 80 3631445, 
3431470Visit us at www.diffsoft.com
- Original Message - 

  From: 
  Differentiated Software 
  Solutions Pvt. Ltd., 
  To: [EMAIL PROTECTED] 
  Sent: Tuesday, April 17, 2001 4:41 
  PM
  Subject: Fast DB access
  
  Hi,
  
  A few months back we asked modperl mailing list 
  on alternate methods of DB access to postgres (with the same subject). We got 
  some decent alternatives. We are putting back some of the work we have done on 
  this issue.
  
  We had a project to program an ad server. This is 
  not really an OLTP application, i.e., we hada few screens where some 
  data is captured. Based on this data we had to pick up an advertisement to 
  serve it.
  Essence of the application is to have a highly 
  scaleable program to deliver ads... which means we wanted a method to be able 
  to pickads given a criteria and choose one among them.
  We had written a benchmark program, after which 
  we decided to go for MLDBM for our purposes.
  Though this is not directly related to modperl, 
  we are taking the liberty of posting this message. We hope you find it 
  useful.
  
  Specification and results of the benchmark is as 
  follows
  
  Objective : To choose one of the alternate access 
  methods for an read-only DB program
  
  Program logic :
  Choose row from a table which has a composite key 
  containing4 attributes.
  The4attributes which we used are 
  publishers, size, type and ip number
  Given values of these4 attributes, we get a 
  list ofadvertisements for these attributes.
  In the live application we will choose one these 
  ads based on a weighted random number.
  For the purpose of benchmark we want to create a 
  hash or hash reference of the ads given these 4 criteria
  
  Benchmark Data :
  Our benchmark data consists of 100 
  publishers,3 sizes, 4 types and 20 ip numbers which makes it a data 
  structure containing 24,000 combination of attributes. Each combination in 
  turn contains 10 advertisements
  
  Benchmark alternatives :
  We have populated this data into
  a) A pure in memory multi-level hash : Before 
  starting the actual benchmark the program populates a multi-level hash... each 
  of which finally points to the advertisements. Objective is to pick the last 
  level hash of advertisements
  b) Flat file : Create a Linux directory structure 
  with the same hierarchy as the attributesi.e., directory structure has 
  publishers/sizes/types/ip numbers. ip numbers 
  is the file name which contains 

Re: Must restart Apache when any .pm changes?

2001-04-22 Thread Dave Rolsky

On Sat, 21 Apr 2001, Steve Leibel wrote:

 I believe the way this works is that the first time any Apache child
 process sees "use Foo" that is the version of Foo.pm that will be
 used by that process.  No subsequent "use Foo" within components will
 have any effect during the life of that Apache process.

 Am I understanding this correctly?

Yes, mostly.  Check out the Apache::Reload module though.  It does what I
think you want.


-dave

/*==
www.urth.org
We await the New Sun
==*/




Re: Must restart Apache when any .pm changes?

2001-04-22 Thread Issac Goldstand

man Apache::StatINC

  Issac

Internet is a wonderful mechanism for making a fool of
yourself in front of a very large audience.
  --Anonymous
 
Moving the mouse won't get you into trouble...  Clicking it might.
  --Anonymous
 
PGP Key 0xE0FA561B - Fingerprint:
7E18 C018 D623 A57B 7F37 D902 8C84 7675 E0FA 561B

- Original Message - 
From: "Steve Leibel" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, April 22, 2001 4:14 AM
Subject: Must restart Apache when any .pm changes?


 I'm experimenting with using Perl modules (.pm files) underneath 
 Mason components.
 
 As far as I can see, the only way to guarantee that changes made in 
 the .pm are seen by the Mason code is to restart Apache whever the 
 .pm file changes.  This is true whether the "use" statement is in 
 handler.pl or in the component.
 
 I believe the way this works is that the first time any Apache child 
 process sees "use Foo" that is the version of Foo.pm that will be 
 used by that process.  No subsequent "use Foo" within components will 
 have any effect during the life of that Apache process.
 
 Am I understanding this correctly?
 




Apache::AuthDBI

2001-04-22 Thread Christian Heiss




Hi,


I’m using Apache::AuthDBI to verifying the 
users on my web site.

I can connect to 
thethe 
protected site, but there is a output in the error log:

Use 
of uninitialized value at /usr/lib/perl5/site_perl/5.005/Apache/AuthDBI.pm line 
450
Use 
of uninitialized value at /usr/lib/perl5/site_perl/5.005/Apache/AuthDBI.pm line 
480
Use 
of uninitialized value at /usr/lib/perl5/site_perl/5.005/Apache/AuthDBI.pm line 
481


To crypt the the passwords I'm using something like 
this:

my $userid = $query-param('userid');my 
$pass = $query-param('pass');my $groupid = 
$query-param('groupid');my $fullname = 
$query-param('fullname');$pass = crypt("$pass", 
"$userid");


then I put it in the database 
with:

my $sql = "INSERT INTOtable 
nameVALUES($userid, $groupid, $pass, 
...);
of course, before I'm using the quote funktion 
($dbh-quote($userid)...)...


and my .htacces is:

PerlModule Apache::AuthDBIAuthName "something 
else"AuthType BasicPerlAuthenHandler 
Apache::AuthDBI::authenPerlAuthzHandler 
Apache::AuthDBI::authzPerlSetVar Auth_DBI_encrypted onPerlSetVar 
Auth_DBI_data_source 
dbi:mysql:database
PerlSetVar Auth_DBI_username user 
name
PerlSetVar Auth_DBI_password 
passwordPerlSetVar Auth_DBI_pwd_table table 
name
PerlSetVar Auth_DBI_uid_field userid 
fieldPerlSetVar Auth_DBI_grp_field groupid 
field
PerlSetVar Auth_DBI_pwd_field password 
field

require valid-user

allow from all




Anybody knows how to stop this error 
output?

Thanks a lot

Christian 
Heiß


Re: Initializing CGI Object from $r

2001-04-22 Thread Mark Maunder

Hi,

CGI accepts filehandles, hashref's, manually typed query string and
another CGI object. (type 'perldoc CGI'). You don't want to pass it any
of these because they're mainly used for debugging. Just create an
instance of CGI without passing it any params. Since you're writing a
handler I assume you're just using CGI for it's HTML routines and not to
retreive POST or GET data.  You want to use the Apache modperl modules
as far as possible for getting input data and outputting headers, HTML
etc.



Wade Burgett wrote:

 Can I initilize a new CGI object just by passing in a request from a
 handler?
 ie

 sub handler {

 my $r = shift;
 my $CGIQuery = new CGI($r);

 };

--
Mark Maunder
[EMAIL PROTECTED]
http://swiftcamel.com/

 Try not.
 Do.
 Or do not.
 There is no try.
 ~yoda







Cookies in PerlAccessHandlers

2001-04-22 Thread Alec Smith

In a PerlAccessHandler I have code similar to the following:

sub handler
{
my $r = shift;
my ($cgi, $cookie);

use CGI;
$cgi = new CGI;
$cookie = $cgi-cookie(-name = 'test');

# For debugging only
open(TEST, "/tmp/accesstest");
flock(TEST,2);
print TEST "cookie = $cookie";
close(test);

# This if block is not included in the PerlHandler version
if ($cookie eq '')
{
return FORBIDDEN;
}
}

However, nothing is written to the log file and the forbidden screen is
displayed. The exact same code works fine if its in a regular mod_perl module
installed using PerlHandler. Why is the code working inside a PerlHandler
module and not in PerlAccessHandler?

The system in question is running Apache 1.3.19+mod_perl 1.25+Perl
5.005_03 (RedHat 6.2).

Thanks,
Alec




Perl Config for VirtualHosts

2001-04-22 Thread Steven Vetzal



Hi 
Folks,

I've been 
grappling with this for a while, and was wondering if anyone could help me 
out...

I'm trying 
to set up a series of VirtualHost sections in httpd.conf using Perl. I want to 
set the PerlHandler for the VirtualHost to "perl-script", but I want to define 
several Location sections with the PerlHandler set to 
"default-handler".

I'm using a 
structure like this to define the VirtualHost sections (the $xp is an XPath 
object using Matt Sergeant's XML::XPath module):

 $region = 
$xp-findvalue("./\@region", 
$instance); $address = 
$xp-findvalue("./address", 
$instance); $sitename = 
$xp-findvalue("./name", 
$instance); $admin = 
$xp-findvalue("./admin", 
$instance); $ext = 
$xp-findvalue("./ext", $instance);

 
$VirtualHost{"$sitename:8080"} = 
{ 
ServerAdmin = 
"$admin", 
DocumentRoot = 
"/home/httpd/web/$appname/web/pub", 
ServerName = 
"$sitename", 
ErrorLog = 
"/home/httpd/var/logs/apache/$appname.error_log", 
TransferLog = 
"/home/httpd/var/logs/apache/$appname.transfer_log", 
PerlSetVar = "Region 
$region", 
SetHandler = 
"perl-script", 
PerlHandler = 
"HTML::Mason", 
};
Now this 
works great - everything is cool. However if I add the following to the 
$VirtualHost{} assignment:

 
Location = [ "/ext" = { 
SetHandler = "default-handler" } ],

Or if I try 
to set up an assignment outside that structure with:

 
$VirtualHost{"$sitename:8080"}-{Location} = ( [ "/ext" = { 
SetHandler= "default-handler" 
}, 
"/images" = { SetHandler = "default-handler" 
}, 
] );
I get an error 
like:

[Sat Apr 21 
23:06:30 2001] [error] (22)Invalid argument: Perl: Invalid command 
'Location', perhaps mis-spelled or defined by a module not included in the 
server configuration

I'm really not 
sure about my structure syntax - I've got an Alias directive I managed to get 
working, and modelled the Location stuff after it, but I just can't get this 
sucker to go. I'm finding the mod_perl guidea little vague, talking only 
about Location asa discreet variable (which I assume is server global?), 
and I'm just not getting how to do this within the scope of a 
VirtualHost...

Steve



Must restart Apache when any .pm changes?

2001-04-22 Thread Steve Leibel

I'm experimenting with using Perl modules (.pm files) underneath 
Mason components.

As far as I can see, the only way to guarantee that changes made in 
the .pm are seen by the Mason code is to restart Apache whever the 
.pm file changes.  This is true whether the "use" statement is in 
handler.pl or in the component.

I believe the way this works is that the first time any Apache child 
process sees "use Foo" that is the version of Foo.pm that will be 
used by that process.  No subsequent "use Foo" within components will 
have any effect during the life of that Apache process.

Am I understanding this correctly?



Re: Fast DB access

2001-04-22 Thread Murali V

Hi,

If you read the code more deeply, you'll find that the timeit is only
wrapped around select and not around insert.
We've written the insert code so that in the first round you can populate
the database.
You comment out the insert code after the first round and run the benchmark
several times. This would only do select and time select.

Connecting this error to an axiom that "Benchmarks are useless" is bad
indeed. Shouldn't we be ironing out errors and runing benchmarks which are
good.

Your recommendation is to pick a DB best suited to your app. But How ??
a) Either by hiring a guru who has seen all kinds of apps with different DBs
who can give you the answer with which we can run
b) Run a benchmark on critical programs which represent you app across
databases and find what performs best.
I've read too much literature on DB features. All DBs have all features
(except MySQL which does not have commit )
You can't make a thing out of DB literature.

We believe that we have extracted the core of our application in this small
program. We also believe that there will be many more such applications
which will benefit from this benchmark.
Clearly if there is a non-transactional system (System with heavy selects
and very few updates), they can use this benchmark as a relative comparison
among different access methods.

Wakeup Cees. you can't just preside over a discussion like this :-)

Thanks and Regards,

S Muthu Ganesh  V Murali
Differentiated Software Solutions Pvt. Ltd.,
90, 3rd Cross,2nd Main,
Ganga Nagar,
Bangalore - 560 032
Phone : 91 80 3631445, 3431470
Visit us at www.diffsoft.com

- Original Message -
From: Cees Hek [EMAIL PROTECTED]
To: Clayton Cottingham aka drfrog [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, April 19, 2001 8:08 PM
Subject: [OT] Re: Fast DB access


 On 18 Apr 2001, Clayton Cottingham aka drfrog wrote:

  [drfrog]$ perl fast_db.pl
  postgres
  16 wallclock secs ( 0.05 usr + 0.00 sys =  0.05 CPU) @ 400.00/s (n=20)
  mysql
   3 wallclock secs ( 0.07 usr + 0.00 sys =  0.07 CPU) @ 285.71/s (n=20)
  postgres
  17 wallclock secs ( 0.06 usr + 0.00 sys =  0.06 CPU) @ 333.33/s (n=20)
  mysql
   3 wallclock secs ( 0.01 usr + 0.01 sys =  0.02 CPU) @ 1000.00/s (n=20)
 
 
  correct me if im wrong but if fast_db.pl is
  working right
  first set is insert
  second set is select

 I am mad at myself for getting dragged into this, but I couldn't help
 myself...

 You are crippling postgreSQL by doing a tonne of inserts with a commit
 after each statement.  This completely misses the fact that postgreSQL is
 transaction based whereas MySQL is not.  Turn off AutoCommit and do a
 commit at the end of the insert loop.

 Also, if your selects are taking just as long as your inserts then you
 must have other problems as well.  Did you set up any indeces for the
 columns of your table, or is that considered "optimizing the database" and
 therefore not valid in your benchmark?

 Benchmarks like this are pretty much useless (actually 99% of all
 benchmarks are useless).

 Use the database that best fits your needs based on the features it
 supports, and the experience you have using it.  If you find your database
 is too slow, look into optimizing it because there are usually hundreds of
 things you can do to make a database faster (faster disks, more ram,
 faster CPU, fixing indeces, optimizing queries, etc...).

 Don't pick a database because a benchmark on the web somewhere says it's
 the fastest...

 Sorry for the rant, I'll go back to sleep now...

 Cees

 
  find attached the modified ver of fast_db.pl
  i sued to conduct this test
 
 
  comp stats
  running stock rpms from mandrake 7.2 for both
  postgresql and mysql
   3.23.23-beta of mysql and
  7.02 of postgresql
 
  [drfrog@nomad desktop]$ uname -a
  Linux nomad.localdomain 2.2.18 #2 Tue Apr 17 22:55:04 PDT 2001 i686
unknown
 
  [drfrog]$ cat /proc/meminfo
  total:   used:free:  shared: buffers:  cached:
  Mem:  257511424 170409984 87101440 24219648 96067584 44507136
  Swap: 2549432320 254943232
  MemTotal:251476 kB
  MemFree:  85060 kB
  MemShared:23652 kB
  Buffers:  93816 kB
  Cached:   43464 kB
  SwapTotal:   248968 kB
  SwapFree:248968 kB
  [drfrog]$ cat /proc/cpuinfo
  processor : 0
  vendor_id : AuthenticAMD
  cpu family : 6
  model : 3
  model name : AMD Duron(tm) Processor
  stepping : 1
  cpu MHz : 697.535
  cache size : 64 KB
  fdiv_bug : no
  hlt_bug : no
  sep_bug : no
  f00f_bug : no
  coma_bug : no
  fpu : yes
  fpu_exception : yes
  cpuid level : 1
  wp : yes
  flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat
  pse36 psn mmxext mmx fxsr 3dnowext 3dnow
  bogomips : 1392.64
 
 
 
  i will recomp both the newest postgresql and  mysql
 
  not using any optimizing techs at all i'll post the
 
  config scripts i use
  On Tue, 17 Apr 2001 18:24:43 -0700, clayton said:
 
   Matt Sergeant wrote:
  
 On Tue, 17 Apr 2001, Differentiated Software 

sighandler restoration under 5.6.x

2001-04-22 Thread Stas Bekman

Another perl 5.6.x question:

According to
http://theoryx5.uwinnipeg.ca/cgi-bin/guide-filter?page=debug/Debugging_Signal_Handlers_SIG_.html;query=ALRM;match=and;where=all;stem=no
Perl does not restore the original Apache C handler when you use the local
$SIG{FOO} clause under mod_perl (mod_perl provides an internal workaround
for SIGALRM).

According to one of the old emails from Doug, this should have been fixed
in 5.6.x. I read the perldelta page and didn't see this issue mentioned.
Have I missed it? (the page was so long...)

Thanks!

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/





Re: Must restart Apache when any .pm changes?

2001-04-22 Thread Kee Hinckley

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

At 5:36 AM +0200 4/22/01, Issac Goldstand wrote:
man Apache::StatINC

   Issac

Apache::Reload seems better.  But if you have "use lib" statements in 
your code you'll need some patches to it that I don't believe have 
been released yet.
- -- 

Kee Hinckley - Somewhere.Com, LLC
http://consulting.somewhere.com/consultants.html#kee

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use http://www.pgp.com

iQA/AwUBOuL/CyZsPfdw+r2CEQL6OACfeNOrBhEepJYa5gXlxEKBkr6fK7QAn26P
QJDqxJUeiv6lxAEhF4epMjtp
=Q3Cf
-END PGP SIGNATURE-



Re: Must restart Apache when any .pm changes?

2001-04-22 Thread Matt Sergeant

On Sun, 22 Apr 2001, Kee Hinckley wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 At 5:36 AM +0200 4/22/01, Issac Goldstand wrote:
 man Apache::StatINC
 
Issac

 Apache::Reload seems better.  But if you have "use lib" statements in
 your code you'll need some patches to it that I don't believe have
 been released yet.

Actually that's a good prod - I'll try and put out a new release this
weekend.

-- 
Matt/

/||** Founder and CTO  **  **   http://axkit.com/ **
   //||**  AxKit.com Ltd   **  ** XML Application Serving **
  // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
 \\//
 //\\
//  \\




Re: Perl Config for VirtualHosts

2001-04-22 Thread Nikolaus Rath

* Steven Vetzal [EMAIL PROTECTED] wrote:
Location= [ "/ext" = { SetHandler = "default-handler" } ],
^   ^

Shouldn't this be { .. }?

 --_=_NextPart_001_01C0CADA.7F31E412
 Content-Type: text/html;
   charset="iso-8859-1"
 Content-Transfer-Encoding: quoted-printable


brrr

  - Nikolaus

-- 
"de.alt.comp.kdeDumm und trotzdem UNIX verwenden? KDE ist die Loesung."
Sven Paulus in 67hu21$43r$[EMAIL PROTECTED]




Re: Apache::AuthDBI

2001-04-22 Thread Edmund Mergl

Christian Heiss wrote:

and my .htacces is:
---
PerlModule Apache::AuthDBI
AuthName "something else"
...


how does your startup.pl look like ?
The configuration 'PerlModule Apache::AuthDBI'
is not supposed to be in .htaccess. Also it
would be helpful to know the version of ApacheDBI.


Edmund

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



ANNOUNCE: Apache::Reload 0.07

2001-04-22 Thread Matt Sergeant

This is a minor update as promised with some patches from a couple of
sources to help reload when "use lib" is in effect.

Let me know if it works (or doesn't) please.

-- 
Matt/

/||** Founder and CTO  **  **   http://axkit.com/ **
   //||**  AxKit.com Ltd   **  ** XML Application Serving **
  // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
 \\//
 //\\
//  \\




unsuscribe

2001-04-22 Thread ka0z

unsuscribe

---
Este mensaje fue enviado mediante Web E-mail de MegaRed
INTERNET POR CABLE 
http://www.megared.net.mx




Re: [OT] Re: Fast DB access

2001-04-22 Thread Murali V

Thanks for pointing out the mistake in postgres.
Your Advice makes lots of sense.

V Murali
- Original Message -
From: Cees Hek [EMAIL PROTECTED]
To: Murali V [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, April 20, 2001 1:45 AM
Subject: [OT] Re: Fast DB access



 On Thu, 19 Apr 2001, Murali V wrote:

  Hi,
 
  If you read the code more deeply, you'll find that the timeit is only
  wrapped around select and not around insert.
  We've written the insert code so that in the first round you can
populate
  the database.
  You comment out the insert code after the first round and run the
benchmark
  several times. This would only do select and time select.
 

 Hi Murali,

 OK, to start off, I was not specifically aiming my rant at you, I was
 replying to someone who had modified your code and was now comparing MySQL
 and PostgreSQL, and he was implying that the timings were for inserts and
 selects.  I took this at face value, and didn't check the code close
 enough which I really should have done in the first place.

  Connecting this error to an axiom that Benchmarks are useless is bad
  indeed. Shouldn't we be ironing out errors and runing benchmarks which
are
  good.

 Perhaps I should have said published benchmarks.  In your case, you are
 using benchmarks for exactly what they are intended for...  Creating a
 system that closely resembles your application and putting it through it's
 paces.  What I find dangerous about publishing benchmarks, is that they
 are almost always heavily swayed to a specific application, and most of
 the time they show what the user wants them to show.

 In your original message, you clain to have a bias against Postgres, and
 your benchmark shows that bias.  I however am a happy user of postgres,
 and am therefore biased towards it.  I modified your benchmark script
 slightly, and I got the following results (I have include a diff of my
 changes at the bottom):

 postgres
  0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU)
 postgres
  0 wallclock secs ( 0.02 usr +  0.00 sys =  0.02 CPU)

 Whereas if I run it with your version I get the following:

 postgres
 27 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)
 postgres
 27 wallclock secs ( 0.02 usr +  0.00 sys =  0.02 CPU)

 So what does that tell you about the benchmark?  that the postgres part of
 this benchmark is useless...  It may have given you the answer that you
 wanted, but it is misleading to anyone else out there.

 This is why there are always flame wars about benchmarking databases (by
 the way I think this whole thread has been very civilized and i hope is
 stays that way).  Invariably the benchmark has missed some critical idea
 or optimization which drastically skew the results.

  Your recommendation is to pick a DB best suited to your app. But How ??
  a) Either by hiring a guru who has seen all kinds of apps with different
DBs
  who can give you the answer with which we can run
  b) Run a benchmark on critical programs which represent you app across
  databases and find what performs best.
  I've read too much literature on DB features. All DBs have all features
  (except MySQL which does not have commit )
  You can't make a thing out of DB literature.

 What I would recommend is exactly what you have done in this case.  Get
 access to any and all the systems that you feel may do the job for you ,
 and try them out.  Browse the web for other users experiences, but don't
 use other peoples benchmarks, because the odds are good that they are
 wrong...  Create your own, or modify an existing one, and scrutinize
 exactly what it is doing.  And if you want to share your results with
 anyone else, tell them what you choose in the end, and why.  Tell them you
 choose database x because it did this and this for you.  Don't say
 database y is a piece of crap, so we went with database x.

 But whatever you do, don't choose your database based on other peoples
 benchmarks (that is all I'm trying to say, and I guess I didn't
 say it clearly enough)

 When I first read your message, I tucked it away somewhere, so I could
 reference it again in the future, because I was interested in the MLDBM
 work that you had done, and I thank you for that.  But it also made me
 think that maybe I shouldn't be using Postgres, because your results were
 so poor (only for a second or too though :).  But I'll bet that a lot of
 people who have never used postgres before are now less likely to download
 it and try it out for themself, because a benchmark swayed them away from
 it.  That sounds like a good closer, so I'll stop it there :-)


 Cees


 Here is the diff of my changes and a quick comment on why your way kills
 the performance of postgres

 ***
 *** 124,131 
 $i_ip = int(rand(20));

 @row_ary = $dbh-selectrow_array(select crr from
benchmark where
 !   rtrim(pub) = 'pub$i_pub' and rtrim(size) =
'size$i_size' and
 !

[job] need a perl guru?

2001-04-22 Thread Ivan Kohler

mod_ and regular flavours.

http://420.am/~ivan/resume.html

-- 
meow
_ivan



Patches for perl 5.6.1, Apache and modperl for the AIX 4.3 native dlopen

2001-04-22 Thread Jens-Uwe Mager
 PGP message