Re: performance question

From: Alfred Perlstein <bright(at)wintelcom(dot)net>
To: ernie cline <ernie(dot)cline(at)ipgdirect(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: performance question
Date: 2000-07-13 20:35:37
Message-ID: 20000713133537.S25571@fw.wintelcom.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

* ernie cline <ernie(dot)cline(at)ipgdirect(dot)com> [000713 11:57] wrote:
> Tom Lane wrote:
> >
> > ernie cline <ernie(dot)cline(at)ipgdirect(dot)com> writes:
> > > Quick question. I am using postgres 7.0. When running a select query,
> > > does postgres lock the row (or table) while doing a select? Only on an
> > > insert/update/delete, right?
> >
> > SELECTs certainly don't block each other (except the SELECT FOR UPDATE
> > variety).
>
> I kind of didn't think so, but I just wanted to make sure I wasn't
> insane. ;)
>
>
> > > We are experiencing some performance
> > > problems when running 2 programs that access the database at once (only
> > > doing querys, and not even complex ones).
> >
> > Need more detail ...
>
> What else do you need to know? Postgres 7.0 compiled with default
> options, running on a VA Linux Fullon box, kernel 2.2.13, running VA
> Linux/Redhat 6.1. Box is a single processor pentium 3 500mhz, 128megs
> of ram, apache 1.3.9. Using Perl DBI interface to access postgres. A
> very small html page is built (about 4.5k), and it takes about 2.6
> seconds to execute and build the html. Running 2 of the pages at once,
> it takes about 5 seconds for them to complete. Not total, but 5 for
> each one. This is using just unix 'time' command, and moving my mouse
> to another rxvt window and hitting enter after first hitting it in
> another window ;).
>
> Is using Perl DBI slow? Would writing the cgi in C speed things up?
> (Please no holy wars for perl vs. C performance! <G>)
> Any help would be appreciated ...

Before going to the extent of re-implementing your code I would just
print out the "time taken" for various things in your cgi like so:

print "\n<!--\nstarted $time\n-->\n";
# do query
print "\n<!--\nquery done $time\n-->\n";
# do something
print "\n<!--\nsomething done $time\n-->\n";
# do output
print "\n<!--\noutput done $time\n-->\n";

Then you can figure out where the problem is.

--
-Alfred Perlstein - [bright(at)wintelcom(dot)net|alfred(at)freebsd(dot)org]
"I have the heart of a child; I keep it in a jar on my desk."

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-07-13 20:58:54 Re: location of change list?
Previous Message Tom Lane 2000-07-13 20:11:48 Re: performance question