SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    When running show processlist;, I see quite a lot of sleeping threads, what are they? and how to kill them all?
    Since there is kill statement but syntax is like this:
    kill thread-id;

    Is that the reason why sometimes it said "too many connections" and refuse new connection? And why does that happen?
    Thank you.
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    are u using mysql_pconnect? I heard some stories about it before. It might be solution to use mysql_connect and close connection when you are exiting your script exclusively. But it is just a guess.
    Great Dane
    Gokhan ARLI

  3. #3
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    MySQL connections are closed automatically by PHP when the script terminates, so that shouldn't be a problem. It's worth a shot, though. If nothing else, mysql_pconnect() will make your scripts more efficient...
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  4. #4
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, since my scripts need constant connection (maybe it finish, but the next call to connect is within seconds).
    I do use mysql_pconnect(), but according to Kevin, it should open the same connection (but NOT the same thread?)
    And why that thread becomes inactive?

    -Thanks
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •