Menu

CursorNW gone?

Help
phlux
2004-11-30
2012-09-19
  • phlux

    phlux - 2004-11-30

    My python app uses CursorNW for most queries using 1.0 MySQLdb. We recently upgraded to mysql4.1 to get the clustering, and thus broke our app. I switched to using the normal Cursor, but now the program just makes hundreds of mysql processes and eventually brings the server load to around 3.5 and becomes unusable.

    Do I need to manually close connections or something? And how to I get the normal Cursor to behave like the old CursorNW?

     
    • phlux

      phlux - 2004-11-30

      Thanks for the rapid response!

      So using 1.1.7 and having changed my code to use Cursor (instead of CursorNW) I am now getting tons of mysql processes. They never seem to close? Are there other changes I need to make? It's making my machine unusable.

       
      • Andy Dustman

        Andy Dustman - 2004-11-30

        Well, you should close your connections, yes, or at least close your cursors when you are done with them. There's another recent thread about Apache with threads where I have some tips on using the Pool module to have persistent connections; that may help the performance of your application.

         
    • phlux

      phlux - 2004-11-30

      Sorry, I forgot to mention these problems started apearing after the upgrade to 1.1.7.

       
    • Andy Dustman

      Andy Dustman - 2004-11-30

      Use MySQLdb-1.1.7. There is no longer a CursorNW class, but the standard cursor does not raise the Warning exception. Instead it uses the Python warnings module, which can do filtering.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.