title: 2003: Can't connect to MySQL server on '127.0.0.1:3306' (99 Cannot assign requested address)
body: <p>I am running a python2.7 application that performs "inserts" into a single mysql/mariadb instance on a multi-core 64 bit CentOS(or ubuntu) machine. as soon as the parallel processes/cores exceed 4 or maybe 6, I see this error. (at different points in the execution)
  2003: Can't connect to MySQL server on '127.0.0.1:3306' (99 Cannot assign requested address)</p>
  
  <p>I am running the application on CentOS6.5, mariadb 10.1 
  I have also tried with Ubuntu 14.04 (64 bit), mysql resulting in the same problem. </p>
  
  <p>I tried making the following changes:</p>
  
  <pre><code>In my.cnf file:
  [mysqld]
  interactive_timeout=1
  wait-timeout = 1
  thread_cache_size = 800
  max_connections = 5000
  #max_user_connections = 5000
  max_connect_errors = 150
  
  
  In sysctl.conf file:
  fs.file-max = 65536
  
  In limits.confg file:
  * soft nproc 65535
  * hard nproc 65535
  * soft nofile 65535
  * hard nofile 65535
  </code></pre>
  
  <p>I am inclined to think that this is a configuration issue, because the code runs just fine on 2 core Mac. Can someone suggest some configuration tweaks or any easy way to reuse connections?</p>