日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關咨詢
選擇下列產(chǎn)品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關閉右側工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
你的服務器IIS最大并發(fā)數(shù)有多少?
測試系統(tǒng)Window 2003 Server ,iis 6.0 ,ASP.Net 3.5 sp1

Dual 1.8雙核,2G內(nèi)存,14G虛擬內(nèi)存。

為了探尋IIS的最大并發(fā)數(shù),先要做幾個假設。

1、假設最大并發(fā)數(shù)就是當前的連接數(shù)。意思是當前能承受最大的連接,那么就表明最大的并發(fā)。

2、假設IIS應用程序池處于默認狀態(tài),更改設置將會對最大連接數(shù)產(chǎn)生影響。

做完假設,現(xiàn)在做限制,設置站點保持HTTP連接,超時設置成0,就是不會超時。在站點請求的default.aspx頁面設置線程Thread.Sleep(int.MaxValue),接下來開發(fā)一個用來保持連接的小程序。


復制代碼 代碼如下:

class Program {

private volatile static int errorCount = 0;

private volatile static int rightCount = 0;

static void Main(string[] args) {

ServicePointManager.DefaultConnectionLimit = 10000;

int count = 0;

int all = 0;

while (true) {

all++; count++;

CreateThread();

Thread.Sleep(10);

if (count >= 200) {

Console.WriteLine(string.Format("sucess:{0};error:{1}", all - errorCount, errorCount));

count = 0;

}

if (all > 1800)

break;

}

Console.ReadKey();

}

static void CreateThread() {

Thread thread = new Thread(ActiveRequest);

thread.IsBackground = true;

thread.Start();

}

static void ActiveRequest() {

RequestClient client = new RequestClient("http://192.168.18.2/default.aspx?d=" + Guid.NewGuid());

client.RequestProcess();

if (client.IsError) {

errorCount++;

Console.WriteLine(string.Format("錯誤消息:{0}", client.Messages));

} else {

rightCount++;

//Console.WriteLine(client.Messages);

}

}

}

在焦作等地區(qū),都構建了全面的區(qū)域性戰(zhàn)略布局,加強發(fā)展的系統(tǒng)性、市場前瞻性、產(chǎn)品創(chuàng)新能力,以專注、極致的服務理念,為客戶提供網(wǎng)站設計制作、網(wǎng)站設計 網(wǎng)站設計制作定制制作,公司網(wǎng)站建設,企業(yè)網(wǎng)站建設,成都品牌網(wǎng)站建設,成都營銷網(wǎng)站建設,外貿(mào)營銷網(wǎng)站建設,焦作網(wǎng)站建設費用合理。

using System;

using System.Collections.Generic;

using System.Text;

using System.Net;

using System.IO;

namespace MaxLinked {

///



///

///


public class RequestClient {

HttpWebRequest request;

WebResponse response;

public RequestClient(string url) {

request = (HttpWebRequest)HttpWebRequest.Create(url);

request.Timeout = int.MaxValue;

request.KeepAlive = true;

ErrorCode = -1;

}

public void AddHeader(string name, string value) {

request.Headers.Add(name, value);

}

private bool isError = false;

private StringBuilder buffer = new StringBuilder();

public int ErrorCode { get; set; }

public bool IsError {

get { return isError; }

}

public string Messages {

get { return buffer.ToString(); }

}

public void RequestProcess() {

try {

response = request.GetResponse();

} catch (WebException ex) {

ErrorCode = (int)ex.Status;

buffer.Append(ex.Message);

isError = true;

}

if (response != null) {

Stream stream = null;

StreamReader reader = null;

try {

//stream = response.GetResponseStream();

//reader = new StreamReader(stream, Encoding.UTF8);

//buffer.Append(reader.ReadToEnd());

} catch (Exception ex) {

buffer.Append(ex.Message);

isError = true;

} finally {

//if (reader != null)

// reader.Close();

//if (stream != null)

// stream.Close();

}

} else {

isError = true;

buffer.Append("建立連接失??!");

}

}

public void Close() {

if (response != null)

response.Close();

request.Abort();

}

}

}

程序設置為只能啟動1800個線程,這是由于.Net單進程最大線程數(shù)好像是2000個。因此,要測試最大并發(fā)數(shù),要需要同時開幾個測試進程。把系統(tǒng)虛擬內(nèi)存調(diào)到最大值,線程過多會急劇占用內(nèi)存?,F(xiàn)在開始測試。

打開web站點的性能計數(shù)器,把顯示比例調(diào)成1萬。

發(fā)現(xiàn)到5000個連接時,IIS服務器崩潰(503錯誤),去洗了個澡,發(fā)現(xiàn)IIS服務器無法自己修復錯誤。又測試了幾次,發(fā)現(xiàn)最大并發(fā)值是8200個,但是一般到5000左右就會崩潰,有時候甚至只有1000個。

按8200個計算,一個用戶開一個瀏覽器瀏覽網(wǎng)頁,可能會占用2~3個連接,按兩個計算,那么IIS默認情況下,最大并發(fā)數(shù)是4000個左右。

打開應用程序池配置,把最大工作進程數(shù)調(diào)高(默認為1),能有效提高最大連接數(shù)。我記得以前看過一篇文章,講的是調(diào)到5左右比較合適。


分享文章:你的服務器IIS最大并發(fā)數(shù)有多少?
標題網(wǎng)址:http://www.5511xx.com/article/cdspieo.html