现在的位置: 首页 > 综合 > 正文

Sybase 12.5 调优

2012年01月19日 ⁄ 综合 ⁄ 共 1929字 ⁄ 字号 评论关闭

数据库的创建:

tempdb数据和日志分离:

USE master

Go

DISK INIT name = 'tempdbdev01', physname = '/opt/sybase/data/tempdbdev01.dat' , size = '1G',dsync = 'false'

Go

DISK INIT name = 'tempdblogdev01', physname = '/opt/sybase/data/tempdblogdev01.dat', size = '1G',dsync = 'false'

Go

ALTER DATABASE tempdb ON tempdbdev01 = '1G' LOG ON tempdblogdev01 = '1G'

Go

USE tempdb

Go

删除tempdb上使用的master段:

EXEC sp_dropsegment 'logsegment', 'tempdb', 'master'

go

EXEC sp_dropsegment 'system', 'tempdb', 'master'

go

EXEC sp_dropsegment 'default', 'tempdb', 'master'

Go

如果已针对 tempdb 建立了设备,则只需禁用 dsyncio,但需要重新启动 Adaptive Server:

EXEC sp_deviceattr 'tempdbdev01', 'dsync', 'false'

Go

EXEC sp_deviceattr 'tempdblogdev01', 'dsync','false'

Go

数据库设备最好设置Direct IO,获得的性能相信会让你满意。

Sybase ASE 15.0.2运行中的配置参数及调优

1、内存

sp_configure “max memory”,0,”2600M” (设置为共享内存的75%,重启生效)

sp_configure “allocate max shared mem”,1 (启动的时候自动分配max memory指定的最大内存)

sp_cacheconfig “default data cache”,”1300m”(设置数据缓存为max memory的一半)

sp_cacheconfig “default data cache”,”cache_partition=2″ (在SMP的环境中还有一个问题就是螺旋锁的竞争,当用sp_sysmon观察到资源缓存螺旋锁争夺超过10%时就需要分区。)

sp_poolconfig “default data cache”,”128m”,”16k” (增加一个16K I/O缓存池,解决排序等大IO操作,需要在长期观察后才能使用性能最佳化.)

sp_configure “procedure cache size”,102400 (过程高速缓存,通常是Max mem20%,这里是200M)

sp_cacheconfig ‘tempdb_cache’,'200m’,'mixed’ (创建一个200M命名高速缓存tempdb_cache给temdpb使用)

sp_bindcache ‘tempdb_cache’,tempdb (将tempdb_cache绑定到tempdb)

2、CPU(默认值为1)

当服务器的CPU个数多于一个时,可以考虑多CPU进行并行处理。(并行查询、并行dbcc、并行建立索引、并行bcp)

可根据实际CPU数来修改,若CPU>1时,一般设置为N-1。实际上OS会自动调度。

sp_configure “max online engines”,8

sp_configure “number of engines at startup”,8

sp_configure “number of worker processes”,8 (并行度*并发连接数*1.5倍)

sp_configure “max parallel degree”,1 (允许CPU并行)

3、连接数(默认数为25,可根据应用需要来修改

sp_configure “number of user connections”,600

4、锁

sp_configure “number of locks”,100000

5、索引对像

数据库空闲状态下运行:sp_countmetadata “open indexes”

正常运行时运行:sp_monitorconfig “open indexes”

来确定一个最佳值,增加10%左右。

sp_configure “number of open indexes”,2000

sp_configure “number of open objects”,2000

sp_configure “number of open partitions”,1500

此外,还有一个关于OLTP的配置,大家有兴趣的可以试一试:

sp_configure “optimization goal”,”allow_oltp”

抱歉!评论已关闭.