473,320 Members | 2,109 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,320 software developers and data experts.

How to identify which query is running - reg.

Dear Group,
We have a java front-end for postgresql 3.4. When
we monitor the system usage using top we find couple of postmasters
taking up close to 90% of the CPU time in total. I would like to know
which are the queries that are currently running at this point of time.
How do we do this?? Another thing that I have noticed is that when I
give df -h, I find there is a partition /dev/shm which is somewhere in
the range of about 128MB and never used. What is this supposed to be.
Is it being not used a good sign or am I loosing on my performance? How
do we get it to be used by the database if it will help improve the
performance. Thanks in advance.

Yours sincerely,
Shan.

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #1
5 1458
Shanmugasundaram Doraisamy wrote:
Dear Group,
We have a java front-end for postgresql 3.4.
Hopefully 7.3.4, otherwise upgrade :-)
When
we monitor the system usage using top we find couple of postmasters
taking up close to 90% of the CPU time in total. I would like to know
which are the queries that are currently running at this point of time.
How do we do this??
Read the "monitoring activity" chapter for full details, but if you have
statistics gathering turned on try selecting from pg_stat_activity. You
might also be able to see backend status with ps / top set to show the
whole command-line.
Another thing that I have noticed is that when I
give df -h, I find there is a partition /dev/shm which is somewhere in
the range of about 128MB and never used. What is this supposed to be.
Is it being not used a good sign or am I loosing on my performance? How
do we get it to be used by the database if it will help improve the
performance.


Almost certainly shared-mem (you don't say what system you're on) and it
will be used, regardless of what df says - increase the settings in your
postgresql.conf beyond 128MB and you'll see postgresql fail to start.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #2
Hi Shan,
please, check your postgresql.conf and find "shared_buffers" and
"log_statement". I am not 100% sure, if statements are logged before
executing.

Regards,
pajout

Shanmugasundaram Doraisamy wrote:
Dear Group,
We have a java front-end for postgresql 3.4.
When we monitor the system usage using top we find couple of
postmasters taking up close to 90% of the CPU time in total. I would
like to know which are the queries that are currently running at this
point of time. How do we do this?? Another thing that I have noticed
is that when I give df -h, I find there is a partition /dev/shm which
is somewhere in the range of about 128MB and never used. What is this
supposed to be. Is it being not used a good sign or am I loosing on
my performance? How do we get it to be used by the database if it will
help improve the performance. Thanks in advance.

Yours sincerely,
Shan.

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #3
Dear Richard,
Thankyou for you immediate reply, I did set
the stats_command_string=true and tried select * from pg_stat_activity;
It gave me the desired result. In the mean while you had mentioned
about reading the monitoring activity chapter. Please tell me where I
could find it ( the website address). Thanking you,

Yours sincerely,
Shan.

Richard Huxton wrote:
Shanmugasundaram Doraisamy wrote:
Dear Group,
We have a java front-end for postgresql 3.4.

Hopefully 7.3.4, otherwise upgrade :-)
When

we monitor the system usage using top we find couple of postmasters
taking up close to 90% of the CPU time in total. I would like to
know which are the queries that are currently running at this point
of time. How do we do this??

Read the "monitoring activity" chapter for full details, but if you
have statistics gathering turned on try selecting from
pg_stat_activity. You might also be able to see backend status with ps
/ top set to show the whole command-line.
Another thing that I have noticed is that when I

give df -h, I find there is a partition /dev/shm which is somewhere
in the range of about 128MB and never used. What is this supposed to
be. Is it being not used a good sign or am I loosing on my
performance? How do we get it to be used by the database if it will
help improve the performance.

Almost certainly shared-mem (you don't say what system you're on) and
it will be used, regardless of what df says - increase the settings in
your postgresql.conf beyond 128MB and you'll see postgresql fail to
start.


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #4
Dear Jan Poslusny,
Thank you for you immediate reply, in
regards to the shared_buffers, what is the optimum value and how do I
calculate it. Thanking you,

Yours sincerely,
Shan.

Jan Poslusny wrote:
Hi Shan,
please, check your postgresql.conf and find "shared_buffers" and
"log_statement". I am not 100% sure, if statements are logged before
executing.

Regards,
pajout

Shanmugasundaram Doraisamy wrote:
Dear Group,
We have a java front-end for postgresql 3.4.
When we monitor the system usage using top we find couple of
postmasters taking up close to 90% of the CPU time in total. I would
like to know which are the queries that are currently running at this
point of time. How do we do this?? Another thing that I have
noticed is that when I give df -h, I find there is a partition
/dev/shm which is somewhere in the range of about 128MB and never
used. What is this supposed to be. Is it being not used a good sign
or am I loosing on my performance? How do we get it to be used by the
database if it will help improve the performance. Thanks in advance.

Yours sincerely,
Shan.

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #5
Shanmugasundaram Doraisamy wrote:
Dear Richard,
Thankyou for you immediate reply, I did set the
stats_command_string=true and tried select * from pg_stat_activity;
It gave me the desired result. In the mean while you had mentioned
about reading the monitoring activity chapter. Please tell me where I
could find it ( the website address). Thanking you,


All the manuals are online at http://www.postgresql.org/docs/

If you're running version 7.4 you'll want "Chapter 23. Monitoring
Database Activity"

You probably have a copy on your server too. Where depends on how you
installed, but the RedHat RPMs put documents in /usr/share/doc/...

Also, you'll want:
http://techdocs.postgresql.org/
Various user-submitted notes and guides.
http://www.postgresql.org/lists.html
Mailing list archives (especially check the announcements list)
http://www.varlena.com/GeneralBits/
Elein's journal, with contributions from other community members.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #6

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

Similar topics

1
by: Kamesh | last post by:
Hi Folks, how to identify 2 different session on same machine, same/nearly same logon time that is running on a oracle server. We have different sid,serial# but how to identify they both are...
4
by: Iftikhar Hussain | last post by:
Hello Everyone Nice to be back here, well all u guys have helped in past & now I would like a favor again. first what i want to develop is as follows: An application for rescue station, where...
5
by: BlackFireNova | last post by:
I need to write a report in which one part shows a count of how many total records fall within the working days (Monday - Friday) inside of a (prompted) given date range, in a particular...
1
by: Christopher Attard | last post by:
Hi, I'm getting a list of running processes on a machine using Process.GetProcesses(). Can I identify programmatically which of these processes is running as a service. 10x in advance. Chris
3
by: Michel | last post by:
Hi, I wrote an app in .Net and I whant only 1 instance of this app open for the user; the user open my app, do some works and try to open another instance of my app, I whant to show a message to...
1
by: 01423481d | last post by:
Hi all Here is a segment of code used to find out all running processes Imports System.Diagnostics .... Dim myProcesses() As Process Dim myProcess As Process
1
by: robert.waters | last post by:
Is there any way to identify a record based on where the user's cursor is located, if the cursor is located somewhere in a query or table window? I would like to have a commandbar button call a...
3
by: mjkriab | last post by:
We have installed Oracle e-business suite. Now I have written a query for generating a report. I want to give some security to run this report by preventing the user from getting the details of...
17
by: sharsy | last post by:
Hello guys, I would like some help in generating query criteria that will identify credit cards that have expired on an access database. The specific Field is formatted with a Data Type of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.