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

Home Posts Topics Members FAQ

poor cpu utilization on dual cpu box


Folks,

I’m hoping someone can give me some pointers to resolving an issue with postgres and it’s ability to utilize multiple CPUs effectively.

The issue is that no matter how much query load we throw at our server it seems almost impossible to get it to utilize more than 50% cpu on a dual-cpu box. For a single connection we can use all of one CPU, but multiple connections fail to increase the overall utilization (although they do cause it to spread across CPUs).

The platform is a dual CPU 2.8Ghz P4 Xeon Intel box (hyperthreading disabled) running a fairly standard Redhat 9 distribution. We are using postgres on this platform with a moderate sized data set (some hundreds of megs of data). The tests perform no updates and simply hit the server with a single large complex query via a multithreaded java/jdbc client. To avoid network distortion we run the client on the localhost (its cpu load is minimal). We are running with shared buffers large enough to hold the entire database and sort memory of 64m, should easily be enough to prevent sorting to disk.

At this point I’ve tried everything I can think of to diagnose this - checking the pg_locks table indicates that even under heavy load there are no ungranted locks, so it would appear not to be a locking issue. Vmstat/iostat show no excessive figures for network or io waits. The only outlandish figure is that context switches which spike up to 250,000/sec (seems large). By all indications, postgres is waiting internally as if it is somehow singlethreaded. However the documentation clearly indicates this should not be so.

Can anyone give me some pointers as to why postgres would be doing this? Is postgres really multi-process capable or are the processes ultimately waiting on each other to run queries or access shared memory?

On a second note, has anyone got some tips on how to profile postgres in this kind of situation? I have tried using gprof, but because postgres spawns its processes dynamically I always end up profiling the postmaster (not very useful).

Thanking in advance for any help!

Cheers,

Simon.

---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
Nov 12 '05 #1
1 2537
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It is probably not really a pg issue that you don't get your CPUs fully
used. I would guess that one CPU saturates the memory bus or the disk
bandwidth depending on where your data is. This is the typical behavior
for memory bounded applications where you don't get the full performanco
out of your box and the only thing you can do is to improve your
application to reuse data which is in the caches, which is something you
probably won't be able to do, due to the nature of databse applications.

Regards
Andreas Fromm
Simon Sadedin wrote:
Folks,

Im hoping someone can give me some pointers to resolving an issue with
postgres and its ability to utilize multiple CPUs effectively.

The issue is that no matter how much query load we throw at our server
it seems almost impossible to get it to utilize more than 50% cpu on a
dual-cpu box. For a single connection we can use all of one CPU, but
multiple connections fail to increase the overall utilization (although
they do cause it to spread across CPUs).

The platform is a dual CPU 2.8Ghz P4 Xeon Intel box (hyperthreading
disabled) running a fairly standard Redhat 9 distribution. We are
using postgres on this platform with a moderate sized data set (some
hundreds of megs of data). The tests perform no updates and simply hit
the server with a single large complex query via a multithreaded
java/jdbc client. To avoid network distortion we run the client on the
localhost (its cpu load is minimal). We are running with shared
buffers large enough to hold the entire database and sort memory of 64m,
should easily be enough to prevent sorting to disk.

At this point Ive tried everything I can think of to diagnose this -
checking the pg_locks table indicates that even under heavy load there
are no ungranted locks, so it would appear not to be a locking issue.
Vmstat/iostat show no excessive figures for network or io waits. The
only outlandish figure is that context switches which spike up to
250,000/sec (seems large). By all indications, postgres is waiting
internally as if it is somehow singlethreaded. However the
documentation clearly indicates this should not be so.

Can anyone give me some pointers as to why postgres would be doing
this? Is postgres really multi-process capable or are the processes
ultimately waiting on each other to run queries or access shared memory?

On a second note, has anyone got some tips on how to profile postgres in
this kind of situation? I have tried using gprof, but because postgres
spawns its processes dynamically I always end up profiling the
postmaster (not very useful).

Thanking in advance for any help!

Cheers,

Simon.

