tags:

views:

94

answers:

3

I have written a program which uses a MySQL database, and transaction between the database server (a very powerful one) and the client is happening over a ADSL connection (1 Mbit/s).

But I have a very very slow connection between each client and the server. Only approximately 3-4 KB/s data is send through the server. Neither the server nor the clients use the Internet for other purposes, just my program uses the Internet.

I can't figure out why? Is the reason MySQL server packet size?

Any suggestions?

+1  A: 

You first have to debug both connections.

What is your upload speed if you upload a file with WinSCP ot equivalent to the MySQL server? It should be near 90 KB/s with ADSL 1 Mbit/s.

jujule
I checked but server has a good upload speed which is over 80kb/s.Any different ideas?
rasputin
test with SQLyog or similar GUItry SHOW FULL PROCESSLIST; to see if theres any other queriescheck config with SHOW VARIABLES;max_allowed_packet doesnt affect the 'bandwidth'
jujule
+1  A: 

The effective transfer rate is often heavily limited by the number of roundtrips between client and server. Without seeing your code it is sort of difficult to tell, but you should check the number of requests happening. If you have a single request that results in many records being returned, you should see a better usage of bandwidth than with a higher number of requests which only deliver a few rows each.

In the latter case the actual result transfer is probably quite fast, but the latencies involved in the "control communications" (i. e. the statements themselves, login requests etc.) will add up, effectively lowering overall throughput.

As for the packet size: When it is very small, there is more overhead in the communications, increasing the aforementioned effect. The server's default max_allowed_packet size if 1MB if memory serves, but that should be fine with your connection.

Daniel Schneller
+1  A: 

Try using mytop to identify the server low performance cause. Another one: you may be using SELECT COUNT(*) FROM .. for large InnoDB tables which causes a table scan.

And can you test for some other services whether the exchange data rate between the machines is OK? Even if the even if the output bandwidth is lower for ADSL users 3-4 kB might not be the reason of low performance.

StarWind Software