转至繁体中文版     | 网站首页 | 图文教程 | 资源下载 | 站长博客 | 图片素材 | 武汉seo | 武汉网站优化 | 
最新公告:     敏韬网|教学资源学习资料永久免费分享站!  [mintao  2008年9月2日]        
您现在的位置: 学习笔记 >> 图文教程 >> 站长学院 >> Web开发 >> 正文
也谈ASP.NET应用程序性能优化         ★★★★

也谈ASP.NET应用程序性能优化

作者:闵涛 文章来源:闵涛的学习笔记 点击数:4167 更新时间:2009/4/23 10:40:41
>

4.2.1优化配置Server & IIS

4.2.1.1扩大IIS高速缓存

服务器保留了一部分内存空间用作IIS高速缓存,为将来的请求存储对象,这样IIS就可从高速缓存中检索对象而不用从硬盘中检索。调整IIS高速缓存的容量需要修改注册表,表项如下:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\InetInfo\Parameters\MemoryCacheSize

=0x 1E84800(类型为REG_DWORD,using hexadecimal notation.)

也可设为十进制,范围0-4GB,缺省值为3072000(3MB)。一般来说此值最小应设为服务器内存的10%。

IIS通过高速缓存系统句柄、目录列表以及其他常用数据的值来提高系统的性能。这个参数指明了分配给高速缓存的内存大小。如果该值为0,那就意味着“不进行任何高速缓存”。在这种情况下系统的性能可能会降低。如果你的服务器网络通讯繁忙,并且有足够的内存空间,可以考虑增大该值。必须注意的是修改注册表后,需要重新启动才能使新值生效。

4.2.1.2调整IIS占用CPU时间

服务器的CPU处理器能力总是有限的。哪一个应用程序占用处理器的时间最长,谁的性能就能得到最大的提高。
(1)在NT的控制面板中,双击系统图标。  
(2)单击性能标签。  
(3)在应用程序性能下将游标拖到None的位置,这样就可以使所有正在运行的服务,包括IIS,使用处理器的时间达到最大值。
 (4)选择最大化网络应用程序的总处理能力。然后单击“OK。” 

4.2.1.3协议及相关优化

(1)为了提高性能和节约资源,应该只运行需要的协议。
(2)应该将IIS服务器,设置为独立的服务器,不要让服务器去承受域控制器要求的额外负荷。
(3)可以把NT服务器的页交换文件分布到多个物理磁盘上,注意是多个“物理磁盘”,分布在多个分区上是无效的。另外,不要将页交换文件放在与Windows NT引导区相同的分区中。
(4)使用磁盘镜像或磁盘带区集可以提高磁盘的读取性能。
(5)关于日志的记录,应该采用文件记录而不是记录到ODBC数据源。此外,还可以在记录期间增加用来记录日志的内存缓冲区的容量来减少磁盘的活动。该缓冲区的缺省容量值为64KB。
(6)最好把所有的数据都储存在一个单独的分区里。然后定期运行磁盘碎片整理程序以保证在存储Web服务器数据的分区中没有碎片。使用NTFS有助于减少碎片。
(7)虽然SSL可以提供相当可靠的加密传输。但是所需的额外开销会导致IIS服务器速度下降,尤其是在处理大型文件的时候。所以应该只对确实需要保护的目录进行SSL加密。

4.2.1.4 调整失效时间

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\InetInfo\Parameters\ObjectCacheTTL=0x8CA0.

4.2.1.5 调整最大线程数

HKEY_LOCAL_MACHINE\SYSTEM\ CurrentControlSet\Services\w3SVC\ASP\Parameters,增加ProcessorThreadMax,减小这个值,看看性能的变化;或者增大这个值。)

4.2.1.6 注册表中的其他可优化项

以“HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\InetInfo\Parameters\”为父节点;

CacheSecurityDescriptor Indicates whether security descriptors are cached for file objects. A value of 1 enables this feature. A value of 0 disables this feature. When enabled (the default setting), security descriptors for files are saved when caching a file object. As long as the file is cached, IIS will not need to re-access the file to determine access rights for new users. This value is most useful for sites that authenticate users and not useful for sites that allow anonymous access.