------------------------------------------------------------------------
Do you Yahoo!?
The New Yahoo! Shopping
<http://shopping.yahoo. com/?__yltc=s%3A150 000443%2Cd%3A22 708228%2Cslk%3A text%2Csec%3Ama il> - with improved product search


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/lqjpPkvkZVZzNY0 RAtw/AKDHhIQSAhOVN/+OMIjeChpwky80B wCgqSOu
MhEDKjU23Rb4TON ykGzM8wQ=
=IRJU
-----END PGP SIGNATURE-----
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org

Nov 12 '05 #2

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

Similar topics

0
1375
by: Albert Rossi | last post by:
all, i have seen a couple of postings on the following issues which i have encountered and have struuggled with for a couple of days now. i apologize in advance if someone has already posted the resolution and i missed it. Problem Description: on a Dual i386 Architecture with RH9, MySQL 3.23.54a-11 (or its .56 upgrade) under heavy loads the mysqld process reaches 99.9% CPU Utilization (as
3
3753
by: Dathon | last post by:
I have a Windows service that's built with .NET. The process is meant to run in the background and not suck up too much CPU time. I set the thread priority for the various threads in the service to Below Normal, but I'm still getting reports that the service is making a noticable impact on overall machine performance. I stuck some Thread.Sleep calls in a various places in the code, but that doesn't help much, since the service makes...
15
1741
by: alex4groups | last post by:
Hi, I've been creating a db application using MS Access and MSDE. Only two of us are using the application, and the server and the app both run great on my laptop (1.6 GHz Pentium M, 2GB RAM, W2KPro). Only problem is when I take my laptop home, my coworker loses access to the server. We recently purchased a dedicated server to run the db on at the office. It's a 2.8 GHz Dual Xeon, 2GB RAM, running XPPro. We also bought SQL Server,...
3
2458
by: john | last post by:
I don't want to know what the CPU utilization is right now. I want to get the average utilization over the last, for example, hour. So I came up with a method where I would get a Process object representing the "Idle" process. I would figure out what percentage of time the idle process has been running since my function last was called. Then the average CPU utilization would be 100 - average idle percentage. I figure out the average idle...
0
1313
by: bimalendug | last post by:
Hi All, I'm using the .NET performance counters to calculate the network utilization. But this value exceeds 100%. In most of the cases, it is very similar to the one shown in the task-manager. But when I try to measure the network utilization with a particular utility that sends large data, then the values that I get exceed 100%. Even in the task-manager it shows similar graph (graph goes up above the 100% line and disappears and then...
11
3469
by: Ajith Menon | last post by:
I have created a windows application in which the form needs to be resized on the MouseMove event. The windows resize function takes a lot of CPU cycles. And as the resize function is called on the MouseMove, the form is resized around a 30-100 times in one second. This leads to a high CPU utilization and all other application comes to a stand still. The form does not have any controls i.e. buttons, text boxes etc. It is completely...
4
2639
by: dgk | last post by:
For the whole machine, not a specific process. I looked at an earlier thread by Cor and Ken Tucker, but I don't find anything in the management that looks like... Oh. Here is a really good site. Really, I don't know the guy but just found it via Google. I guess I don't need to post this anymore but just in case someone else is looking for the info, here it is. It's in C# but nobody is perfect. ...
0
2245
by: PRR | last post by:
with WMI class Win32_Process i can get most details of Processes running one Pc.. except CPU utilization... THe class for CPU utilization u need to use Win32_PerfFormattedData_PerfProc_Process However it doesnt work in Windows XP... i wanna know wat class to use to get CPU utilization in win xp... also Processid is to be compared to get CPU utilization for Process to get info from both classes?
1
6626
by: Kaheru | last post by:
memory utilization increase? This is because when i try to keep track of the CPU utilization and memory utilization of my FTP server process (ftpserver.exe), the CPU utilization increase, but the memory utilization decrease. Why is this happening? PS: CPU Utilization is taken from Process\% Processor Time Memory Utilization is taken from Process\Working Set (I want to measure the physical memory it uses) Any help is appreciated....
0
8427
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8332
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
8851
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...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8525
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,...
1
6179
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4175
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
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1975
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.