473,662 Members | 2,454 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.hou rs) 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.0 2
rows=1 width=76)
-> Index Scan using so_id_key on so (cost=0.00..6.0 1 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.0 2
rows=1 width=76)
Index Cond: ((emp_id = 1) AND ("start" >= '2004-01-01
00:00:00'::time stamp with time zone) AND ("start" <= '2004-01-04
00:00:00'::time stamp with time zone))
-> Index Scan using so_id_key on so (cost=0.00..6.0 1 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 3001

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

Similar topics

1
2453
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 it on it's way to slow). The logic of the application dictates that I try the insert, and if it fails because of a duplicate, update the record instead. The entire bulk load is wrapped in a transaction for speed purposes. When I hit a...
0
4657
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 regular basis, I've downloaded and installed ActivePerl 5.6.1.638 (Windows). Then, I installed DBI and DBD::Oracle using the PPM utility. But, unfortunately, I couldn't install DBD::Pg:
0
2384
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 database, hosted elsewhere. I'm having some problems doing this. First off, I modified the Makefile.PL, and added the three following links just above the check for environment variables:
0
2298
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 database, hosted elsewhere. I'm having some problems doing this. First off, I modified the Makefile.PL, and added the three following links just above the check for environment variables:
0
1141
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 on Errstr or Err. Is there a list of all available error number (err) with associated error message (errstr) that is produced by postgres? Is there something similar for JDBC ?
10
2913
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 "<support@somedomain.com>" I figure it is because of the < and @ in the value, but why does it take these as operators even
11
2317
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 latest release candidate. At the very least, running "make test" and reporting any problems would be of great help. The latest version can be found here:
4
1371
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 the file make whatever changes and continue. Since updating to 7.4.2, I no longer receive this information. I now have to go to psql and run the import and only then will I see the error row. Is there a newer version than 1.32 of DBD::Pg? TIA
2
3016
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 suggestions? ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
0
8343
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8856
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8545
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7365
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1992
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.