Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Java application which accesses a database. I tested it on my local machine with local database and it works just fine. But when I test it in our test environment where the application server and database server are differnt, the performence is terribly slow. The possible reasons I can think about are:

  • The time to get the database connection
  • Overall network traffic
  • Amount of data being selected and transferred
  • Load on the database server (other applications accessing the database).
  • Server configuration (e.g. memory allocated, connection pool size, etc.)

Which other reasons can affect the performance?

I am using JDBC with MySQL. Any help is appreciated.

share|improve this question

migrated from Dec 9 '11 at 1:11

This question came from our site for professional and enthusiast programmers.

have you checked the database size, is your dev db a replication of test db? – Prasanna Talakanti Dec 8 '11 at 15:10
@PrasannaTalakanti: yes, the db size is same, exact replica. – Bhushan Dec 8 '11 at 15:11
network latency - Did you test ping (ICMP) with the host name from the jdbc url? – ollins Dec 8 '11 at 15:16
@ollins: tested that as well, it's not that significant :( – Bhushan Dec 8 '11 at 15:18
up vote 2 down vote accepted

The most likely candidates are network latency and load. Is the database server being used by any other applications? What's the latency to the database server, and how much bandwidth is available?

I'd start the investigation with some query profiling on the DB server. You could easily compare query times on the production DB to your local to determine whether or not the server itself is a factor. If not, move on to profiling the network.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.