title: AWS SQS Batch SendMessageBatchRequest is very Slow
body: <p>My application posts 10 messages per request to AWS-SQS using SendMessageBatchRequest. The size of each message is less than 250 bytes. The application is expected to post about a million records per day. But the rate at which the messages are getting posted is extremely slow to accomplish this.</p>
  
  <pre><code>AmazonSQS sqs = null;
  sqs = new AmazonSQSClient(new BasicAWSCredentials("accessKey", "SecretKey"));
  //the below entries are added via a for loop picking the messages from a queue
  //the typical queue size will be 20k messages
  //AmazonSQSClient is created once and is used until the code comes out of the for loop
  
  List&lt;SendMessageBatchRequestEntry&gt; entries = new ArrayList&lt;SendMessageBatchRequestEntry&gt;();
  entries.add(new SendMessageBatchRequestEntry(messageBatchRequestId, "250kbJSONString"));
   //Once the batch count reaches 10,the following code is called 
  
  CreateQueueRequest createQueueRequest = new CreateQueueRequest("CLIENT-TEST");
  String myQueueUrl = sqs.createQueue(createQueueRequest).getQueueUrl();
  
  SendMessageBatchRequest sendMessageBatchRequest = new    SendMessageBatchRequest(myQueueUrl);
  
  sendMessageBatchRequest.setEntries(entries);
  long timeBeforePost = System.currentTimeMillis();
  SendMessageBatchResult smbResult = sqs.sendMessageBatch(sendMessageBatchRequest);
  long afterPost = System.currentTimeMillis();
  log.trace("time taken %s ",(afterPost-timeBeforePost));
  </code></pre>
  
  <p>The Time taken in ms for each post is captured and here is the typical output</p>
  
  <pre><code>time taken 57
  time taken 37
  time taken 31
  time taken 322
  time taken 48
  time taken 153
  time taken 278
  time taken 86
  time taken 35
  time taken 28
  time taken 30
  time taken 57
  time taken 43
  time taken 314
  time taken 5587
  time taken 42
  time taken 4789
  time taken 4831
  time taken 66
  time taken 6239
  time taken 50
  time taken 38
  time taken 4833
  time taken 40
  time taken 4896
  time taken 27
  time taken 16634
  </code></pre>
  
  <p>Is this normal to have some posts taking 7,16 etc seconds to return, I have some posts with 300 seconds as well to return from the method call.Am I missing something here , My Application is currently single threaded and I am planning to make it multi-threaded to process the messages in parallel but again some messages taking seconds and some taking tens/hundreds of seconds is something seriously wrong. Please help .</p>
  
  <p>Thanks a Ton </p>