2

Why I have so many queries when I using 'show processlist ' show processlist;

And my CPU is 600+% used

enter image description here

Is there anything i can do to improve mysql performance? Thanks

ShunnarMeng
  • 115
  • 1
  • 1
  • 8

1 Answers1

7

Yes, you can change your storage engine from MyISAM to InnoDB - MyISAM only knows table level locking (when it writes to a record, it blocks the whole table), while InnoDB knows row level locking (it locks just the row you are writing to)

Tudor Constantin
  • 26,330
  • 7
  • 49
  • 72
  • But Myisam performance is better than innodb when have many queries – ShunnarMeng Jul 01 '11 at 04:48
  • 3
    @ShunnarMeng First, no, not necessarily. It depends in part on what types of queries, not just how many. Second, do you know MyISAM is better because you've tested it in your scenario or because you read the conclusions of some benchmark somewhere? MyISAM is certainly faster sometimes, but it will vary for each situation. – Wiseguy Jul 01 '11 at 04:54
  • 3
    In my opinion MyISAM has very few (disputable) pluses over InnoDB and many minuses - in fact, it has so little pluses , that I **always** prefer InnoDB – Tudor Constantin Jul 01 '11 at 05:01
  • 1
    I agree. Changing the default from MyISAM to InnoDB was a good move by MySQL, IMO. Admittedly, my use of MyISAM is fairly rare. When I do, it's only a few MyISAM tables for specific purposes among mostly InnoDB tables for all other uses. – Wiseguy Jul 01 '11 at 05:06