LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 05-06-2004, 09:22 AM   #1
eduac
Member
 
Registered: Jun 2003
Distribution: Arch - www.archlinux.org
Posts: 186

Rep: Reputation: 30
limit cpu usage by mysql


hi fellas,

anybody has a idea to limit the cpu usage by mysqld? because sometimes the mysqld take 97% - 99% of CPU resources.

my server have:
2.8Ghz Pentium4
1GB RAM
40GB HD
GNU/Debian 3.0r1
Kernel 2.6.4
 
Old 05-06-2004, 10:30 AM   #2
RolledOat
Member
 
Registered: Feb 2003
Location: San Antonio
Distribution: Suse 9.0 Professional
Posts: 843

Rep: Reputation: 30
I assume that you want to limit it because it is taking away from what you want to do, making your desktop sluggish, etc. If so, you can renice (or kill and start with the nice command) with a positive value. Every process in linux has a niceness value. You can see it yoursefl with top. I would expect that mysql starts with the default 0, which means it has the same priority as most everything else. If you give it a nice of say, 10, it will 'get out of the way' of most other processes with a higher priority and use less CPU time.

man nice
man renice

RO
 
Old 05-06-2004, 02:40 PM   #3
eduac
Member
 
Registered: Jun 2003
Distribution: Arch - www.archlinux.org
Posts: 186

Original Poster
Rep: Reputation: 30
did u have a example of configuration in /etc/mysql/my.cnf ? because i think the nice is not the answer for this problem.
 
Old 06-08-2004, 05:08 PM   #4
bpapiiro
LQ Newbie
 
Registered: Jun 2004
Posts: 1

Rep: Reputation: 0
hi,

I have an issue which is not like that. I wish the MySQL to use more than 24.9 from CPU time but it refuse to do that. If I try to send many queryes to mysql it comes slowly but it do not use more than 24.9 from cpu time. Can anybody give me a solution?

my.cnf
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
datadir=/var/lib/mysql
skip-locking
skip-name-resolve
set-variable = key_buffer=256M
set-variable = max_allowed_packet=1M
set-variable = table_cache=256
set-variable = sort_buffer=1M
set-variable = record_buffer=1M
set-variable = myisam_sort_buffer_size=64M
set-variable = thread_cache=500
# Try number of CPU's*2 for thread_concurrency
set-variable = thread_concurrency=8
set-variable = myisam_sort_buffer_size=64M
log-bin
server-id = 1


# Point the following paths to different dedicated disks
tmpdir = /tmp/
#log-update = /path-to-dedicated-directory/hostname

[mysqldump]
quick
set-variable = max_allowed_packet=16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
safe-updates

[isamchk]
set-variable = key_buffer=128M
set-variable = sort_buffer=128M
set-variable = read_buffer=2M
set-variable = write_buffer=2M

[myisamchk]
set-variable = key_buffer=128M
set-variable = sort_buffer=128M
set-variable = read_buffer=2M
set-variable = write_buffer=2M

[mysqlhotcopy]
interactive-timeout

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
limit cpu % usage for a process student04 Linux - General 15 03-18-2014 07:22 PM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 08:43 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM
How can I limit the CPU usage of a PID? ideasman Linux - Software 1 04-01-2004 07:15 AM
Controlling CPU usage & memory usage Saravana babu Linux - Software 0 02-18-2004 05:55 AM


All times are GMT -5. The time now is 11:09 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration