首页 > 系统相关 >Windows Server 2008 + IIS 7+ ASP.NET 支持10万并发请求

Windows Server 2008 + IIS 7+ ASP.NET 支持10万并发请求

时间:2023-09-29 17:11:30浏览次数:38  
标签:10 ASP IIS %% echo set REM config

调整IIS 7应用程序池队列长度

由原来的默认1000改为65535。

Internet Information Services (IIS)管理器 > 应用程序池 > 当前需要修改的网站所对应的应用程序池 > 高级设置

队列长度 : 65535


@echo off

set newQueueLength=65535

REM 获取IIS安装路径
for /f "tokens=2 delims==" %%a in ('%windir%\system32\inetsrv\appcmd.exe list apppool ^| find "name:"') do (
set "appPoolName=%%~a"
%windir%\system32\inetsrv\appcmd.exe set config -section:system.applicationHost/applicationPools /[name='%appPoolName%'].queueLength:%newQueueLength%
)

echo 队列长度已修改为%newQueueLength%


调整IIS 7的appConcurrentRequestLimit设置

由原来的默认5000改为100000。

c:\windows\system32\inetsrv\appcmd.exe set config /section:serverRuntime /appConcurrentRequestLimit:100000
在%systemroot%\System32\inetsrv\config\applicationHost.config中可以查看到该设置:


@echo off

set newLimit=100000

REM 获取IIS安装路径
for /f "tokens=2 delims==" %%a in ('%windir%\system32\inetsrv\appcmd.exe list config ^| find "APPLICATIONHOST.CONFIG"') do set "configPath=%%~a"

REM 设置appConcurrentRequestLimit
%windir%\system32\inetsrv\appcmd.exe set config "%configPath%" -section:system.webServer/serverRuntime /appConcurrentRequestLimit:%newLimit%

echo appConcurrentRequestLimit已修改为%newLimit%


调整IIS 7支持的同时TCPIP连接数

由原来的默认5000改为100000。

reg add HKLM\System\CurrentControlSet\Services\HTTP\Parameters /v MaxConnections /t REG_DWORD /d 100000


调整machine.config中的processModel>requestQueueLimit的设置

按Win+R键,在“运行”对话框中,键入 notepad %systemroot%\Microsoft.Net\Framework64\v2.0.50727\CONFIG\machine.config,然后单击“确定”。

查找"processModel"关键词,由原来的默认的配置

改为

@echo off

set "configPath=%systemroot%\Microsoft.Net\Framework64\v2.0.50727\CONFIG\machine.config"
set "newLimit=100000"

REM 使用临时文件存储修改后的内容
set "tempFile=%temp%\machine.config.tmp"

REM 逐行读取配置文件并进行替换
(for /f "tokens=*" %%a in ('type "%configPath%"') do (
set "line=%%a"

REM 查找包含<processModel的行
echo !line! | find "<processModel" > nul
if not errorlevel 1 (
    REM 替换为新的配置
    set "line=<processModel enable=\"true\" requestQueueLimit=\"%newLimit%\"/>"
)

REM 输出修改后的行到临时文件
echo !line!

)) > "%tempFile%"

REM 将临时文件覆盖原始配置文件
move /y "%tempFile%" "%configPath%" > nul

echo processModel>requestQueueLimit已修改为%newLimit%


运行命令使设置生效

net stop http & net start http & iisreset

标签:10,ASP,IIS,%%,echo,set,REM,config
From: https://www.cnblogs.com/suv789/p/17737111.html

相关文章

  • P1075 [NOIP2012 普及组] 质因数分解
    因为n是两个质数的乘积,所以直接暴力枚举,只要能被整除,直接输出因为是要求大的那个,所以从小到大枚举,输出商即可点击查看代码#include<bits/stdc++.h>usingnamespacestd;#defineLLlonglongintmain(){ LLn; cin>>n; for(inti=2;1LL*i*i<=n;i++){ if......
  • 基于TOTP算法的Github两步验证2FA(双因子)机制Python3.10实现
    从今年(2023)三月份开始,Github开始强制用户开启两步验证2FA(双因子)登录验证,毫无疑问,是出于安全层面的考虑,毕竟Github账号一旦被盗,所有代码仓库都会毁于一旦,关于双因子登录的必要性请参见:别让你的服务器(vps)沦为肉鸡(ssh暴力破解),密钥验证、双向因子登录值得拥有。双因子登录说......
  • Gym 104270 The 2018 ICPC Asia Qingdao Regional Programming Contest (The 1st Univ
    A.SequenceandSequenceB.KawaExam可以发现,对答案会产生影响的只有割边,把所有边双缩起来,然后就是一个森林。考虑一个树的时候怎么做,就是对于每条边求出这条边两端的众数个数,考虑线段树合并,每次动态维护子树内的众数和子树外的众数。#include<iostream>#include<cstdio>......
  • asp .net core Exceptionless日志操作
    exceptionless官网使用说明安装Nuget包添加引用usingExceptionless;usingExceptionless.Logging;初始化-秘钥-请求地址//构造函数初始化日志参数(日志系统地址,项目模块)publicDefaultController(){if(string.IsNullOrWhiteSpace(ExceptionlessClient.Default.Config......
  • Raspberry Pi 5 All In One
    RaspberryPi5AllInOne树莓派5RaspberryPi5RaspberryPi5PublishedSeptember28,2023https://www.raspberrypi.com/products/raspberry-pi-5/demoshttps://www.bilibili.com/video/BV1R84y1U77e/(......
  • hp 7010dt 主机升级独立显卡,外接2K/4k显示器。
    HTPC主机,你现在的cpu是i5的还是i7的,您的电源实际功率应该是275W,按照转化率倒推,额定功率差不多是350W。显卡推荐:技嘉GTX1050Ti4G半高(刀卡);技嘉GTX1650IXOC4G半高(刀卡),这两款卡都是1150元,GTX10502G刀卡也得900左右,还有盈通RX5504G500元(性能略高于GTX750)这款机器有i53570和......
  • aspose替换word关键字
       privatevoidbutton3_Click(objectsender,EventArgse){stringsourcePath=Environment.CurrentDirectory+"/temple/"+"2.doc"; newAspose.Words.License().SetLicense(newMemoryStream(Convert.FromBase64Strin......
  • .net 7 智能提示汉化翻译中文版 dotnet 7 来帮助我们使用 asp.net core开发的时候,一些
    .net7智能提示汉化翻译中文版dotnet7来帮助我们使用asp.netcore开发的时候,一些参数或者方法可以更好的使用!   纯手工,使用必应翻译翻译的,翻译质量参次不齐。妄大家海涵!不懂如何使用可以联系QQ:11392301......
  • 10分钟巩固多线程基础
    10分钟巩固多线程基础前言多线程是并发编程的基础,本篇文章就来聊聊多线程我们先聊聊概念,比如进程与线程,串行、并行与并发再去聊聊线程的状态、优先级、同步、通信、终止等知识进程与线程什么是进程?操作系统将资源分配给进程,使用进程进行调度,但进程遇到阻塞任务时,为了提升CP......
  • RES.6-013 AI 101
    目录WhatisAI?ThemaintakeawayDeeplearningThetypeofAIGeneralAINarrowAIHowtobuildAIExpertsystemsTreesearchThetasksofMachinelearningClassificationClusteringRegressionTypesoflearningSupervisedUnsupervisedReinforcementlearningThesevensteps......