MySQL optimized configuration

Source: Internet
Author: User

MySQL optimized configuration

Tmp_table_size Set Size 500MB

Key_buffer_size =384m//key_buffer_size Specifies the size of the buffer to use for the index, increasing it to get more

Good index processing performance. This parameter can be set to 256M or 384M for servers with around 4GB. Attention

: The value of the parameter set too large will be the overall efficiency of the server down!

Sort_buffer_size = 17MB//Sort Cache

READ_BUFFER_SIZE=4M//Read cache

TABLE_CACHE=256//

Ft_min_word_len//Full-Text Search

Query_cache_size Query Caching

?
#!/bin/sh
#written by Cuiyang 20081118
###### #检查mysql状态
Port= ' Netstat-na | grep "LISTEN" | grep "3306" | awk ' {print $} ' | Awk-f. ' {print $} '
If ["$PORT"-eq "3306"]
Then
###### #检查mysql占CPU负载
Mysql_cpu= ' Top-u root-b-N 1 | grep MySQL | awk ' {print $} ' |awk-f. ' {print '} '
# #如果mysql CPU load is greater than 80, restart MySQL
If ["$mysql _cpu"-ge "80"]
Then
PS xww |grep ' bin/mysqld_safe ' |grep-v grep | awk ' {print $} ' | Xargs kill-9
PS xww |grep ' libexec/mysqld ' |grep-v grep | awk ' {print $} ' | Xargs kill-9
Sleep 5
/usr/local/mysql/bin/mysqld_safe--user=root >/dev/null &
Else
Exit 0
Fi
Else
/usr/local/mysql/bin/mysqld_safe--user=root >/dev/null &
Fi
?>

Number of affected columns: 4999 (query takes 0.1756 seconds)

UPDATE ' zgy_jobs_faces ' SET postime = ' 1250784000 ' WHERE jid <505000 and Jid >500000

Jobs_faces Field
Field Type Collation property Null default extra action
Jid Int (a) UNSIGNED no auto_increment
OID Int (0) UNSIGNED
CID Mediumint (8) UNSIGNED no 0
Requests smallint (4) UNSIGNED no 0
Views Mediumint (6) UNSIGNED is 0
Checked tinyint (1) UNSIGNED no 0
istoped tinyint (1) UNSIGNED no 0
Postime Int (a) UNSIGNED no 0
Losetime Int (a) UNSIGNED no 0
toped tinyint (1) UNSIGNED no 0
Toptime Int (a) UNSIGNED no 0
Bold tinyint (1) UNSIGNED no 0
Highlight varchar (7) Gbk_chinese_ci No
Lightime Int (a) UNSIGNED no 0
People smallint (4) UNSIGNED no 0
Sex tinyint (1) UNSIGNED no 0
Djobskinds varchar () gbk_chinese_ci No
Jname varchar () gbk_chinese_ci No

Number of affected columns: 4999 (query takes 0.2393 seconds)

UPDATE ' zgy_jobs_fields ' SET postime = ' 1250784000 ' WHERE jid <455000 and Jid >450000

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.