title: Does Amazon S3 have a connection pool?
body: <p>I ever used the code </p>
  
  <pre><code>public static AmazonS3Client s3 = null;
  ...
  BasicAWSCredentials c = new BasicAWSCredentials("absadgwslkjlsdjgflwa");
  s3 =  new AmazonS3Client(c);
  </code></pre>
  
  <p>Only one instance s3 is created while dozens of threads will upload images by s3.putObject(). In the dump info, I could see that one thread would lock the only instance s3 while the others were waiting.</p>
  
  <p>So I think maybe it will be faster if I use the code below:</p>
  
  <pre><code>BasicAWSCredentials c = new BasicAWSCredentials("absadgwslkjlsdjgflwa");
  for(int i = 0; i &lt; 10; i++)
      amazonS3[i] = new AmazonS3Client(c);
  </code></pre>
  
  <p>Everytime the system will get a random s3 instance and then upload the image.</p>
  
  <pre><code>private static AmazonS3 getS3(){
      int i = (int)(Math.random() * 10); 
      return amazonS3[i];
  }
  </code></pre>
  
  <p>But it seems that the system slow down. Why that happened? 
  Maybe the only instance s3 has already used connection pool? I am confused.</p>