Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2009
    Posts
    122

    MySQL CPU usage over 300%

    Hello,

    Im running this config on my VPS:
    Intel Xeon x3440
    8GB RAM
    2x 500GB disks raid1

    Currently running Kloxo, php as dso, and nginx in front of apache. nginx serves static files, problem is CPU usage. Do you have any suggestions how to reduce CPU usage, using cache systems like memcached or varnish? I currently have onyl eaccelelator but it doesnt help much. /etc/my.cnf is already optimized.

    Any suggestions would be appreciated.

  2. #2
    Join Date
    Mar 2010
    Location
    Germany
    Posts
    681
    too little data. :>

    but based on that (300% mysql use) - go with memcached
    Check out my SSD guides for Samsung, HGST (Hitachi Global Storage) and Intel!

  3. #3
    Join Date
    Dec 2009
    Posts
    122
    Hi!

    Problem is reading from mysql and writting to mysql. I know writting cant be helped but reading from mysql can be improved by caching. I currently run nginx as a frontend. Now, options are memcached OR vernish, I basically need something what will cache the dynamic pages and help me reduce mysql CPU usage.

    Now, I installed memcached as suggested above, but how do I insert it into nginx. Here is my vhost.conf
    http://pastebin.com/Hj4fXtCw

    If someone has other suggestions please share!

    Thank you very much

  4. #4
    Join Date
    Mar 2010
    Location
    Germany
    Posts
    681

    *

    Quote Originally Posted by PirateSolutions View Post
    Hi!

    Problem is reading from mysql and writting to mysql. I know writting cant be helped but reading from mysql can be improved by caching. I currently run nginx as a frontend. Now, options are memcached OR vernish, I basically need something what will cache the dynamic pages and help me reduce mysql CPU usage.

    Now, I installed memcached as suggested above, but how do I insert it into nginx. Here is my vhost.conf
    http://pastebin.com/Hj4fXtCw

    If someone has other suggestions please share!

    Thank you very much
    The first thing is to not generate what doesn't have to be dynamic.
    A friend of mine had a table of thumbnails that was recreated a few dozen times per second... Instead one can use multiple static versions that are generated once per second and delivered statically. This is where you save, by 1000s - the most performance.

    Next, you need to hook up mysql and memcached i think

    and last,

    http://www.frequency.com/video/high-concurrenc/6174481
    watch that from start to end.
    Check out my SSD guides for Samsung, HGST (Hitachi Global Storage) and Intel!

  5. #5
    Join Date
    Aug 2010
    Location
    Prague, Czech Republic
    Posts
    403
    I'd suggest you to determine which server eats a lot of CPU.
    It could be MySQL or apache or even nginx.
    It's useful to monitor your IO wait. You can do it with top.
    Also consider using of redis. It's very fast.
    Supportex.Net server management, full range of services. EU-based outsourced company. Since 1998.
    Outstanding quality for high performance projects; clustering and high-availability solutions, DDoS protection.
    Cisco/Juniper network management & deployment assistance. Network design and monitoring.

  6. #6
    Join Date
    Jul 2009
    Location
    UK
    Posts
    1,308
    Enable slow query logging.
    The chances are its just a bunch of badly made up querys or badly indexed tables.
    Live Chat Support Software for your Business website - IMsupporting.com

Similar Threads

  1. mysql 100% CPU usage
    By Zeest in forum Hosting Security and Technology
    Replies: 11
    Last Post: 05-20-2007, 07:51 AM
  2. MySQL Cpu / Memory usage
    By alphix in forum Hosting Security and Technology
    Replies: 3
    Last Post: 03-10-2007, 10:15 AM
  3. Hostgator - cpu and mysql usage
    By gder01 in forum Web Hosting
    Replies: 7
    Last Post: 07-29-2006, 02:04 PM
  4. mysql cpu usage 50%
    By jmansoor in forum Hosting Security and Technology
    Replies: 2
    Last Post: 02-23-2005, 04:19 AM
  5. 99.9% MySql CPU Usage, how bad is this?
    By Duskwalker in forum Hosting Security and Technology
    Replies: 2
    Last Post: 01-08-2005, 03:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •