NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
[resolved] too long wait for db connection
Veteran

Joined: 06 Mar 2007
Posts: 158
Location: Poland
Reply with quote
Sorry if I double post this thing, but I couldn find an answer.
So my qustion is why there I must wait so long time for connection with MySQL database ? When normally it takes half of second in PhpED I must wait about 20 seconds and PhpED hans for a while. Even connecting with localhost I wait few seconds (and interface totally hangs with this time).

_________________
ML
View user's profileFind all posts by introSend private messageVisit poster's website
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
I really don't think this is PhpED's fault. I'm currently working on an application that uses 5 database connections at the same time (2 x MySQL and 3 x PostgreSQL). Even during debugging all 5 connections are made in an instant (less than a second to connect to the 5 databases).

Why don't you try the mysql command line client to try connecting to the database? Or run the php-script apart from the editor. I think you'll see the same delay then. Might be a DNS problem or something with your database server itself.
View user's profileFind all posts by BlizzSend private messageVisit poster's website
Veteran

Joined: 06 Mar 2007
Posts: 158
Location: Poland
Reply with quote
Hmm ... I use more than 10 connections on different servers (also via vpn) so all of them has the same probs. So if You have no probs, so maby my system's settings ? I dont know. What could be else wrong ? When i open scripts on localhost there are no probs and not long it take (as schould be, about half of seconds). When im connecting via other mysql tools, there are no probs. Only at moments i want to connect via PhpED. Sad

_________________
ML
View user's profileFind all posts by introSend private messageVisit poster's website


Joined: 08 Feb 2007
Posts: 67
Reply with quote
Have you run some tests to see if it's a specific MySQL server that could be causing the problem? It only takes one slow server to slow down the whole process.

Try this:
Code:
$s = microtime();
// connect to MySQL server #1 here
$e = microtime();
print "Connection to server #1 took ".($e-$s)." seconds";

$s = microtime();
// connect to MySQL server #2 here
$e = microtime();
print "Connection to server #2 took ".($e-$s)." seconds";
...
...


That should tell you if it is actually the MySQL connecting that's slow, and if that's it, which server(s) connect slowly.
View user's profileFind all posts by nothsaSend private message
Veteran

Joined: 06 Mar 2007
Posts: 158
Location: Poland
Reply with quote
Hmm... Ash. I have a system which takes data from three different servers. Those servers are really fast and good, so there are no probs with them. Also I'm running this system from localhost when I work with it. So parsing single request took from 0.5 to 0.8 of second. So in any way I cannot say there are probs with servers. I dont know if there are some other settings which could be set wrong. But if You want to think about servers and connections, I havent probs and it works very fast. Only in PhpED there are very long delays (from 10 to 20 seconds and PhpED hangs by this time). What can be wrong ?

_________________
ML
View user's profileFind all posts by introSend private messageVisit poster's website


Joined: 08 Feb 2007
Posts: 67
Reply with quote
As you say, it's obviously not the server connections that are the problem.

Can you give us steps to recreate this issue, and at what point it freezes for 10-20 seconds? It might be loading something (debugger? server?) when you run the code which could be causing the slow-down. Once we have the steps, we can try it out ourselves and let you know =)
View user's profileFind all posts by nothsaSend private message
Veteran

Joined: 06 Mar 2007
Posts: 158
Location: Poland
Reply with quote
Maby I was said something wrong ... All time I mean connection with MySQL (local MSSQL connects ok, i dont know of external) via PhpED's DB Client. How to recreate this issue ? Install PhpED, add a MySQL accound and try to connect. That what I've done and I mean.
Some time ago I've reinstalled my WinXP, probs still here (of course that wasnt reason to reinstall OS, lol). Still dont know why. Sad

_________________
ML
View user's profileFind all posts by introSend private messageVisit poster's website


Joined: 08 Feb 2007
Posts: 67
Reply with quote
Ah! I thought you were connecting through a script, but you're just trying to connect through PhpED's "DB CLient" tab. I don't know enough about what the DB Client does behind the scenes to know where a slow-down might occur. Perhaps it retrieves a bunch of info about the server (status, processes, etc.) before it allows you to browse, which could explain a slow-down.

Perhaps someone from Nusphere could shed a little light on this?
View user's profileFind all posts by nothsaSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
PhpED's DB CLient uses native libraries (libmysql.dll in case of mysql), in other words it does not connect directly. What may slowdown the process is hostname resolving. If you work under VPN, all DNS requests are passed through DNS and therefore may run slower or even do not run at all depending on the VPN configuration. You may try to use IP addresses instead of hostnames in the db account settings.
Also, you may want to check if your FireWall monitors all network packets sending through DB connections and therefore may slow everything down too.
Also, we got some reports stating that some AV software prevented most of the local applications (including PhpED) from working fast.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Veteran

Joined: 06 Mar 2007
Posts: 158
Location: Poland
Reply with quote
I was doing everything You said. I've been turning off FireWall and I all time connect only by IP adresses (this always works faster). Btw. If there are probs with DNSes or FireWall, then scripts from local server schould have also probs, but hasnt.

Esh ! dmitri - thanks for hint with libmySQL.dll library, good to know that PhpED's library file for MySQL is only suitable for delete. So I've deleted this file placed in PhpED directory and I've put there lib from MySQL server's bin directory. And?
MySQL Cliend in PhpED works excellent now (or placed in system32, but faster works lib from server's bindir) !

Thanks for all for answers and help. Now is everything as schould be ! Smile Regards.

_________________
ML
View user's profileFind all posts by introSend private messageVisit poster's website
[resolved] too long wait for db connection
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic