一:软件环境
1 Apache配置调优
可修改apache配置文件apache\conf\httpd.conf。
1.1 Timeout(超时)
用户连接超时设置,从用户提交请求到从web server得到相应的最大时间间隔。
默认值 300秒。跟根据当前的网络状态对超时进行设置
1.2 MaxKeepAliveRequests(最大的请求数)
Web server保持的最大活动请求数,允许持续连接的最大请求数,增大该值可一定程度提高性能,可将其设置为0(对最大连接请求数不做限制)。
默认值为100。
1.3 KeepAliveTimeout(请求超时)
从同一个客户端的同一个连接发过来的两个请求之间的允许的最大时间间隔,运行reportnet的浏览器会每隔一个时间间隔向服务器发出一个同步请求,如果这个值太小的话,可能会出现找不到请求的错误。
默认值为15。
2 IIS配置调优
通过点击默认网站的右键,点其属性,出现如下图
2.1 连接超时
用户连接超时设置,从用户提交请求到从web server得到相应的最大时间间隔。
默认值 150秒。跟根据当前的网络状态对超时进行设置
2.2 性能
带宽限制
限制网站可以使用的带宽,应设置为不限
网站连接
允许持续连接的最大请求数,增大该值可一定程度提高性能,可将其设置为不受限制,如下图。
3 ReportNet自带tomcat配置调优
可修改TOMCAT配置文件CRN_ROOT\tomcat*.*\conf\server.xml。其参数集中在行:
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="9300"minProcessors="5" maxProcessors="500"enableLookups="true" redirectPort="9443"acceptCount="500" debug="0"connectionTimeout="60000" useURIValidationHack="false"disableUploadTimeout="true"/>
具体如下:
3.1 maxProcessors(最大进程数)
tomcat在运行的时候允许的最大处理请求(多线程)。在服务器资源允许的情况下,提高该值可以提高对资源的利用和处理速度。
默认值 500。
3.2 AcceptCount(最大连接数)
Tomcat允许的最大连接数。在服务器资源允许的情况下,可提高该值。
默认值为500。
3.3 ConnectionTimeout(连接超时)
Tomcat连接的超时设置。因为reportnet的同步连结处理http server传递给tomcat,所以该值需要和http server中KeepAliveTimeout值匹配。
默认值60000秒。
3.4 session-timeout
文件路径:CRN_ROOT\tomcat*.*\conf\web.xml
<session-config>
<session-timeout>30</session-timeout>
</session-config>
Session超时设置,默认值为30,单位分钟。
4 cognos ReportNet配置调优
4.1 reportservice.xml
文件路径:CRN_ROOT\ webapps\p2pd\WEB-INF\services\reportservice.xml
注:修改文件后,重启服务后配置生效。
4.1.1 max_process
<init-param>
<!-- The maximumnumber of processes that can be running at one time -->
<param-name>max_process</param-name>
<param-value>2</param-value>
</init-param>
ReportNet服务交互式报表处理所占进程数。默认值为2,可根据CPU数情况进行调整,通常每个CPU可支持2个处理。
注:该值需要和ReportNetReportService服务中的Maximum numberof interactive report service processes值匹配。
4.1.2 linger_process
<init-param>
<!-- The minimumnumber of processes to keep in memory once they're started -->
<param-name>linger_process</param-name>
<param-value>1</param-value>
</init-param>
ReportNet服务交互式报表处理初始化进程数。默认值为1,可根据CPU数情况进行调整,通常每个CPU可设置1个处理。
注:提高该属性设置,可以提高服务器在非高峰使用时段的处理能力。
4.1.3 max_non_affine_connections_per_process
<init-param>
<!-- The maximumnumber of non-affine connections per process -->
<param-name>max_non_affine_connections_per_process</param-name>
<param-value>4</param-value>
</init-param>
ReportNet服务交互式报表处理所占线程数。默认值为4,可根据CPU数情况进行调整,通常每个CPU最大可支持4个处理,Windows环境建议设置为2个处理。
注:该值需要和ReportNetReportService服务中的Number of lowaffinity connections for the interactive report service值匹配。
4.1.4 idle_process_check_interval_ms
<init-param>
<!-- Time periodbetween checks for idle or expired processes (in ms) .
Everytime we check anidle process we bump its tick count. Every time we use
a process the count isreset to 0. If the count ever reaches the value
ofidle_process_max_idle_ticks (below) the process is destroyed.
-->
<param-name>idle_process_check_interval_ms</param-name>
<param-value>30000</param-value>
</init-param>
空闲进程检测时间间隔,默认值为30000,单位为毫秒。由于进程的频繁启动退出会消耗服务器资源,可根据并发使用情况,减小时间间隔,以提高进程的使用效率。
4.1.5 idle_process_max_idle_ticks
<init-param>
<!-- number of idlecheck ticks before an idle process is killed. -->
<param-name>idle_process_max_idle_ticks</param-name>
<param-value>10</param-value>
</init-param>
空闲进程检测标记,默认值为10。由于进程的频繁启动退出会消耗服务器资源,可根据并发使用情况,增大设置,以提高进程的使用效率。
4.1.6 queue_time_limit_ms
<init-param>
<!-- The maximumtime a request is queued before it gives up (in ms) -->
<param-name>queue_time_limit_ms</param-name>
<param-value>30000</param-value>
</init-param>
报表服务排队时间限制,默认值为30000,单位毫秒。可根据并发查询情况,增大时间限制,以避免请求被取消。
注:该值需要和ReportNetReportService服务中的Queue time limitof report service in seconds值匹配。
4.1.7 async_wait_timeout_ms
<init-param>
<!-- The amount oftime the dispatcher will wait for a async request before it cancels it (in ms)-->
<param-name>async_wait_timeout_ms</param-name>
<param-value>30000</param-value>
</init-param>
Dispatcher请求等待同步时间,默认值为30000,单位毫秒。可根据并发查询情况,增大时间限制,以避免请求被取消。
注:该值需要和tomcat以及apache中的连结超时相匹配。
4.2 batchreportservice.xml
文件路径:CRN_ROOT\webapps\p2pd\WEB-INF\services\ batchreportservice.xml
注:修改文件后,重启服务后配置生效。
4.2.1 max_process
<init-param>
<!-- The maximumnumber of processes that can be running at one time -->
<param-name>max_process</param-name>
<param-value>2</param-value>
</init-param>
ReportNet服务批量报表处理所占进程数。默认值为2,可根据CPU数情况进行调整,通常每个CPU可支持2个处理。
注:该值需要和ReportNetBatchReportService服务中的Maximumnumber of batch report service processes值匹配。
4.2.2 linger_process
<init-param>
<!-- The minimumnumber of processes to keep in memory once they're started -->
<param-name>linger_process</param-name>
<param-value>1</param-value>
</init-param>
ReportNet服务批量报表处理初始化进程数。默认值为1,可根据CPU数情况进行调整,通常每个CPU可设置1个处理。
注:提高该属性设置,可以提高服务器在非高峰使用时段的处理能力。
4.2.3 max_non_affine_connections_per_process
<init-param>
<!-- The maximumnumber of non-affine connections per process -->
<param-name>max_non_affine_connections_per_process</param-name>
<param-value>4</param-value>
</init-param>
ReportNet服务批量报表处理所占线程数。默认值为4,可根据CPU数情况进行调整,通常每个CPU最大可支持4个处理,Windows环境建议设置为2个处理。
注:该值需要和ReportNetBatchReportService服务中的Number oflow affinity connections for the batch report service值匹配。
4.2.4 idle_process_check_interval_ms
<init-param>
<!-- Time periodbetween checks for idle or expired processes (in ms) .
Everytime we check anidle process we bump its tick count. Every time we use
a process the count isreset to 0. If the count ever reaches the value
of idle_process_max_idle_ticks(below) the process is destroyed.
-->
<param-name>idle_process_check_interval_ms</param-name>
<param-value>30000</param-value>
</init-param>
空闲进程检测时间间隔,默认值为30000,单位为毫秒。由于进程的频繁启动退出会消耗服务器资源,可根据并发使用情况,减小时间间隔,以提高进程的使用效率。
4.2.5 idle_process_max_idle_ticks
<init-param>
<!-- number of idlecheck ticks before an idle process is killed. -->
<param-name>idle_process_max_idle_ticks</param-name>
<param-value>10</param-value>
</init-param>
空闲进程检测标记,默认值为10。由于进程的频繁启动退出会消耗服务器资源,可根据并发使用情况,增大设置,以提高进程的使用效率。
4.2.6 queue_time_limit_ms
<init-param>
<!-- The maximumtime a request is queued before it gives up (in ms) -->
<param-name>queue_time_limit_ms</param-name>
<!-- 4 hours inmsec. 0 (block forever) is very dangerous -->
<param-value>14400000</param-value>
</init-param>
批量报表处理排队时间限制,默认值为14400000,单位毫秒。可根据并发查询情况,增大时间限制,以避免请求被取消。
4.2.7 async_wait_timeout_ms
<init-param>
<!-- The amount oftime the dispatcher will wait for a async request before it cancels it (in ms)-->
<param-name>async_wait_timeout_ms</param-name>
<param-value>14400000</param-value>
</init-param>
Dispatcher请求等待同步时间,默认值为14400000,单位毫秒。可根据并发查询情况,增大时间限制,以避免请求被取消。
注:该值需要和tomcat以及apache中的连结超时相匹配。
4.3 CQEConfig.xml
主要是与数据库参数设置,文件路径:CRN_ROOT\configuration\CQEConfig.xml.sample
注:将CQEConfig.xml.sample文件名修改为CQEConfig.xml后,重启服务后配置生效。
4.3.1 Timeout
<!-- Description: Database connection timeout. Default is 900 seconds (15minutes) -->
<entry name="Timeout"value="900"/>
应用数据库连接超时设置。默认值为900,单位秒。
4.3.2 PoolSize
<!-- Description: Database connection pool size.-->
<!-- Maximum number of connections managed bythe report server. Default=20 -->
<entry name="PoolSize"value="20"/>
应用数据库连接池最大连接数设置。默认值为20。
4.3.3 queryReuse
<section name="QueryEngine">
<!-- Description: Controls the queryReuse feature. The entry must be uncommented. -->
<!-- A value of 0 will disable queryReuse.-->
<!-- The default value of 5 means that 5 resultsets are reused. The maximum is set to 10. -->
<entry name="queryReuse"value="5" />
<!-- -->
</section>
查询缓冲设置。默认值为5,最大值为10,设置为0将关闭查询缓冲。
4.4 ppds_cfg.xml
主要进行缓存和日志参数设置,文件路径:\cognos\c8\configuration\ppds_cfg.xml
注:重启服务后配置生效。
4.4.1 ReadCacheSize
根据具体环境情况适当提高ReadCacheSize, 可减少用户访问时服务器的磁盘IO。提高访问速度。
4.4.2 pcQueryLogFile
建议生产环境关闭该日志的跟踪,一般默认也是关闭状态;
5 Cognos ReportNet服务器管理设置
5.1 Content Store数据库连接池设定
在浏览器内输入CognosReportNet门户登陆地址,在登入门户后点击Tools下拉菜单下的服务器管理(Cognos Administration),在系统下,选择选择对应的服务,在下方列出的所有服务中,选择ContentManagerService的属性,点击设置(Settings),在列出的环境(Enviorment)后点击编辑(Edit),将“改写从父条目获取的设置”(Override the settings acquired from the parent entry)选中,在出现的下方列表中可以设置Content Store数据库连接池的几项属性。
下表是上图中四个参数的属性说明
注:详情请参见安装配置手册《Cognos® 8 管理和安全性指南》中的《管理 Content Manager 的数据库连接池设置》章节。
5.2 开启审计功能
在浏览器内输入CognosReportNet门户登陆地址,在登入门户后点击Tools下拉菜单下的服务器管理(Cognos Administration),选择服务器的属性后,点击设置(Settings),在下方的列表中可以对审核等级等属性进行设置。
5.2.1 本地查询日志
将该设置选择为Yes后,才能看到详细的日志信息。可以通过对日志的查看达到服务器检测的效果,并根据检测结果适当调节服务器设置,使之达到最优。
5.2.2 日志等级说明
下表说明了每个日志级别记录的明细。
5.2.3 报表验证级别和日志级别
有四个报表验证级别和五个日志级别。下表显示了它们之间的对应关系。
日志级别设置得越高,就越降低系统性能。通常情况下,您可以将级别设置为“最小”或“基本”来收集错误,或设置为“请求”来收集错误和警告。
注:在8.3版本中,该设置在Cognos Administration中的调度程序和服务。详情请参见具体可参照《cognos管理和安全性指南》中第3章设置日志。
6 提高访问数据库速度
Cognos和数据库间参数在cer*\bin\cogdm**.ini文件中,(*根据版本不同是安装目录的数字,**根据连接的数据库不同,是对应数据库名称的关键字)
以
Oracle数据库为例,参数在cogdmor.ini文件中,打开这个文件查找字符串Fetch Number of Rows=去掉这行前面的分号,将10改成2000;
这样这行就成了Fetch Number ofRows=2000,表示是每次从数据库取2000条数据。
其他数据库基本上都有类似的配置。用以提高从数据库中提取数据的速度。
7 加大缓存
cer*\bin\Cer*.ini(*根据版本不同是安装目录的数字):
[Services]
SortMemory=5120
(这里 SortMemory 单位是 2kbytes,5120代表 2k x 5120 = 10M)
(技巧:一般 SortMemory 取空闲内存的十分之一到八分之一大小)
[PowerPlay DataServer]
WriteCacheSize=16384
(这里 WriteCahceSize单位是 Kbytes,16384 代表 16M)
(技巧:一般 WriteCacheSize可以通过估计生成的cube大小得到,和生成的cube大小差不多就可以了)
在 2G 内存的环境中,如果加载操作系统完成,并启动所有所需服务后系统空闲 800M 内存空间,则可设置:
[Services]
SortMemory=51200
[PowerPlay DataServer]
WriteCahceSize=81920
8 更改ReportNet启动服务资源配置
(1).启动 Cognos Configuration。
(2).点击 ReportNet service结点下的CognosReportNet服务,右键点击删除。
(3).新建服务,命名为CognosReportNet。(可根据服务器资源情况分别采用三种不同类型服务,三种类型服务之间的主要区别为内存分配大小。)
(4).在右侧属性栏的Dispatchermaximum memory in MB设置中,将其属性设置为1408。(服务器4G以下内存,建议最大设置为1408,否则ReoprtNet服务无法正常启动。)
(5).保存配置,重启服务。
注:如果采用脚本启动方式,则需要对startup.bat脚本进行修改。
rem "for machines with 2GB RAM"
rem set CATALINA_OPTS=-Xmx1152m -XX:MaxNewSize=576m -XX:NewSize=288m
-XX:MaxPermSize=128m %DEBUG_OPTS%
选择适当的服务器机器类型,然后将第二行的’rem’注释去掉,保存脚本,重新启动。
9 修改Cognos Configuration配置提高Cognos8速度
如果我们的服务器配置较高(超过2G内存),我们就可以考虑通过增加分配给Cognos8的内存来提高其运行速度。进入CognosConfiguration。修改下列
10 分布式部署
分布式部署可以大大提升CognosReportNet服务器的负载能力,同时容错保护功能可以使服务器更为稳定的运行,很好的支持大用户量的并发使用。