i have a web site for download mobile files and there many users in my web site.
sometimes i have the error below :
HTTP Error 503 - Service is unavailable
1-so why this error happens and what is that mean?
2-as i know appache free up itself when it's oveloaded, but what about iis?
how can i put some limitations in my server (i have remote access to my server) for prevent this error happening?
a.is limitation of dowload's speed efficient for prevent that error's occur?
how can i do that?
is squid useful for this job or i can do that with another iis extension.
b.is limitation of download's Bandwidth efficient for prevent that error's occur?
how can i do that (with iis or another extension)?
in right side of iis -> configure area -> i found some limits.
what do those limits mean and can i use them for keep my server alive all the time?
EDIT:
after viewing event viewer of windows -> custom views -> server rols -> web server (iis)
i figure out there is no error in that area.
but many warnings and information.
the latest warnings and information are like below :
warning
A worker process '2408' serving application pool 'ASP.NET 4.0 (Integrated)' failed to stop a listener channel for protocol 'http' in the allotted time. The data field contains the error number.
warning
A process serving application pool 'ASP.NET 4.0 (Integrated)' exceeded time limits during shut down. The process id was '6764'.
warning
A worker process '3232' serving application pool 'ASP.NET 4.0 (Integrated)' failed to stop a listener channel for protocol 'http' in the allotted time. The data field contains the error number.
warning
A process serving application pool 'ASP.NET 4.0 (Integrated)' exceeded time limits during shut down. The process id was '3928'.
thanks in advance
best regards
My guess is that you are hitting the limit of available threads that IIS has available. IIS allocates a certain number of threads depending on the version of IIS and the configuration settings which by default depend on the number of processors/cores in your server. You can tune this specifically to your needs.
You probably run out of threads because you stream downloads to the clients. If you do this in a synchronous way your website will eventually run out of the threads as each thread will be occupied by a single download. If possible you should modify your download code to work asynchronously, e.g. by implementing it as a asynchronous HTTP handler.
EDIT: The 503 error is occuring because IIS is running out of threads to service additional requests and thus can't handle the request. The errors in the event log are a consequence of this as IIS is trying to free up threads and resources by trying to quit/recycle the application pool as it's not responding to the internal 'alive' pings.
Limiting the download speed will actually increase the problem as you will run out of threads even sooner. You should only limit the download speed if you run out of total bandwidth, otherwise just let clients download as fast as they can.
The only real solution that will make your server scale is to change your code so that downloads are handled asynchronously. Or change your solution so that the download is handled by the static file handler of IIS itself, for example by using rewrite rules or a custom rewrite provider. Difficult to say anymore without knowing a bit more details about your application.
"HTTP Error 503 - Service is unavailable" error occurs if your application pool fails due to the error made to your application more than Maximum Failure limit allocated to your apps in iis.
Resolution for it
After modifying the Advanced Setting, recycle the apps.
There is no one particular way to fix this issue, Btw we can try some easy ways to fix 503 error by following method.
Here some more info about Http Error 503 fix, If required you can visit.
Remote Desktop into your Server,
Check if your 'SQL Server Reporting Services (MSSQLSERVER)' Service is running.
If not.
Start it.