Skip to content Skip to sidebar Skip to footer

Boto Connect_xxx Method And Connection Pools

If I call boto.connect_xxx, where xxx is some service (dynamodb, s3, etc) multiple times, does it create a new connection pool each time? What I'd like to do is something like this

Solution 1:

The best approach is to call the connect_xxx method once when your application starts and rely on boto to manage the connection from then on. The only exception to that rule is if you are using multiple threads. In that case, each thread should create it's own connection since boto uses httplib which is not threadsafe.

Even if you call the connect_xxx method before each request, you really should be okay. Boto pools connection at the class level and should handle this in a pretty efficient manner.


Post a Comment for "Boto Connect_xxx Method And Connection Pools"