<div dir="ltr">Have you tried using several concurrent db connections instead of one connection & `use` statements? I'm just curious how costly it is (cpu/mem).</div><div class="gmail_extra"><br><br><div class="gmail_quote">

On Sun, Sep 1, 2013 at 8:02 PM, Jesse (Pathoschild) <span dir="ltr"><<a href="mailto:pathoschild@gmail.com" target="_blank">pathoschild@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr"><div>Hello,</div><div><br></div><div>I noticed a performance issue with tools that query data from many wikis. I open connections to each DB slice, then do a "<font face="courier new, monospace">use `dbname`</font>" to switch to each wiki for the relevant queries. This is <i>very</i> slow on Tools Labs; does the Tools Labs infrastructure make "<font face="courier new, monospace">use `dbname`</font>" significantly slower? Is there a more efficient way to do this?</div>



<div><br></div><div>I created a simple script which reproduces the issue. It <a href="https://toolserver.org/~pathoschild/accounteligibility/test.php" target="_blank">runs in 0.3 seconds on the Toolserver</a> (<a href="http://pastebin.com/ctUQsXZm" target="_blank">source</a>), but <a href="http://tools.wmflabs.org/pathoschild-contrib/accounteligibility/test.php" target="_blank">takes a whopping 23 seconds on Tools Labs</a> (<a href="http://pastebin.com/Xi3abGFP" target="_blank">source</a>). The scripts shows the profiling results at the bottom of the page (click the [+] next to "<i>Page generated in XX seconds</i>").</div>

<span class="HOEnZb"><font color="#888888">

<div><br></div><div>-- <br></div><div><div dir="ltr">Jesse Plamondon-Willard (Pathoschild)</div></div>
</font></span></div>
<br>_______________________________________________<br>
Labs-l mailing list<br>
<a href="mailto:Labs-l@lists.wikimedia.org">Labs-l@lists.wikimedia.org</a><br>
<a href="https://lists.wikimedia.org/mailman/listinfo/labs-l" target="_blank">https://lists.wikimedia.org/mailman/listinfo/labs-l</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">З павагай,<br>Павел Селіцкас/Pavel Selitskas<br>Wizardist @ Wikimedia projects</div>
</div>