• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

mysql 5.x + jakarta tomcat = slow as cr@p

Homerboy

Lifer
I had a home server running mysql 4.x and jakarta tomcat smoothly and "flawlessly" for the longest of time.

I recently got some new hardware and decided to switch from win2k pro to WinXP Pro as the OS so I wiped everything clean (saving my /webapps/ROOT and /data directories in tomcat and mysql respectively.

I installed the latest mysql and the latest tomcat copied over my diretories and started to tinker. Well everything loads fine, but its PAINFULLY slow. I narrowed it down to the mysql/java connector, which I went to sun.com, got the latest .jar file restarted the services and still slow.

Does anyone have any suggestions. I know just enough about this crap to get myself in trouble, sadly not enough apparently to get myself out of trouble.

Thanks in advance.

 
I'll give ya a bump, but I can't help ya. We run the latest Tomcat w/ latest Java and connect to Oracle 9i. We have no speed issues with the connector. (Running on Windows 2003).

I know something that helped us out performance wise was using a connection pool rather than opening and closing connections each time. Just something that popped in my head.
 
What is the Driver's full class name? Is the same as: "org.gjt.mm.mysql.Driver" ?

I have pretty much the same setup... MySQL - Tomact on a WInXP Pro box.

Iuse these drivers and there's no problem

I think I downloaded them from: http://mmmysql.sourceforge.net/


 
How heavily is this site being hit and how careful are you about cleaning up connections when you're done with them? DriverManager is a terrible way to connect to a database from a web application but you should at least have a try/finally starting immediately after you open the connection and closing it in the finally block.
 
are you using the exact same configuration? (i.e., the same version of tomcat, mysql, and the jdbc driver)

you can also try checking the log files.
 
Kamper: Site is not beign hit at all... I'm talking just ONE connection from me. The site in quesion is a small site, only a handful of users with a few hundred hits per day (but right now its 0 as its closed until I figure this out so its just me hitting it).

itachi: I upgraded mySQL, upgraded tomcat on this install. In turn I upgraded the connector .jar
nothing is in the log files as far as errors, it just takes forever to load.

Keep in mind that the code I pasted above is the ONLY code in the test.jsp right now. There are no queries or anuthing, just that connection is taking forever. I'd fear what actual queries would do.
 
Have you got a firewall up (like the integrated sp2 one)?

I'd also try the version of mysql that you were using previously along with an original copy of the data.
 
no firewall is up (SP2 one turned off)
I guess I could try reverting back to the old mysql and the original connector .jar
confirm EXACTLY where I am to have this .jar located though...
 
It could be pretty much anywhere classes are loaded from into the scope of your application which, in j2ee is a lot. If you're just using it for this app then the safest place is probably in the WEB-INF/lib directory (or something like that, I haven't touched a web application in a while...). As long as it loads and you're sure you don't have a different version of the jar anywhere else then it shouldn't make a difference.

My suggestion about the old mysql was just because I figured maybe the data file formats changed between the versions you've used and maybe it was getting confused about that.
 
ok well then I do have it in the right spot... I mean I KNEW it, I just needed to be reafirmed.
the trick is with this is I've create an entirely new "site" just to test this, with only 1 talbe, 1 row of data, so the old info, at this point isn't even in the database itself. I've got 100% new here at this point... its really P-ing me off.
 
well I created a mySQL database on hosted server at lunarpages.com but left the .jsp pages on my home server. Pointed the .jsp to the new mySQL @ lunarpages, and it makes the connection much faster (granted load times are a tad slow do to all the bouncing around). But obviously this tells me its not the .jsp itself, but rather something in my implementation of mySQL I guess. I'm going to swap out the SCSI drives in the enclosure (keeping what I have as C now safe and dry) and reinstalling everythign on a clean SCSI drive, including OS and see what happens.
 
Holy shite, they let you open a db connection over the internet? 😕 Brave administrators!

At this point, I'd run a packet sniff on it, for the entire duration of the connection and check the relative times of the various packets. Not guaranteed to reveal anything, but much easier than reinstalling the os 😛

Edit: have you tried other methods of connecting to your database? phpmyadmin (or whatever it's called) and command line? I assume you've done at least one if you got a new database set up. If commandline, was the connection over tcp or a named pipe? If over tcp, did you connect to localhost or your external ip?
 
Originally posted by: kamper
Holy shite, they let you open a db connection over the internet? 😕 Brave administrators!

At this point, I'd run a packet sniff on it, for the entire duration of the connection and check the relative times of the various packets. Not guaranteed to reveal anything, but much easier than reinstalling the os 😛

Edit: have you tried other methods of connecting to your database? phpmyadmin (or whatever it's called) and command line? I assume you've done at least one if you got a new database set up. If commandline, was the connection over tcp or a named pipe? If over tcp, did you connect to localhost or your external ip?


I've use mySQL front as a GUI frontend for "working the database" and it is smooth as silk. Its something between the damned 2 applications, tomcat and mySQL on my machine.
 
WORKING!

I sat back and stared at it. Then thought about what I was questioning and where it was located. Then I read between the lines of what kamper said: "and you're sure you don't have a different version of the jar anywhere else then it shouldn't make a difference. " which got me to thinking... maybe there was an older version of the .jar laying around rather than in the /WEB-INF/lib where I always put them. Did a C: drive search for .jar and sure as sh!t, there was a mm.mysql-2.0.13-bin.jar buried in the <java>/lib folder. Renamed to .old and blammo.

Thanks chaps!!!
 
Back
Top