vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, I am using PHP and MySQL and sqlYog for my db browser. I have no problems connecting to my db through sqlYog and its almost instantaneous, however when using this simple php code: $db = mysql_connect('localhost','public','xxpwxx'); print "$db"; my connection takes about 2.5 seconds (i know that because I'm waiting that long for an ajax connection on a page using the specific database). However when I load it to my webhosting (Linux/ Appache) the same code is instantaneous as well. If I connect to my webhosting by replacing localhost with their IP it too takes about 2.5 seconds. I'm running Windows XP SP2 with MySQL 5 and PHP 5. Any thoughts/help on just improving the connection speed would be great. Many thanks A |
| |||
| On Mon, 17 Sep 2007 06:39:37 -0700, UKuser wrote: > Hi, > > I am using PHP and MySQL and sqlYog for my db browser. I have no > problems connecting to my db through sqlYog and its almost > instantaneous, however when using this simple php code: > > $db = mysql_connect('localhost','public','xxpwxx'); > print "$db"; > > my connection takes about 2.5 seconds (i know that because I'm waiting > that long for an ajax connection on a page using the specific > database). However when I load it to my webhosting (Linux/ Appache) > the same code is instantaneous as well. If I connect to my webhosting > by replacing localhost with their IP it too takes about 2.5 seconds. > > I'm running Windows XP SP2 with MySQL 5 and PHP 5. > > Any thoughts/help on just improving the connection speed would be > great. DNS delay, perhaps? -- 6. I will not gloat over my enemies' predicament before killing them. --Peter Anspach's list of things to do as an Evil Overlord |
| ||||
| On 17 Sep, 15:40, "Peter H. Coffin" <hell...@ninehells.com> wrote: > On Mon, 17 Sep 2007 06:39:37 -0700, UKuser wrote: > > Hi, > > > I am using PHP and MySQL and sqlYog for my db browser. I have no > > problems connecting to my db through sqlYog and its almost > > instantaneous, however when using this simple php code: > > > $db = mysql_connect('localhost','public','xxpwxx'); > > print "$db"; > > > my connection takes about 2.5 seconds (i know that because I'm waiting > > that long for an ajax connection on a page using the specific > > database). However when I load it to my webhosting (Linux/ Appache) > > the same code is instantaneous as well. If I connect to my webhosting > > by replacing localhost with their IP it too takes about 2.5 seconds. > > > I'm running Windows XP SP2 with MySQL 5 and PHP 5. > > > Any thoughts/help on just improving the connection speed would be > > great. > > DNS delay, perhaps? > > -- > 6. I will not gloat over my enemies' predicament before killing them. > --Peter Anspach's list of things to do as an Evil Overlord Unfortunately if I replace it with 127.0.0.1 it is still the same time delay. |