locked
Custom Max Worker Thread RRS feed

  • Question

  • User1109811461 posted

    Hi all,

    i want to control number of thread, request queue limit and etc.  i put this code in side my web.config.

    <processModel 
      requestQueueLimit="5000" restartQueueLimit="10" 
      maxWorkerThreads="20" maxIoThreads="20" minWorkerThreads="1"
    />

    and i put this code inside my .aspx file to read the value.

    Dim configuration As System.Configuration.Configuration = WebConfigurationManager.OpenWebConfiguration("/aspnetTest")
    Dim processModelSection As System.Web.Configuration.ProcessModelSection = CType(configuration.GetSection("system.web/processModel"), ProcessModelSection)
    Response.Write("MAX Workwer :" + processModelSection.MaxWorkerThreads) 

    finally i got this error :

    Configuration Error

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

    Parser Error Message: It is an error to use a section registered as allowDefinition='MachineOnly' beyond machine.config.

    Source Error: 

    Line 38:     <httpRuntime targetFramework="4.6"/>
    Line 39:   
    Line 40:   <processModel maxWorkerThreads="20" minWorkerThreads="1"/>
    Line 41: Line

    anyone here know why this happen. please help.

    Monday, January 29, 2018 2:24 AM

All replies