Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Walsall - UK

    Server eventually crashes when I'm performing lots of sql queries?

    ... at least thats what I'm suspecting?

    I havent used mysql_close(); on all of my documents... but my server seems to slow down, and then grind completely to a halt when I'm using my coding and designing this management system.... im using a lot of sql queries - would that affect anything?

    Eventually i just get a page cannot be displayed error?

    <<< Please see Forum Guidelines for signature setup. >>>

  2. #2
    Join Date
    Oct 2003
    you don't need to use mysql_close() because the connection is automatically closed when the script is finished executing if it's not a persistant connection.

    it's probably that your server can't handle that many users. It would help if you told us some numbers, like server specs and how many users. some heavy php+mysql scripts can drag down your server.

  3. #3
    sounds like you're getting a mysql query stuck in an endless loop. normally when a connection is no longer used it will close itself, so mysql_close, while a good idea to use, probably wont fix your problems..

    what usually happens is you get mysql query stuck into an endless loop and once your memory is used up, the remaining queries end up in a buffer waiting their turn, eventually you run out of memory and server comes to a crashing halt. (MySQL crashes, followed by apache, and then the only thing you can really do is ping the server (meaning you have to reboot it)

    sounds to me like you need to re-think your code and re-design it...

    put a pause on mysql queries, and if you have a big table full of data, dont try to SELECT * WHERE all at once- paginate it, using SELECT LIMIT...

    Ive seen it happen numerous times on many servers.. bad code causing server crash..

    a php script may time out, but a mysql query stuck in an endless loop won't stop until the server crashes. you need to break the loop, and the best way to do that is use SELECT LIMIT and optimize your sql queries.

Posting Permissions

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