Thanks everyone,

I'll also take a look to the pool connections but I think for now I'll stay
with my current approach.

Cheers,
Pablo.


On Thu, Feb 20, 2014 at 5:04 PM, Michael Rose <[email protected]>wrote:

> We generally instantiate a pool per JVM, where the maxActive is (# of
> bolts using JDBC/num workers+1) (e.g. 64 bolts, 4 workers, 17 conns/JVM).
>
> Pooling is our preferred strategy as the pool will shrink (and thus use
> less memory on the corresponding SQL server) if it's not being utilized. In
> either case, t's pushing the management, verification, and reestablishment
> of broken connections into the pool (which is also why we have 1 extra conn
> -- for when a conn is tied up running a validation query or is being
> reestablished).
>
> Michael Rose (@Xorlev <https://twitter.com/xorlev>)
> Senior Platform Engineer, FullContact <http://www.fullcontact.com/>
> [email protected]
>
>
> On Thu, Feb 20, 2014 at 8:28 AM, Richards Peter <[email protected]>wrote:
>
>> Hi Pablo,
>>
>> Your approach is fine. Alternative approach proposed by Brian can be used
>> if you can group the relevant bolt instance/es, which are communicating to
>> the database, into the appropriate worker process/es. However with the
>> alternative approach you shouldn't end up creating separate pools in all
>> the workers used by the topology.
>>
>> Hope this helps.
>>
>> Richards Peter.
>>
>>
>>
>>
>> On Thu, Feb 20, 2014 at 8:33 PM, Pablo Acuña <[email protected]> wrote:
>>
>>> I keep one connection per bolt and for now it works just fine with many
>>> bolts. I would also be interested in hearing from someone else and share
>>> experiences.
>>>
>>> For now, I open the connection in the method prepare (and close it in
>>> cleanup), but to be completely honest, I'm not 100% sure if this is the
>>> best approach.
>>>
>>> cheers,
>>> Pablo.
>>>
>>>
>>> On Wed, Feb 19, 2014 at 4:41 PM, Brian O'Neill <[email protected]>wrote:
>>>
>>>> Yes.  We use JDBI to access MySQL.
>>>>
>>>> We've had success with a shared connection pool. (one per JVM)
>>>> The bolts in the JVM share the pool.
>>>>
>>>> But either approach should work (pool per bolt, or connection per bolt).
>>>> It just depends at what level you want to manage your connections.
>>>>
>>>> We do it at the worker level.  (n connections per worker)
>>>>
>>>> -brian
>>>>
>>>> ---
>>>>
>>>> Brian O'Neill
>>>>
>>>> Chief Technology Officer
>>>>
>>>>
>>>> *Health Market Science*
>>>>
>>>> *The Science of Better Results*
>>>>
>>>> 2700 Horizon Drive * King of Prussia, PA * 19406
>>>>
>>>> M: 215.588.6024 * @boneill42 <http://www.twitter.com/boneill42>  *
>>>>
>>>> healthmarketscience.com
>>>>
>>>>
>>>> This information transmitted in this email message is for the intended
>>>> recipient only and may contain confidential and/or privileged material. If
>>>> you received this email in error and are not the intended recipient, or the
>>>> person responsible to deliver it to the intended recipient, please contact
>>>> the sender at the email above and delete this email and any attachments and
>>>> destroy any copies thereof. Any review, retransmission, dissemination,
>>>> copying or other use of, or taking any action in reliance upon, this
>>>> information by persons or entities other than the intended recipient is
>>>> strictly prohibited.
>>>>
>>>>
>>>>
>>>>
>>>> From: Klausen Schaefersinho <[email protected]>
>>>> Reply-To: <[email protected]>
>>>> Date: Wednesday, February 19, 2014 at 5:58 AM
>>>> To: <[email protected]>
>>>> Subject: JDBC Connections
>>>>
>>>> Hi,
>>>>
>>>> one of my bolt will need to write to a MySql data base. Does anybody
>>>> has some experience with this? What are the best practices? Use an
>>>> connection pool? Or keep one connection open per bolt?
>>>>
>>>> Cheers,
>>>>
>>>> klaus
>>>>
>>>
>>>
>>
>

Reply via email to