Search code examples
delphidelphi-7

"maximum number of concurrent connections exceeded" get exception in isapi application in Delphi7


If i send more than 32 request to server at a time then it returns 500 errorcode in apache log. the error message is

maximum number of concurrent connections exceeded


Solution

  • 32 is the default value for TWebRequestHandler.MaxConnections property. If the number of active connections exceeds this value the Web Broker framework will raise an EWebBrokerException with the message:

    "Maximum number of concurrent connections exceeded. Please try again later"

    You can set it to a higher value or zero to indicate no limit.

    Since you mention Apache in your case the right place to do this is your Apache DLL's main block, for example:

    begin
      CoInitFlags := COINIT_MULTITHREADED;
      Web.ApacheApp.InitApplication(@GModuleData);
      Application.Initialize;
      Application.WebModuleClass := WebModuleClass;
      Application.MaxConnections := 200;
      Application.Run;
    end.