We can get this error due to slow response from the server either because of availability of low RAM. While creating a new web application, SharePoint reset IIS. Application pool will have 90 sec to close all the connections before force down. Sometimes 90 sec is not sufficient to close the connection. We have to improve the limit manually.
To increase the time we have to follow the steps below.
go to IIS manager > Application pools > SharePoint Central Administration v4 and click Advanced properties
In the opened window under Process model find the following settings:
- Ping Maximum Response Time
- Shutdown Time Limit (seconds)
- Startup Time Limit (seconds)
Now we can create the webapplication without issues.