LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-10-2005, 01:59 AM   #1
gecoool
Member
 
Registered: Feb 2005
Location: Romania
Distribution: Fedora 2
Posts: 38

Rep: Reputation: 15
mutlithreaded client slow mysql queries


Hello everyone.

My problem: i wrote a multithreaded app (C++) which uses mysql database (Server version : 4.1.13-standard-log, linux RedHat 8 2.4.29 #1 SMP Thu Mar 10 03:05:14 EET 2005 i686 i686 i386 GNU/Linux). Most of the treads are staying for extended amounts of time in rt_sig state. After processing several hundreds of records, queries are becoming exteremely slow. Any help, suggestion is welcome !
 
Old 10-10-2005, 12:33 PM   #2
ftenario
Member
 
Registered: Jul 2003
Location: Camarillo, CA
Distribution: Debian
Posts: 48

Rep: Reputation: 15
I have writen a multi-process app instead of a multi-threaded server app that connects to mysql server. Although it may not be exactly the same, my queries are becoming slow after some time and even having some timeouts. It turns out that I have set "max_connections" to a high number. I followed some recommnedations from mysql site regarding settings of max_conections and set it at a lower number.

The result, queries are handled well (not slow) and no timeouts. It may not be your C++ app but could be the mysql settings thats causing the problem

Hope this helps.

ferdinand
 
Old 10-10-2005, 06:58 PM   #3
AlonsoTheBonzo
LQ Newbie
 
Registered: Jul 2004
Distribution: whatever
Posts: 10

Rep: Reputation: 0
Are you closing your connections (or returning them to a connection pool)? Unless your queries are very long running or you have a high-throughput system you should be fine with a dozen or so connections for most uses. If your high-water-mark of open connections is higher than that, be suspicious that you are not closing them. Another hint would be if the mysql memory footprint grows and grows.
 
Old 10-11-2005, 01:26 AM   #4
gecoool
Member
 
Registered: Feb 2005
Location: Romania
Distribution: Fedora 2
Posts: 38

Original Poster
Rep: Reputation: 15
thx guys, to all of U ;-)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Thin Client speed is to slow why? banner Linux - Networking 5 04-11-2005 08:03 PM
Security risks of php based mysql queries TigerOC Linux - Security 5 04-10-2005 07:30 AM
SQL queries per page (PHP, MySQL) Silent1 Programming 2 06-27-2004 11:15 PM
OpenGL mutlithreaded problem The_Nerd Programming 1 06-25-2004 12:36 PM
MySQL queries from Shell - unexpected result philipz Programming 5 05-04-2004 05:38 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration