I have an example of ISAPI module hosts on IIS7 in Windows Vista Ultimate in a virtual machine. According to IIS 7.0 Editions and Windows, the concurrency limit is ten for Windows Vista Ultimate. I am writing an example application for testing IIS7 query concurrency restrictions:
procedure TForm1.Button1Click(Sender: TObject); const c_Max = 20; var P: TProc<string>; o: TThread; i: integer; A: array of TThread; begin P := procedure(aValue: string) begin Memo1.Lines.Add(aValue); end; SetLength(A, c_Max); for i := Low(A) to High(A) do begin o := TMyThread.Create(P, edHostName.Text, Format('test%d', [i + 1]), True); o.FreeOnTerminate := True; A[i] := o; end; for o in A do o.Start; end; constructor TMyThread.Create(const aMethod: TProc<string>; const aHostName, aValue: string; const aCreateSuspended: boolean); begin inherited Create(aCreateSuspended); FMethod := aMethod; FHostName := aHostName; FValue := aValue; end; procedure TMyThread.Execute; var C: TSQLConnection; o: TServerMethods1Client; S: string; begin C := TSQLConnection.Create(nil); C.DriverName := 'DataSnap'; C.LoginPrompt := False; with C.Params do begin Clear; Values[TDBXPropertyNames.DriverUnit] := 'Data.DBXDataSnap'; Values[TDBXPropertyNames.HostName] := FHostName; Values[TDBXPropertyNames.Port] := IntToStr(80); Values[TDBXPropertyNames.CommunicationProtocol] := 'http'; Values[TDBXPropertyNames.URLPath] := 'MyISAPI/MyISAPI.dll'; end; S := Format('%d=', [ThreadID]); try try C.Open; o := TServerMethods1Client.Create(C.DBXConnection); try S := S.Format('%s%s', [S, o.EchoString(FValue)]); finally o.Free; end; except on E: Exception do S := S.Format('%s%s', [S, E.Message]); end; finally Synchronize( procedure begin FMethod(S); end ); C.Free; end; end;
When I press Button1, Memo1 displays 20 lines of the line (ThreadID = Result of EchoString), although I change the constant variable c_Max to 500, I still can not get the line (ThreadID = exception message)) is displayed on Memo1. My question is how to check the IIS7 concurrency limit?
source share