Hung processes

This is a discussion on Hung processes within the MySQL Database forums, part of the Database Forums category; >> no way!!!! that would mean each user would be using the same connection to >> the database... ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 06-27-2007
Gordon Burditt
 
Posts: n/a
Default Re: Hung processes

>> no way!!!! that would mean each user would be using the same connection to
>> the database... definitely not what you want. yes, they all connect to the
>> same database, but you don't want them sharing the connection TO the
>> database...

>
>But they all need to see the same data, so why use a different
>connection for each of them?
>(Again sorry for my ignorance, I don't come from the DBA field)


If *I* am calling AT&T customer service, and *you* are calling AT&T
customer service, can we share phones that are extensions of each
other to make the call at the same time? No, I'll get the answers
to your questions as well as my own. And you'll confuse the customer
service rep about what account you're talking about. No, we need to
talk to separate reps, or make calls at different times.

No, you can't have two web pages running at the same time share the
same connection. Not even if the queries are all strictly read-only.

Reply With Quote
  #12 (permalink)  
Old 06-27-2007
Gordon Burditt
 
Posts: n/a
Default Re: Hung processes

>I am using php to run queries on my SQL
>For some reason I get many "sleep"ing processes in my DB
>I am using the following lines to run the queries:
>$link = mysql_pconnect($db_server, $db_user, $db_password) or
>die('err');
>$res = mysql_db_query($db_database, $sql_string, $link);
>
>Any idea what can be done to avoid those hung processes?


You have a strange definition of "hung" processes.

Is a process that has responded and is waiting for the next command
/ mouse click "hung" while you go to lunch? No, it's waiting for
input. Or, in your case, perhaps it's off doing something besides
using the database, like sending a response to the user with the
web browser.

A connection that's not being used at the moment (because of
mysql_pconnect()) will be in the Sleep state. This is expected.

Don't use mysql_pconnect(). It's a bad idea if you have a lot of
queries. It's a bad idea if you have only a few queries. It's a
bad idea if you have NO queries. It might make sense if you have
a $10,000,000 database server with 512GB of memory, and since you
spent all the budget on the database server, a $1000 web server
with 128MB of memory, so you desparately need to improve the
performance of the web server at the expense of huge resources in
the database server.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:24 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0