mysql current_MySQL服务器的优化方法_MySQL - current

9c98fe03383ffeca78ca12f3181f2137.png

...tail = null

this.append = (data) => {

let node = new Node(data),

current

if(head === null) {

head = node

tail = node

}else {

current = head

while(current.next) {

current = current.next

}

current.next = node

tail = node

}

length ++

return true

}

this.ins...

bitsCN.com

1、调整系统因素及启动参数

我们从系统级别的因素开始说起,因为有些方面的因素必须尽早决定才能取得较大性能改进。其他情况下,只需要快速看一下本章节即可。不过,在这个级别看看能做什么以取得更高性能更合适。

使用默认的操作系统这很重要。想要最有效地使用多CPU机器,就使用Solaris(因为它的线程实现确实很好)或Linux(因为2.2的内核对SMP有良好的支持)。请注意,老版本的Linux内核默认会有2GB文件大小限制。如果使用这样的内核而文件又确实需要大于2GB,那么就必须对ext2文件系统打大文件支持(LFS)补丁。其他文件系统诸如 ReiserFS 和 XFS 则没有这个限制。

在MySQL投入生产之前,我们建议你在欲使用的平台上先做一下测试。

其他tips:

如果有足够的RAM(随机存储器),则应该去掉所有的交换设备。有些操作系统在一些情景中尽管有剩余内存也会使用交换设备。

使用MySQL选项 --skip-external-locking 来避免外部锁。从MySQL 4.0开始,这个选项默认是打开的。在这之前,只有编译支持

MIT-pthreads 才能默认打开,因为在所有平台上的MIT-pthreads 不能全部都支持 flock()。这在Linux上也是默认打开的,因为Linux的文件锁还不安全。注意,--skip-external-locking 选项在服务器运行时并不会影响其功能性。只要记住在运行

myisamchk 前要关闭服务器(或者锁定并且刷新相关数据表)。在一些操作系统上这个选项是强制的,因为外部锁在任何情况下都无法使用。不能使用 --skip-external-locking 选项的唯一情况是:在同一个数据上运行多个MySQL服务器(不是客户端),或者运行

myisamchk 检查(不是修复)数据表前没有先告诉服务器要刷新并且锁定该表。使用 --skip-external-locking 选项后依旧可以使用 LOCK TABLES 和 UNLOCK TABLES 语句。

2、调整服务器参数

可以使用以下 mysqld 命令(在MySQL 4.1以前,忽略 --verbose)来确定默认的缓冲大小:

shell> mysqld --verbose --help

这个命令产生了所有的 mysqld 选项以及可以配置的系统变量列表。结果中包括默认值,看起来像是如下:

back_log current value: 5

bdb_cache_size current value: 1048540

binlog_cache_size current value: 32768

connect_timeout current value: 5

delayed_insert_limit current value: 100

delayed_insert_timeout current value: 300

delayed_queue_size current value: 1000

flush_time current value: 0

interactive_timeout current value: 28800

join_buffer_size current value: 131072

key_buffer_size current value: 1048540

long_query_time current value: 10

lower_case_table_names current value: 0

max_allowed_packet current value: 1048576

max_binlog_cache_size current value: 4294967295

max_connect_errors current value: 10

max_connections current value: 100

max_delayed_threads current value: 20

max_heap_table_size current value: 16777216

max_join_size current value: 4294967295

max_sort_length current value: 1024

max_tmp_tables current value: 32

max_write_lock_count current value: 4294967295

myisam_sort_buffer_size current value: 8388608

net_buffer_length current value: 16384

net_read_timeout current value: 30

net_retry_count current value: 10

net_write_timeout current value: 60

read_buffer_size current value: 131072

read_rnd_buffer_size current value: 262144

slow_launch_time current value: 2

sort_buffer current value: 2097116

table_cache current value: 64

thread_concurrency current value: 10

thread_stack current value: 131072

tmp_table_size current value: 1048576

wait_timeout current value: 28800

bitsCN.com

...tail = null

this.append = (data) => {

let node = new Node(data),

current

if(head === null) {

head = node

tail = node

}else {

...结果中包括默认值,看起来像是如下:  back_log current value: 5   bdb_cache_size current value: 1048540   binlog_cache_size current value: 32768   connect_timeout cur

...return $this;

}

public function edit($id,$value){

$flag = false;

$current = $this->head;

while(@$current->id !=null){

if($current->id

...

this.append = function(element){

var node = Node(element),

current,

previous;

if(!head){

head = node;

...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值