惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
P
Proofpoint News Feed
宝玉的分享
宝玉的分享
人人都是产品经理
人人都是产品经理
博客园_首页
爱范儿
爱范儿
博客园 - 叶小钗
aimingoo的专栏
aimingoo的专栏
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
阮一峰的网络日志
阮一峰的网络日志
IT之家
IT之家
Microsoft Security Blog
Microsoft Security Blog
Blog — PlanetScale
Blog — PlanetScale
博客园 - 【当耐特】
Y
Y Combinator Blog
量子位
博客园 - 三生石上(FineUI控件)
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
The Blog of Author Tim Ferriss
月光博客
月光博客
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
A
About on SuperTechFans

博客园 - Sanle

jquery技巧总结 在不同版本的 SQL Server 之间传输登录和密码的完整解决方案 安装iis 成大事必备的9种心态 人际关系的十大要领 IIS6.0应用程序池回收和工作进程 五种提高 SQL 性能的方法 必须掌握的八个【cmd 命令行】[ 防止项目延迟的18条军规 一个自动产生编号的存储过程,数据库sql2000或2005 设计模式与武功秘籍的异曲同工 存储过程是多用还是少用 SQL有用代码 做项目就是学习 SQL大全 SOA实施的成功主要有以下8种 SOA,现在进行时 4u4gsybase配置 sybase优化处理
带你轻松接触Sybase ASE15.0.2性能优化
Sanle · 2008-09-03 · via 博客园 - Sanle

带你轻松接触Sybase ASE15.0.2性能优化
调整共享内存:

/sbin/sysctl -w kernel.shmmax=3416386150

shmmax是最大共享内存段,假如服务器上没有别的应用并且使用raw device可以将此参数调整到物理内存的90%,假如使用file system device 的话相应调小,因为file system buffer需要开销内存!修改后重新启动系统。

数据库的创建:

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”