thanks, today i found the 
<span style="font-family:sans-serif;font-size:13px;text-align:left;background-color:rgb(204,255,204)">ensembl_web_user_db</span>  which the connections open all the time, so the number of connections increased rapidly. is it a bug of Ensembl or something else?<div>

<br></div><div>Best regards,</div><div>Xiong</div><div><br><div class="gmail_quote">2012/2/22 Andy Yates <span dir="ltr"><<a href="mailto:ayates@ebi.ac.uk" target="_blank">ayates@ebi.ac.uk</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi Xiong,<br>
<br>
Ensembl does not use a connection pool instead it maintains a database connection for each instance of DBAdaptor. We do have two solutions to keep the number of open connections down.<br>
<br>
1). Close the connection when you finish working with it e.g.<br>
<br>
my $dba = Bio::EnsEMBL::Registry->get_DBAdaptor('human', 'core');<br>
# Do something with the DBAdaptor<br>
$dba->dbc()->disconnect_if_idle();<br>
<br>
Or if you were working with an adaptor e.g. a gene adaptor<br>
<br>
my $adaptor = Bio::EnsEMBL::Registry->get_adaptor('human', 'core', 'gene');<br>
#Do something with the adaptor<br>
$adaptor->dbc()->disconnect_if_idle();<br>
<br>
I would recommend doing this if you are iterating over many species and have a clearly defined point when you are finished processing a species. This is my preferred method of regulating open DB connections<br>
<br>
2). The API can close down the connection for you automatically & reopen it when you need it again<br>
<br>
Bio::EnsEMBL::Registry->set_disconnect_when_inactive();<br>
<br>
I would use this version if you have a distributed setup and have no clear definition of when you have finished working with a species. Ensembl uses this version when we run pipelines. Please be aware of the associated overhead of recreating a connection.<br>


<br>
Hope this helps,<br>
<br>
Andy<br>
<br>
Andrew Yates                   Ensembl Core Software Project Leader<br>
EMBL-EBI                       Tel: <a href="tel:%2B44-%280%291223-492538" value="+441223492538" target="_blank">+44-(0)1223-492538</a><br>
Wellcome Trust Genome Campus   Fax: <a href="tel:%2B44-%280%291223-494468" value="+441223494468" target="_blank">+44-(0)1223-494468</a><br>
Cambridge CB10 1SD, UK         <a href="http://www.ensembl.org/" target="_blank">http://www.ensembl.org/</a><br>
<div><div><br>
On 22 Feb 2012, at 10:56, xiong zhao wrote:<br>
<br>
><br>
><br>
> On 22 February 2012 18:53, xiong zhao <<a href="mailto:xiaoxiongg@gmail.com" target="_blank">xiaoxiongg@gmail.com</a>> wrote:<br>
> hi,<br>
> do u know the ensembl database use connection pool? if it is, what's the name of the config file? because i found the number of the database connections is too much, but we just have a few of client.<br>
><br>
> i really appreciate if you can help me.<br>
><br>
> Thanks,<br>
> Xiong<br>
><br>
</div></div>> _______________________________________________<br>
> Dev mailing list    <a href="mailto:Dev@ensembl.org" target="_blank">Dev@ensembl.org</a><br>
> List admin (including subscribe/unsubscribe): <a href="http://lists.ensembl.org/mailman/listinfo/dev" target="_blank">http://lists.ensembl.org/mailman/listinfo/dev</a><br>
> Ensembl Blog: <a href="http://www.ensembl.info/" target="_blank">http://www.ensembl.info/</a><br>
<br>
<br>
_______________________________________________<br>
Dev mailing list    <a href="mailto:Dev@ensembl.org" target="_blank">Dev@ensembl.org</a><br>
List admin (including subscribe/unsubscribe): <a href="http://lists.ensembl.org/mailman/listinfo/dev" target="_blank">http://lists.ensembl.org/mailman/listinfo/dev</a><br>
Ensembl Blog: <a href="http://www.ensembl.info/" target="_blank">http://www.ensembl.info/</a><br>
</blockquote></div><br></div>