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... ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
>> 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. |
|
|||
|
>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. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|