title: 502 Error in Web API for large size of data
body: <h2>Technologies</h2>
  <p>I am using  angular 2 and web API technologies in my application. I am calling web API service method from angular via $http call.</p>
  <h2>What I am doing</h2>
  <p>Actually API method is reading data from data base and doing <em><strong>huge</strong></em> logic to transform the data for UI entity class (lot of codes and loops are  there, so i won't post those here).</p>
  <h2>What is the problem &amp; root cause</h2>
  <p>The problem is I am getting  502 Bad get way error when I am calling the API method.</p>
  <p>I found the problem because of it's a performance issue. it's working fine for me when the data size is low. But if the data size is large, then I am getting this error.</p>
  <p><strong>Note :</strong> I have checked the data base query. and it's working fine and return the data very fast.</p>
  <h2>Performance result details</h2>
  <p>I have used timer to check the response time of API method</p>
  <blockquote>
  <p>Result of response time as follow :</p>
  </blockquote>
  <ul>
  <li><p>if the data size is low : 00.00:898767 (hh:mm:ss)</p>
  </li>
  <li><p>if the data size is huge : 00:06:654389 (hh:mm:ss)</p>
  </li>
  </ul>
  <h2>What I understood:</h2>
  <p>If the method response time is more than 2 mins, then only I am getting the bad get way error. otherwise the method executed successfully without any error.</p>
  <h2>What I tried to fix this error:</h2>
  <p>I have tried to increase the <code>executionTimeout=9000</code>   in <code>web config.</code> I also tried with different seconds in <code>executionTimeout.</code></p>
  <p>this is my full web config code</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;configuration&gt;
    &lt;!--
      Configure your application  settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
    --&gt;
    &lt;system.web&gt;
      &lt;authentication mode=&quot;Windows&quot;&gt;&lt;/authentication&gt;
      &lt;authorization&gt;
        &lt;deny users=&quot;?&quot; /&gt;
      &lt;/authorization&gt;
      &lt;httpRuntime  executionTimeout = &quot;9000&quot; /&gt;
    &lt;/system.web&gt;
    &lt;system.webServer&gt;
      &lt;handlers&gt;
        &lt;add name=&quot;aspNetCore&quot; path=&quot;*&quot; verb=&quot;*&quot; modules=&quot;AspNetCoreModule&quot; resourceType=&quot;Unspecified&quot; /&gt;
      &lt;/handlers&gt;
      &lt;aspNetCore processPath=&quot;%LAUNCHER_PATH%&quot; arguments=&quot;%LAUNCHER_ARGS%&quot; stdoutLogEnabled=&quot;false&quot; stdoutLogFile=&quot;.\logs\stdout&quot; forwardWindowsAuthToken=&quot;true&quot; /&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  <blockquote>
  <p>but still i am unable to solve this problem. Could you please let me know how can I fix this issue?</p>
  </blockquote>