{"id":18,"date":"2007-11-30T22:18:07","date_gmt":"2007-11-30T10:18:07","guid":{"rendered":"http:\/\/p-s.co.nz\/wordpress\/?p=18"},"modified":"2007-11-30T22:34:31","modified_gmt":"2007-11-30T10:34:31","slug":"sluggish-mysql-because-of-contentprotect","status":"publish","type":"post","link":"http:\/\/p-s.co.nz\/wordpress\/sluggish-mysql-because-of-contentprotect\/","title":{"rendered":"Sluggish MySQL because of ContentProtect"},"content":{"rendered":"<p>A program I wrote using python and MySQL ran much, much slower on my development computer than on the client&#8217;s computer.  And their computer seemed about the same spec as mine.  I upgraded from python 2.4 to 2.5. Nope.  Was it the RAM.  Nope &#8211; they had half a Gb to my 1Gb.  Was it the hard drive?  The L1 and L2 cache?  Who could tell.<\/p>\n<p>A friend (a very good friend) suggested it might be a MySQL setting. I was looking around in there when I noticed the named pipe alternative to the TCP\/IP protocol.  TCP\/IP.  Hmmmm I had sort of noticed the wireless network icon flickering in the taskbar when running MySQL.  Could it be &#8230;.. ContentProtect!?<\/p>\n<p>I reconfigured MySQL to not use TCP\/IP:<\/p>\n<p><code>connMySQL = MySQLdb.connect(host=maint.DB_HOST, user=maint.DB_USER,<br \/>\n                                    passwd=maint.DB_PWD, db=maint.DB_DATABASE,<br \/>\n                                    named_pipe=maint.NAMED_PIPE)<\/code><\/p>\n<p><a href=\"http:\/\/mysql-python.sourceforge.net\/MySQLdb.html\">http:\/\/mysql-python.sourceforge.net\/MySQLdb.html<\/a><\/p>\n<p>&#8230; and the program suddenly flew!  I could barely keep up with the screen output.  Unfortunately my favourite MySQL manager, SQLyog, did not support named pipes.  <\/p>\n<p>http:\/\/www.webyog.com\/forums\/\/index.php?s=035d8d492234b760704ed30c35331bdd<br \/>\n&#038;showtopic=2314&#038;view=findpost&#038;p=10917<\/p>\n<p>But if I switched on support for TCP\/IP the code relying on named pipes stopped working.  I would get &#8220;error 2017: can&#8217;t open named pipe to host&#8221;.<\/p>\n<p>The answer was to manually add one line to my my.ini file &#8211; namely:<br \/>\nenable-named-pipe<\/p>\n<p>Now I could use the named pipes where possible, thus sidestepping the numbing effect of ContentProtect, while still being able to use tools that required or expected TCP\/IP.<\/p>\n<p>A useful reference is on:<br \/>\nhttp:\/\/dev.mysql.com\/doc\/refman\/5.0\/en\/can-not-connect-to-server.html<br \/>\n#can-not-connect-to-server-on-windows<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A program I wrote using python and MySQL ran much, much slower on my development computer than on the client&#8217;s computer. And their computer seemed about the same spec as mine. I upgraded from python 2.4 to 2.5. Nope. Was &hellip; <a href=\"http:\/\/p-s.co.nz\/wordpress\/sluggish-mysql-because-of-contentprotect\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,3],"tags":[],"class_list":["post-18","post","type-post","status-publish","format-standard","hentry","category-mysql","category-python"],"_links":{"self":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts\/18"}],"collection":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/comments?post=18"}],"version-history":[{"count":0,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts\/18\/revisions"}],"wp:attachment":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/media?parent=18"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/categories?post=18"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/tags?post=18"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}