Lower MySQL CPU Usage
Aug 14, 2008
I'm having a problem with high MySQL CPU usage on my server, one of my sites is getting hit pretty hard right now and MySQL is just killing the box. Its averaging a load of over 20, CPU usage is around 130%.
here is my my.cnf file. is there anything in their that should be changed to help lower the CPU usage?
# The MySQL server
[mysqld]
port= 3306
socket= /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 256M
max_allowed_packet = 1M
table_cache = 512
max_connections=500
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 2
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
Server Specs.
Pentium E 2.0Ghz
2GB ram
2x 320GB hard drives.
Cent OS 5
Cpanel
View 5 Replies
ADVERTISEMENT
May 18, 2007
After running for a while mysql suddenly starts using 100% CPU and my site goes down due to apache waiting with 150 sleeping processes.
Here is the top stats
PHP Code:
top - 00:20:47 up 12:01, 2 users, load average: 1.11, 1.04, 0.95
Tasks: 200 total, 2 running, 198 sleeping, 0 stopped, 0 zombie
Cpu(s):100.0%us, 0.0%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1004152k total, 618132k used, 386020k free, 118436k buffers
Swap: 2000084k total, 0k used, 2000084k free, 282372k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2011 mysql 18 0 177m 43m 5684 S 99.9 4.5 86:51.60 mysqld
14877 root 15 0 2360 1216 860 R 0.3 0.1 0:00.11 top
1 root 15 0 1948 648 556 S 0.0 0.1 0:00.97 init
ps ax | grep apache -c
152
On restarting mysql everything goes back to normal.
Can someone tell me how I could go about rectifying this?
I'm sure the server can take the load, coz before this the site was on a way slower machine and worked flawlessly.
View 11 Replies
View Related
May 11, 2007
is there any way to find out which users are most intensively using mysql? i've installed mytop which gives me some info, but the only user it shows connected is me (i.e. localhost) with no break down of what tables are being used etc.
also in whm i can see mysql has consuming quite a bit of memory/cpu, but it doesn't show me individual users; just the service as a whole.
View 3 Replies
View Related
Dec 20, 2007
I am using lighttpd php and mysql.
How to lower the cpu usage?
What's the best way to monitor mysql usage?
Quote:
top - 10:39:48 up 10 days, 35 min, 1 user, load average: 8.22, 9.38, 8.50
Tasks: 132 total, 5 running, 127 sleeping, 0 stopped, 0 zombie
Cpu(s): 73.5%us, 22.3%sy, 0.0%ni, 2.1%id, 0.0%wa, 0.1%hi, 2.0%si, 0.0%st
Mem: 2075000k total, 1919256k used, 155744k free, 113660k buffers
Swap: 2031608k total, 56k used, 2031552k free, 1177200k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
21899 mysql 20 0 200m 53m 4752 S 182 2.6 8100:18 mysqld
2548 lighttpd 20 0 20288 16m 680 S 19 0.8 878:33.76 lighttpd
9759 lighttpd 20 0 23168 7880 3048 S 10 0.4 8:50.96 php-cgi
30959 lighttpd 20 0 23164 7896 3096 S 10 0.4 11:40.95 php-cgi
9732 lighttpd 20 0 23204 7544 2664 S 8 0.4 8:59.42 php-cgi
10671 lighttpd 20 0 23248 7612 2664 S 8 0.4 4:51.95 php-cgi
9769 lighttpd 20 0 23312 8012 3048 S 7 0.4 8:55.61 php-cgi
9771 lighttpd 20 0 23104 7312 2584 S 7 0.4 8:50.33 php-cgi
10601 lighttpd 20 0 23336 8032 2996 S 7 0.4 4:56.21 php-cgi
31091 lighttpd 20 0 23064 7860 3100 S 7 0.4 11:30.69 php-cgi
9782 lighttpd 20 0 23116 7880 3060 S 7 0.4 8:57.46 php-cgi
8559 lighttpd 20 0 23396 7780 2668 R 6 0.4 6:43.16 php-cgi
View 7 Replies
View Related
Nov 6, 2009
Does anyone know if MySQL 5.1 or 5.0 uses less memory than 4.1 does?
View 3 Replies
View Related
Apr 25, 2008
how to set MAX_CONNECTIONS_PER_HOUR for one of my CPANEL USER (like:
cpaneluser_somesubuser) for all his databases?
I tried:
Quote:
mysql> GRANT USAGE ON *.* TO 'cpaneluser_somesubuser'@'localhost' WITH MAX_CONNECTIONS_PER_HOUR 10;
View 2 Replies
View Related
Jul 21, 2008
My mysql is using alot of memory although there is not much data into the mysql tables.
I tried to control mysql usage by editing my.cnf file but that didnt help.
Which variables should I edit in my.cnf to keep mysql using low memory?
I edited sort_buffer_size, key_buffer_size but that didnt help much. It uses alot of per-thread memory as well.
View 9 Replies
View Related
Jan 30, 2007
I need some help my CPU (Intel Core 2 Duo 1.7 Ghz) always gets high usage from mysql sometimes its using 95% cpu etc... How can I modify my.cnf to use less CPU and more ram since I have 3gb ram installed?
here is my.cnf
Code:
[mysqld]
back_log = 5
skip-innodb
max_connections = 400
key_buffer = 190M
myisam_sort_buffer_size = 156M
join_buffer_size = 4M
read_buffer_size = 4M
sort_buffer_size = 5M
table_cache = 1024
record_buffer = 1024
thread_concurrency = 2
long_query_time = 1
thread_cache = 1024
thread_cache_size = 992025
wait_timeout = 13
connect_timeout = 5
tmp_table_size = 64M
max_heap_table_size = 16M
max_allowed_packet = 16M
max_connect_errors = 500
read_rnd_buffer_size = 1024
bulk_insert_buffer_size = 32M
query_cache_limit = 1M
query_cache_size = 64M
query_cache_type = 1
query_prealloc_size = 163840
query_alloc_block_size = 32768
low_priority_updates=1
default-storage-engine = MyISAM
[mysqld_safe]
nice = -2
open_files_limit = 4096
[mysqldump]
quick
max_allowed_packet = 16M
[myisamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 32M
write_buffer = 32M
View 1 Replies
View Related
Mar 9, 2007
I'm always having MySQL consuming quite a bit of cpu & ram.
what's happening here?
PHP Code:
mysql 27519 7.2 12.8 158736 132496 ? Sl Mar08 180:57 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/server.hostname.pid --skip-external
I have replaced my server's real hostname to server.hostname
View 3 Replies
View Related
Mar 3, 2007
is there is any way or command to know every account on the server how much it using for mysql space?
i know i can know it from cpanel page but it's for one account is there a way to make a list for the usage?
and also i want if there is any wait to limit the database size?
cuz i want make a limitation for my clients every account cannot put any databases more thatn 100MB size?
View 5 Replies
View Related
Feb 10, 2007
I am very low of system resources but wish to use MYSQL as my database backend so I have installed MYSQL 4.0 on my Debian Sarge 3.1 VPS with linuxthreads and configured it to use least possible resources as my VPS only offers 32MB main memory. Generally I use the PS command to get the memory usage of running processes. But MYSQL being threaded confuses me. My system uses linuxthreads so all the threads get listed as seperate processes but show same stats in PS command output. On initialization, MYSQL starts 3 threads which according to documentation, are necessary for its functioning. This is what I see:
root 139 0.0 0.0 2436 4 ? S Feb07 mysqld_safe
mysql 163 0.0 4.5 5480 1264 ? S Feb07 0:02 mysqld
mysql 164 0.0 4.5 5480 1264 ? S Feb07 0:00 mysqld
mysql 165 0.0 4.5 5480 1264 ? S Feb07 0:00 mysqld
Is that means MYSQL is using only 1264 Kb of real memory? If that is the case, I am really happy about my tweaking skills. After doing a query through PHP, the output becomes:
root 139 0.0 0.0 2436 4 ? S Feb07 mysqld_safe
mysql 163 0.0 4.5 5510 1278 ? S Feb07 0:02 mysqld
mysql 164 0.0 4.5 5510 1278 ? S Feb07 0:00 mysqld
mysql 165 0.0 4.5 5510 1278 ? S Feb07 0:00 mysqld
Thats just very nominal resource usage. I am assuming that what PS is showing are just duplicate entries for a single MYSQLD process and 1278 Kb can be safely taken as its RAM usage. I hope it is not (1278 X No. of mysqld threads).
View 0 Replies
View Related
Aug 23, 2007
I had a 280 MB MySQL db on a 384 MB Linux Dual Xeon 3.2 GHz VPS (no CP, no additional software) and it was no where near enough. Even if I upgraded the VPS to say 1 GB of Memory, it would take no time at all to over load it at this rate. There must be something wrong with the setup, I can't see MySQL being so resource heavy... or is it?
View 7 Replies
View Related
Aug 13, 2009
I'm checking my CPU/Memory/MySQL Usage and I'm seeing that something called Munin is running at 54%. That is apparently the average for today. Can anyone give me any insight as to what this is?
Wikipedia classifies Munin as a network monitoring application. I don't think it should be using this much processing.
It appears that I may have enabled this plugin when I rebuilt my apache using EasyApache. Are there any big benefits to this? Looking at the graphics at first glance it doesn't look like there is. but then again, I'm not that knowledgable about this stuff.
View 1 Replies
View Related
Jul 27, 2008
I'm no SQL expert so I'm not exactly sure what to look for in-depth here. However, I noticed that MySQL would periodically raise to 98% cpu usage in top. So, I checked it out and turns out every time you load the front page of a site I host it takes about 30 seconds to load and its during that time that MySQL is freaking out.
I know the user relies heavily on MySQL, however I want to try to narrow down the problem as much as possible for them. Any recommendations on what else to look for?
View 5 Replies
View Related
Aug 3, 2008
just noticed mysql cpu usage has shot up from its usual 5-10% cpu to 30%+. domains are as normal and no extraordinary php processes.
any way i can tell what users are most heavily running mysql? (as in number queries / slow queries etc?) i know mysqladmin processlist but that only gives me a snapshot, whereas i want to see over 24 hours, who used mysql the most...
View 6 Replies
View Related
Feb 1, 2007
What is the average memory/cput usage for httpd connections.?One of the site is using 2.8% memory. Is it acceptable for 1 GB RAM servers?
View 6 Replies
View Related
Apr 20, 2008
on my server i have 104 accounts and the MySQL Usage for th cpus is 25.23
like this pic [url] is that danger? and how can i resolve it?
View 6 Replies
View Related
Aug 2, 2008
Not displaying CPU/Memory/MySQL Usage stats.Can u tell me how can i do it.
View 2 Replies
View Related
Oct 12, 2007
my server is jammed and takes minutes to load simple pages, can you please take a look ath the following image, its show under "CPU %" for mysql 177, does that mean mysql is using 177% of resources of cpu?
View 3 Replies
View Related
Jun 23, 2009
It is possible to show resources usage stat. to customers?
Any addons & scripts?
This is very important function, but cpanel didn't have it.
I created same thread to forums.cpanel.net but no replies.
View 8 Replies
View Related
Mar 18, 2009
One of my friends uses a popular shared hosting provider, and I was assisting him with a web site issue earlier.
I noticed the following warning in the host's control panel:
"[MySQL databases] may not be used for log evaluation operations, ad clicks, chat systems, banner rotations, or similar applications putting extreme loads on the database under any circumstances."
Is this common at other shared hosts?
View 14 Replies
View Related
Aug 8, 2008
I have 2 identical Fedora8 boxes with Apache 2.2.8, MySQL 5.0.45 and PhP 5.2.4. I use one as the Web+DB server (say box A), and the other (box B) just as the Web server connecting to the DB server on box A. I use this 2 machine configuration to test a LAMP based-Web application. I have a client program on other machines that can emulate a massive web workload to these 2 servers; it can emulate hundreds to thousands of users using the application simultaneously.
Before running the test, the connection to the DB server from both boxes seem fine. Using the mysql client program on either box A or B trying to connect to the DB, the connection goes through instantly. In the /etc/my.cnf file, I have max_connections=4096 and max_user_connections=4096. Note that the web app uses one single db user to connect to the db. To allow remote connection, I inserted one record into the user table of the mysql db whose the host field's value is '%' (allow connection from all remote hosts).
After running the test (which I found out that many requests sent to box B failed), mysql client program on box A is still able to connect to the db instantly; but the one on box B has a problem: it takes extremely long (5 - 10 minutes or even more) to establish the connection, it doesn't time out, just takes that long. I believe that's the cause for the failure of requests to box B.
View 1 Replies
View Related
Feb 14, 2009
I'm hosting some domains on a whm setup. One of the domains has outgrown the shared hosting setup, so I'm moving it to it's own vps. I want to limit the downtime, and I understand I should lower the TTL on the domain.
The registrar is Network Solutions and the nameservers are pointing to the shared host (which is on a whm/cpanel setup). How can I lower the ttl on this domain? Do I have to move the domain to a more advanced DNS service to achieve this, or is this something I can do within whm?
View 9 Replies
View Related
Feb 23, 2008
I don't mind have nfs running, but how do I keep it running at the lowest as possible... seems like it's hogging up all my usage/cpu's...
View 2 Replies
View Related
Jan 31, 2008
I was checking my server information today on WHM panel and this is what I saw:
Processor #1 Vendor: GenuineIntel
Processor #1 Name: Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz
Processor #1 speed: 1596.000 MHz
Processor #1 cache size: 4096 KB
Processor #2 Vendor: GenuineIntel
Processor #2 Name: Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz
Processor #2 speed: 2660.000 MHz
Processor #2 cache size: 4096 KB
Why is the Processor #1 speed labeled as 1.6 ghz? Processor #2 speed never goes down no matter how high the load is. Could it be the reason that my server can't handle 4 websites with a cumulative total of 20k unique hits per day?
View 8 Replies
View Related
Jun 18, 2007
On a Cpanel server, lightly loaded, but some fairly large sites (~3GB stored) loads get pretty high during CP backups (D/W/M to secondary drive, compression on). It looks like RAM is showing mostly used during this time (977,555 out of 1,026,348), and iowait is ~50, sometimes quite a bit higher at ~80 on the larger accounts. Not pegged at that amount, but fairly steady. This box only has 1GB RAM, so I'm thinking adding another Gig would alleviate this issue.
OS: CentOS 4.x
Hardware: Intel P4 3.6HT/1024MB/2x160GB
View 12 Replies
View Related
Jun 27, 2009
I'm gathering info for getting a new dedicated server, planning on using my own colocated hardware, but still looking at what's available in dedicated servers at the same time.
There are lot's of dedicated servers being offered at prices lower than 1U colocated rackspace. How's that possible, what am I missing?
View 13 Replies
View Related
Feb 13, 2008
When i check the server status is shows a high server load.
How do I lower the server load? it looks like for mysql activity.
View 14 Replies
View Related
May 8, 2007
I host my DNS with DNSmadeeasy.com , I noticed that I have daily more than 350.000 DNS requests for main domain, This domains got about 80.000 uniqes/day, so this is strange how can there be 350.000 DNS requests/day. Seems that I'll go over the quota because of this.
The TTL for all domains is set to 86400.
Is there a way to discover how its possible ? And also is there a way to do something to make this number lower (DNS requests)
View 1 Replies
View Related
Oct 4, 2008
I have a small issue that's probably easy to answer. If I upload a zip file to a Linux server, and run this command via SSH:
Code:
unzip -a name_of_zip.zip
Although it does unzip the directories as expected, it makes all file names and folders lowercase. This is a problem when trying to install software that relies on case sensitive names.
Does anyone know what command tells the server to retain the file names and not alter them?
View 1 Replies
View Related
Mar 9, 2008
to buy a good dedicated server to serve my clients here. So im looking from advices on a good hosting company USA based.
But i have been ping several major hosting USA company (like, mediatemple, theplanet, etc...) and i still didn´t get a Ping under 130ms.
If i ping a good EU company i get 60 to 90ms.
I know that the distance is bigger but,
Does anyone knows any good USA hosting company with a Ping to Europe lower than 100ms?
My budjet goes up to 800 $/moth
View 14 Replies
View Related