Re: Why is it not using the other processor?

Started by Ryan Mahoneyalmost 25 years ago4 messagesgeneral
Jump to latest
#1Ryan Mahoney
ryan@paymentalliance.net

From what I understand, postgres runs multiple 'backends' which will
utilize a single process. If you have simultaneous queries running using
multiple backend the backend will be distributed across your
processors. If your OS doesn't support SMP that would affect it too ;)

Re: killing a process from browser, I don't think what you're trying to do
is really possible. If your application could be aware of the process_id
of the backend (I don't know if this is possible) you could make a system
call just to kill that particular backend (bad idea!) and have a client
side javascript call that procedure in a hidden frame. Sounds hokey to me!

I think your best bet may be to redesign your application. I don't know
what kind of data you are searching against or how it is structured, but at
10 seconds to execute, and 100% CPU utilization - if you had a handful of
users trying to access this data simultaneously they're going to be waiting
a lot longer than 10 seconds!

Good Luck!

-r

At 09:20 AM 7/5/01 -0600, Linh Luong wrote:

Show quoted text

Hi,

My postgres is running on a dual processor. But when I run a query and
look at TOP and notice only one processor is being used. And it is
being used 100% (assuming only 1 process is active). Why would it
allocate the work to the other processor. Am I missing something
here. If so how can I make it use the other one too?

One more question. I am using the browser to display my data. If I
start the query by means of pressing the Search button and then I decide
to stop the search by pressing STOP (on the broswer). The browser stop
executing and I can still surf the web. My question is why is the
process that handles the search still running when I view TOP. It
doesn't go away until it has completed it query. Is there a way I make
postgres realize that netscape has terminated and it should also die.
My search for example takes 10 secs. But if I stop and start it often
the time it requires to search increase dramatically. I am trying to
look for a solution on the postgres or apache side.

Please help me..

Thanks

Linh

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

http://www.postgresql.org/users-lounge/docs/faq.html

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.251 / Virus Database: 124 - Release Date: 4/26/01

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ryan Mahoney (#1)

Ryan Mahoney <ryan@paymentalliance.net> writes:

Re: killing a process from browser, I don't think what you're trying to do
is really possible.

If the client-side code were programmed to send a Cancel request to the
backend when the user loses interest, then the right things would
happen. I am not sure how practical that is though; does the web server
even find out about it when the user presses Stop in a typical browser?
(If not, you can hardly expect Postgres to somehow intuit what happened
two protocols away ;-).)

regards, tom lane

#3Alex Pilosov
alex@pilosoft.com
In reply to: Tom Lane (#2)

On Thu, 5 Jul 2001, Tom Lane wrote:

Ryan Mahoney <ryan@paymentalliance.net> writes:

Re: killing a process from browser, I don't think what you're trying to do
is really possible.

If the client-side code were programmed to send a Cancel request to the
backend when the user loses interest, then the right things would
happen. I am not sure how practical that is though; does the web server
even find out about it when the user presses Stop in a typical browser?
(If not, you can hardly expect Postgres to somehow intuit what happened
two protocols away ;-).)

Webserver definitely finds out. (Socket gets closed by client). The real
question is, how does webserver signal this fact to a
CGI/mod_perl/jsp/whatever web application. For CGI, _i believe_ the
standard is that webserver will SIGHUP the application, and app can do
whatever cleanup it needs. For other interfaces, I really don't know.

-alex

#4Mithun Bhattacharya
mithun.b@egurucool.com
In reply to: Ryan Mahoney (#1)

Tom Lane wrote:

http://thingy.kcilink.com/modperlguide/debug/Handling_the_User_pressed_Stop_.html

Show quoted text

I am not sure how practical that is though; does the web server
even find out about it when the user presses Stop in a typical browser?