473,396 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Strange lag with C# and MySQL connector

3
Hello There, I've recently been working on a large project, very database driven, in C# on windows systems, calling a MySQL database on a linux box.
The project is going very well. Except that simple calls that are sometimes instant, will also sometimes take 10 - 20 seconds. If I were to click a button that refreshes a table, 7 times out of 10 it will be instant, the other 3 times it will lag.
Some details...
All computers that are running clients are running windows XP Prof SP2.
The computer I'm developing on is a P4 3.21 with 2g of RAM.
The other client computers (of which there are 6) range down to a AMD 1100 machine with 512Meg of RAM. They are never really all accessing the database at the same time. They all experience about the same range of performance with the database.
The server was a Thecus Yes Box N2100 Debian Linux with MySQL 5.0.24a, but thinking that it might have been the memory constraints of that system causing the lag, I installed a P4 2100 box with 1g of RAM with Debian, lean and mean, and installed MySQL 5.0.32 on it copying the database over...
But the lag situation was the same.
I started writing the software using a connector I was familiar with, mysql-connector-odbc 3.51
Thinking that that might be the problem I changed to MySQL connector .net 5.0.6 which is what I'm currently using.
But the lag situation was the same.
While I am continually refreshing a simple call, say,
Expand|Select|Wrap|Line Numbers
  1. SELECT t1.EmpNo, t1.JobNo, t1.CustomerName, t1.TaskName, t1.Start, t2.EstTime, t2.TotalTime, t1.TaskNo FROM Work AS t1 INNER JOIN Task AS t2 ON t1.JobNo = t2.JobNo AND t1.TaskNo = t2.TaskNo WHERE t1.Fin IS NULL AND t1.State = 'Started'




I can be running a ping at the same time and it won't fluctuate from being <1ms.
I can run heavy calls in MySQL Administrator over and over in rapid succesion without there being any lag.

My connection string is-
Expand|Select|Wrap|Line Numbers
  1. MyConString = "server=10.1.1.102;" +
  2. "uid=root;" +
  3. "pwd=pswrd;" +
  4. "database=classic;";



and a normal call is handled like this-
Expand|Select|Wrap|Line Numbers
  1. MySqlCommand cmd;
  2. MyConnection = new MySqlConnection(MyConString);
  3. MyConnection.Open();
  4. cmd = new MySqlCommand();
  5. MyDA = new MySqlDataAdapter();
  6. MyDS = new DataSet()
  7. cmd.CommandText = SQLquery;
  8. MyDA.SelectCommand = cmd;
  9. MyDA.Fill(MyDS);
  10. MyConnection.Close();



but with lots of error handling and stuff.
The IDE I'm using is Visual C# 2005 Express Edition.
The program works fine, and is sweet to use except for this frequent and annoying database lag.

any ideas?
May 31 '07 #1
3 3934
I' m having exactly the same problem. This show up on debian server. I'm using windows mysql server first. There is no lag on the program. But when i start using Debian linux mysql server, strangely somehow if there is some consecutive selects, there are 1-2 seconds lags between selects.

I make every variable same amout with linux and windows server but it is not about these things i think. Because if you use other connector like mysql query browser there isnt any lag. This cames up if you use connector .NET + debian Linux + c# .

Are there anybody except us sees that problem?? Can anybody help us :)
Nov 8 '08 #2
Pls. post some sample code to connect and insert a simple query to connect to MySQL(Sun or Linux) and c# 2.0.
Dec 18 '08 #3
r035198x
13,262 8TB
There could be several reasons for the slow behavior.
1.) Poor table design
2.) Lack of proper indexing on tables
3.) Inefficient code for both the front-end and back end.
4.) Poor/unreliable network connectivity
5.) Some database connections not being closed.

Some would even say that the list is endless.
Dec 19 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: bunnytail | last post by:
Hi All, I am making a Java Applet connects to mysql database, it works well in application mode. When I run it in applet mode, obviously the client running the applet should have the mysql...
3
by: JJ | last post by:
I am a newbie to mySQL. I am developing an ASP .net Web site with mySQL as the database (of products), using vb .net 2003. Can anyone point me in the direction of a good book (or in fact ANY book)...
4
by: Tracey | last post by:
I have a Mysql database hosted on a remote server. Previously, I could always connect to those databases using the 3.51 ODBC connector and linking the tables in Access. The benefit of this is that...
5
by: =?Utf-8?B?RGVubmlz?= | last post by:
I have installed MySql and am trying to use it in VB.Net 2003 using the MyOleDb driver. However, from all I can find, MyOleDb only works on VB.Net 2005. Does anyone know if this is correct or is...
14
by: Frank Rizzo | last post by:
I've been given a project to work with which involves connecting to MySQL from .NET 2.0 app. I've googled looked and there is a metric ton of different MySQL ADO.NET providers from different...
2
by: Vague | last post by:
Hello There, I've recently been working on a large project, very database driven, in C# on windows systems, calling a MySQL database on a linux box. The project is going very well. Except that...
1
by: sethupnr | last post by:
when i'm using a simple JSP-mysql code it shows some HTTP status 500 error.But simple JSP program without databse is running , Please help how to solve this problem. I'm new to JSP. my...
6
by: shivapadma | last post by:
i want to access mysql database server from jsp program for this i downloaded mysql-connector-java-3.1.14.zip mysql-connector-java-3.1.14 folder contains mysql-connector-java-3.1.14-bin.jar...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.