473,398 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

mod_perl - dbi - DBD:Pg performance test, old vs new

Hi there mod_perl/Pg folks,

I have 2 systems, one OLD,
(linux 2.4 running postgresql-7.2.1-5 with a perl web db on
Apache/1.3.23 mod_perl 1.26 and dbi 1.37 with peristent db connections
via apache:dbi. )

The other system is NEW, which i am demoing
(running the same web app on linux 2.6 postgresql-7.4.2-1 w/
Apache/2.0.49 & mod_perl/1.99_12 & apache:dbi. (this one fedora core
2))

Both systems have almost identical hardware, and have had the same
tweaks made to pg - at least all I can rack out of my brain –

<pg stuff>
their SYSV shared mem increased to 128mb
shared_buffers = 15200
sort_mem = 32168
effective_cache_size = 4000
</pg stuff>

I have one page where I run the same query 155 times. (Whew! I know
it sucks, but it is what raises the question.) On the old server, it
loads in 1.5 seconds. On the new server, with the same data, it takes
6. I am trying to find out why.

I think this has something to do with either DBI or Apache or
mod_perl(is that all?), as it is a pretty simple loop, DBhandle is
there the whole time, i just prepare a new sth and execute it, read
back the rows, rinse repeat. It is the same code.

I know pg performance tuning better than mod_perl, so heres that info:

It is your standard join query:

explain select ts.id, ts.start, to_hours(ts.hours) as hours,
ts.emp_id, ts.finish, ts.so_id, ts.lowdown, so.customer, so.summary,
so.status, ts.status as ts_status from ts inner join so on
so.id=ts.so_id where emp_id=? and start between ? and ?

My table is ~10MB, so I am expecting pg should be able to get it all
buffered in shared mem. If I EXPLAIN it they are both doing the same
thing – using an index on each table.

7.2 –
=#
NOTICE: QUERY PLAN:

Nested Loop (cost=0.00..12.04 rows=1 width=176)
-> Index Scan using ts_empid_start_idx on ts (cost=0.00..6.02
rows=1 width=76)
-> Index Scan using so_id_key on so (cost=0.00..6.01 rows=1
width=100)
7.4 –
Nested Loop (cost=0.00..12.09 rows=2 width=172)
-> Index Scan using ts_empid_start_idx on ts (cost=0.00..6.02
rows=1 width=76)
Index Cond: ((emp_id = 1) AND ("start" >= '2004-01-01
00:00:00'::timestamp with time zone) AND ("start" <= '2004-01-04
00:00:00'::timestamp with time zone))
-> Index Scan using so_id_key on so (cost=0.00..6.01 rows=1
width=100)
Index Cond: (so.id = "outer".so_id)

Watching processes, pg is doing a lot of work on the new box - apache
also seems to be logging more cycles but it is 70% Pg. So I am
looking for experts to hopefully point me in the right direction to
why this may be happening. One thing I did notice, my old (faster)
server has pg processes using 37mb of RAM, each. On the new server,
they are only using 8. The table is larger than 8MB but I thought I
read that table caching is done in IPC cache mem, not process mem.

Thank you for your interest!! Any comments welcome.
Jul 19 '05 #1
0 2980

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Tim Nelson | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** I am a newbie try to port my applications to Postgres. I have an application that is bulk loading a table with autocommit off (with...
0
by: Piotr B. | last post by:
Hello, I want to make use of a Perl script "ora2pg" (Oracle to PostgreSQL schema converter), which requires the following modules: DBI, DBD::Oracle and DBD::Pg. As I don't use Perl on a...
0
by: Envex Developments | last post by:
Hey guys, I have a need to install the DBD::Pg Perl module on many shared web servers, which do not have PostgreSQL installed. Then the DBD::Pg module will just connect to a remote PostgreSQL...
0
by: Envex Developments | last post by:
Hey guys, I have a need to install the DBD::Pg Perl module on many shared web servers, which do not have PostgreSQL installed. Then the DBD::Pg module will just connect to a remote PostgreSQL...
0
by: Alex | last post by:
Hi, I am using DBD::Pg in some of my scripts. I want to customize the error login based on the error received. While I am happy with the Errstr message I want to take specific actions depending...
10
by: Ausrack Webmaster | last post by:
Hi I am trying to insert a simple email address into a text field, and I get the below error: DBD::Pg::st execute failed: ERROR: pg_atoi: error in "<support@somedomain.com>": can't parse...
11
by: greg | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 A new version of DBD::Pg is about to be released (1.32), and we need your help to test it out. If you use DBD::Pg, please download and test the...
4
by: Patrick Hatcher | last post by:
Pg: 7.4.2 I use perl scripts to import data into my db. When errors occurred uploading files in Pg ver 7.3.x, $DBI::errstr used to return a row number from the input file. I could then go to...
2
by: David Siebert | last post by:
Anyone using Activestate Perl and DBD-Pg? I am using perl 5.8.3 ppm does not seem to work. I downloaded the DBD-Pg ..zip file I found through google but ppm could not seem to install that. Any...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.