hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Mysql reigns CPU! :)
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

Mysql reigns CPU! :)

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 09-04-2004, 06:49 AM
Angelo Angelo is offline
Web Hosting Master
 
Join Date: Mar 2004
Location: Los Angeles
Posts: 617

Mysql reigns CPU! :)


One of my boxes is being pushed hardly by MySQL (or i think it is mysql) Checking the process list, i can see only a 15-20 queries doing normally. But the load goes on crazy. Averagely 10, and sometimes 35-40. It's also using from swap..

I have tried alternatively optimizing for both mysql and httpd from my logic and also from their official sites, but that did not work out. So i guess something is not going well, maybe a corruption or attack (can not last for that long? netstat seems ok)

Do you have something coming to your mind that i can not think, just share with me, my brain stopped working )

Box is celeron 1.0 ghz, 512 mb RAM.


From "top"

---
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
1829 mysql 9 0 18036 17M 1992 S 78.4 3.5 1:00 0 mysqld
1036 root 10 0 12716 12M 12476 S 18.7 2.4 1:43 0 httpd
---


From my.cnf

---
key_buffer = 256M
wait_timeout = 9
max_connections = 79
connect_timeout = 15
max_allowed_packet = 1M
table_cache = 256
sort_buffer_size = 4M
read_buffer_size = 1M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_type=1
query_cache_limit=1M
query_cache_size= 1M
thread_concurrency = 8
---


From httpd.conf

---
Timeout 300
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 8
MaxClients 150
MaxRequestsPerChild 100
---

Reply With Quote


Sponsored Links
  #2  
Old 09-04-2004, 08:41 AM
Haze Haze is offline
Web Hosting Master
 
Join Date: Apr 2001
Posts: 2,588
1. Change your thread_concurrency = 8 down to 2
2. Get more RAM.

I'd also suggest a more powerfull CPU.

__________________
Beau Henderson

Reply With Quote
  #3  
Old 09-04-2004, 08:47 AM
Angelo Angelo is offline
Web Hosting Master
 
Join Date: Mar 2004
Location: Los Angeles
Posts: 617
Thanks for the reply Haze.
Yeah i also thought that upgrading the system, just curious if its some error with the software because this server only contains one site. Yeah it is big enough but i was thinking that 1.0 ghz with 512 mb ram can hold one big site.

Reply With Quote
Sponsored Links
  #4  
Old 09-04-2004, 10:38 AM
EXOWorks EXOWorks is offline
Web Hosting Evangelist
 
Join Date: Nov 2002
Posts: 510
Well, If you can afford some performance decrease ( speed wise ) then you should change the following values in my.cnf

key_buffer = 16M
table_cache = 128
sort_buffer_size = 512k
read_buffer_size = 512k

Can you post your mysql Status ?? and the output from "top" command.

__________________
Get help with your server optimization - A forum on server optimization...
ExoPHPDesk - Powerful PHP HelpDesk

Reply With Quote
  #5  
Old 09-04-2004, 11:19 AM
Angelo Angelo is offline
Web Hosting Master
 
Join Date: Mar 2004
Location: Los Angeles
Posts: 617
Seems to be better ha, at least load is not 10 ) Slower though.

TOP:

16:11:13 up 4:41, 1 user, load average: 2.71, 3.62, 6.31
172 processes: 163 sleeping, 9 running, 0 zombie, 0 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 31.7% 0.0% 17.4% 0.0% 0.0% 0.0% 50.8%
Mem: 511528k av, 405484k used, 106044k free, 0k shrd, 7088k buff
91176k active, 283592k inactive
Swap: 1052216k av, 18308k used, 1033908k free 190868k cached

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
17601 mysql 9 0 13788 13M 2004 S 66.8 2.6 1:39 0 mysqld
4806 root 9 0 4060 1196 1152 S 20.4 0.2 1:31 0 httpd


MySQL Status:

Uptime: 272 Threads: 6 Questions: 8740 Slow queries: 0 Opens: 31 Flush tables: 1 Open tables: 25 Queries per second avg: 32.132

Reply With Quote
  #6  
Old 09-04-2004, 04:14 PM
hiryuu hiryuu is offline
Web Hosting Master
 
Join Date: Jan 2003
Posts: 1,715
That's quite a few queries for a box that low, but you should check your queries to make sure they're properly indexed.

Post a 'mysqladmin extended-status'. It should give a decent idea of how often you're doing table scans.

__________________
Game Servers are the next hot market!
Slim margins, heavy support, fickle customers, and moronic suppliers!
Start your own today!

Reply With Quote
  #7  
Old 09-04-2004, 04:19 PM
Steven Steven is offline
I like ice cream
 
Join Date: Mar 2003
Location: California USA
Posts: 11,788
You are kind of killing the reason of query cache in your config.

__________________
Steven Ciaburri | Proactive Linux Server Management - Rack911.com | 1.855.RACK911
System Administration Extraordinaire

Managed Dedicated Servers, Linux Server Management, Disaster Recovery, Server Security Audits

Reply With Quote
  #8  
Old 09-04-2004, 08:04 PM
Angelo Angelo is offline
Web Hosting Master
 
Join Date: Mar 2004
Location: Los Angeles
Posts: 617
It was like this before the query_cache limits are different, even do not exist. I see that this box can not hold this site maybe The lowest load i can see is averagly 4.00 after all my efforts on optimization )

Reply With Quote
  #9  
Old 09-04-2004, 10:34 PM
wheimeng wheimeng is offline
Web Hosting Master
 
Join Date: Feb 2003
Location: Kuala Lumpur, Malaysia
Posts: 4,970
Celeron is pretty bad in handling MySQL, get a P4

__________________
Whei Wong
OnApp - www.onapp.com
Cloud and CDN software for the hosters!

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Web Host Rackspace Launches Private Beta for MySQL Cloud Database Web Hosting News 2011-12-01 21:09:51
Parallels Now Offering Licenses for CloudLinux OS Web Hosting News 2011-10-26 17:29:25
Web Hosting Sales and Promos Roundup - October 7, 2011 Web Hosting News 2011-10-07 19:56:18
Web Hosting Software Firm CloudLinux Releases CloudLinux OS Version 6.1 Web Hosting News 2011-09-13 14:08:49
Web Host FireHost Partners with Cloud Security Firm Gazzang for Data Encryption Web Hosting News 2011-08-16 20:33:43


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?