CheckCertRevocation Indicates whether IIS checks to see if a client certificate is revoked. If you issue your own certificates and make local certificate checks, you might want to enable this feature. Otherwise, the feature should be disabled, which is the default. A value of 1 enables this feature.

DisableMemoryCache Indicates whether IIS memory caching is enabled or disabled. By default, memory caching is enabled (meaning this value is set to 0). Disable memory caching only for testing or development purposes.

ListenBackLog Specifies the maximum number of active connections that IIS maintains in the connection queue. The default value is 15 and the range of acceptable values is from 1 to 250.

MaxCachedFileSize Determines the maximum size of a file that can be placed in the file cache. IIS will not cache files that are larger than this value. The default value is 262,144 bytes (256 KB).

MaxConcurrency Specifies how many threads per processor should be allowed to run simultaneously if there is a pending input/output (I/O) operation. The default value (0) allows IIS to control the number of threads per processor. You can also set a specific value.

MaxPoolThreads Sets the number of pool threads to create per processor. Each pool thread watches for a network request for a CGI application and processes it. This value does not control threads that are used by ISAPI applications. By default, the value is set to 4. On a single processor system, this means that only four CGI applications could run simultaneously.

MemCacheSize Sets the maximum amount of memory that IIS will use for its file cache. If IIS does not need this much memory, it will be left for other applications to use. By default, IIS uses 50 percent of the available memory. The valid range is from 0 megabytes to the total amount of physical memory available in megabytes.

ObjectCacheTTL Sets the length of time (in milliseconds) that objects are held in memory. If the object hasn''''t been used in this interval, it is removed from memory. The default value is 30 seconds (300,000 milliseconds).

PoolThreadLimit Sets the maximum number of pool threads that can be created on the server. This limit is for all IIS threads. The default value is twice the size of physical memory in megabytes.

4.2.1.7禁用不必要的服务:

禁用专用 Web 服务器不需要的 Windows 2000 服务。方法是:单击开始,依次指向程序、管理工具,然后单击计算机管理。在“计算机管理(本地)”下,展开“服务和应用程序”,然后单击服务。当前所运行服务的状态 列中显示已启动 。以下服务是专用 Web 服务器上不需要的:

   警报器
   剪贴簿
   计算机浏览器
   DHCP 客户端
   DHCP 服务器
   传真服务
   文件复制
   红外线监视器
   Internet 连接共享
   信使
   NetMeeting 远程桌面共享
   网络 DDE
   网络 DDE DSDM
   NWLink NetBIOS
   NWLink

上一页  [1] [2] [3] [4] [5] [6] [7]  下一页


[C语言系列]NET 中C#的switch语句的语法  [系统软件]托拽Explore中的文件到VB.net的窗口
[系统软件]Boost库在XP+Visual C++.net中的安装  [常用软件]新配色面板:Paint.Net3.0RC1官方下载
[常用软件]用内建的“Net Meeting”聊天  [VB.NET程序]Henry的VB.NET之旅(三)—共享成员
[VB.NET程序]Henry的VB.NET之旅(二)—构造与析构  [VB.NET程序]Henry的VB.NET之旅(一)—失踪的窗体
[VB.NET程序]在托盘上显示Balloon Tooltip(VB.NET)  [VB.NET程序]Henry手记-VB.NET中动态加载Treeview节点(二)
教程录入:mintao    责任编辑:mintao 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网]
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    同类栏目
    · Web开发  · 网页制作
    · 平面设计  · 网站运营
    · 网站推广  · 搜索优化
    · 建站心得  · 站长故事
    · 互联动态
    更多内容
    热门推荐 更多内容
  • 没有教程
  • 赞助链接
    更多内容
    闵涛博文 更多关于武汉SEO的内容
    500 - 内部服务器错误。

    500 - 内部服务器错误。

    您查找的资源存在问题,因而无法显示。

    | 设为首页 |加入收藏 | 联系站长 | 友情链接 | 版权申明 | 广告服务
    MinTao学以致用网

    Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved.
    闵涛 投放广告、内容合作请Q我! E_mail:admin@mintao.net(欢迎提供学习资源)

    站长:MinTao ICP备案号:鄂ICP备11006601号-18

    闵涛站盟:医药大全-武穴网A打造BCD……
    咸宁网络警察报警平台