I have a dedicated server and this is its information :
1 SSD for mysql
1 SAS hdd (15k ) for files
processors : 2 X E5-2620
memory : 64 Gig DDR3
I always see my server is using very little of memory : Memory Used 8.17% (5,384,608 of 65,936,792)
but it uses processors very mush
here is the top-c of my server
Swap: 0k total, 0k used, 0k free, 15668996k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3666 mysql 5 -15 4851m 675m 7220 S 234.1 1.0 1522:29 /usr/sbin/mysqld -
27284 funtoop 20 0 238m 44m 7912 S 70.8 0.1 0:02.25 lsphp5
27211 songsara 20 0 259m 64m 8068 R 56.9 0.1 0:07.04 lsphp5:/home/songsa
24758 songsara 20 0 357m 66m 8640 R 49.6 0.1 3:02.04 lsphp5:/home/songsa
as you can easily the main process is on mysql ,
I think it doesn't allow my memory to cache or something like this !
is there any solution in this condition ?
A couple quick things. Try turning on slow query processing to identify what queries are talking long to run. These can help you identify what is churning your cpu. Once you identify these queries you can do a describe to find out what is going on in the query execution. You may just need to do some index tuning as well to reduce the churn.
Now on a side note you could also look to break out your MySQL to seperate Cluster and use something like Clustrix to push the read/write over multiple nodes in a cluster to increase the IO available and reduce query time. It really depends on what your doing.
Another thing is if this is for some sort of web application or similiar you might be able to implement either page caching with Varnish to reduce the dynamic requests hammering the DB or implement Memcached on queries that don't change that often for the result set. This way you can cache the results in memory for near instant return bypassing the DB for repeated queries.
Let me know if you want me to go in more depth.
PCLHS | SAS70 Datacenters in New Jersey/Texas 100TB Dedicated Servers • 1U - Full Cab Colocation • Complex Hosting • Horizontally Scalable Hosting • DR/HA Hosting • Public and Private Clouds • Web Farms • Innovative, Reliable, and Responsive Contact Us E: mark [at] pclhs.net | W: www.pclhs.net