Ana Sayfa Hakkımda Dersler Blog MikrofondaOn The Mic İletişim Projeler Yakında
DerslerLessons DEPLOY · C#

IIS Hosting Model — inprocess vs outofprocess IIS Hosting Model — inprocess vs outofprocess

8 dk okuma 8 min read · Emre Ulutabak
1
IIS ve ASP.NET Core IIS and ASP.NET Core

IIS (Internet Information Services), Windows sunucularda gelen HTTP isteklerini karşılayan web sunucusudur. ASP.NET Core uygulamaları ise doğrudan IIS içinde değil, kendi sunucusu olan Kestrel üzerinde çalışır.

IIS ile ASP.NET Core arasındaki köprüyü ASP.NET Core Module (ANCM) kurar. Bu modül, gelen isteği alır ve uygulamaya iletir. Ama tam olarak nasıl ilettiği, hosting modeline göre değişir.

IIS (Internet Information Services) is the web server on Windows that handles incoming HTTP requests. ASP.NET Core applications do not run directly inside IIS — they run on their own server called Kestrel.

The bridge between IIS and ASP.NET Core is built by the ASP.NET Core Module (ANCM). This module receives incoming requests and forwards them to the application. But exactly how it forwards them depends on the hosting model.

2
inprocess nedir? What is inprocess?

Bir fabrika düşün. Müdür doğrudan üretim bandında çalışıyor — aynı mekânda, aynı ekipte. Hızlı iletişim, minimum gecikme.

inprocess modunda ASP.NET Core uygulaması, IIS'in worker process'i olan w3wp.exe içinde çalışır. Araya ekstra bir iletişim katmanı girmez. Bu yüzden daha hızlıdır.

Ama bir riski var: w3wp.exe çökerse, aynı process içindeki tüm uygulamalar birlikte çöker.

Think of a factory. The manager works directly on the production line — same space, same team. Fast communication, minimal delay.

In inprocess mode, the ASP.NET Core application runs inside IIS's worker process, w3wp.exe. There is no extra communication layer in between. That is why it is faster.

But there is a risk: if w3wp.exe crashes, all applications running inside that same process crash together.

💡
inprocess: daha hızlı, ama aynı process'teki uygulamalar birbirini etkiler. inprocess: faster, but applications in the same process affect each other.
3
outofprocess nedir? What is outofprocess?

Aynı fabrikada müdür artık ayrı bir odada çalışıyor. Üretim bandından mesaj geliyor, müdür kendi odasında işliyor ve cevabı gönderiyor.

outofprocess modunda ASP.NET Core uygulaması, IIS'ten bağımsız olarak kendi dotnet.exe process'inde çalışır. IIS sadece aracı görevi görür — isteği alır, Kestrel'e iletir, cevabı geri gönderir.

Avantajı: bir uygulama çökerse diğerleri etkilenmez. Her uygulama kendi izole process'inde yaşar.

In the same factory, the manager now works in a separate room. Messages come from the production line, the manager processes them in their own room, and sends back the response.

In outofprocess mode, the ASP.NET Core application runs in its own dotnet.exe process, independent from IIS. IIS only acts as a middleman — it receives the request, forwards it to Kestrel, and sends back the response.

The advantage: if one application crashes, the others are not affected. Each application lives in its own isolated process.

💡
outofprocess: biraz daha yavaş, ama crash izolasyonu sağlar. Shared hosting'de şart. outofprocess: slightly slower, but provides crash isolation. Essential on shared hosting.
4
Ne zaman hangisi? Which one and when?

İkisinin de kullanım senaryosu var. Körü körüne birini seçmek yerine duruma göre karar vermek gerekir.

  • Shared hosting, birden fazla site aynı app pool'u paylaşıyor: outofprocess — crash izolasyonu için zorunlu.
  • Dedicated server, tek uygulama: inprocess — maksimum performans, izolasyon endişesi yok.
  • Azure App Service: inprocess — Microsoft'un önerdiği mod.
  • Docker / container: IIS yok, Kestrel doğrudan çalışır — hosting modeli geçersiz.

Both have their use cases. Instead of blindly picking one, the decision should be based on context.

  • Shared hosting, multiple sites sharing the same app pool: outofprocess — required for crash isolation.
  • Dedicated server, single application: inprocess — maximum performance, no isolation concern.
  • Azure App Service: inprocess — Microsoft's recommended mode.
  • Docker / container: No IIS, Kestrel runs directly — hosting model is irrelevant.
💡
`dotnet publish` varsayılan olarak `inprocess` üretir. Shared hosting'de bunu değiştirmeyi unutma. `dotnet publish` generates `inprocess` by default. Don't forget to change this on shared hosting.
5
web.config ayarı web.config setting

Hosting modeli web.config dosyasındaki hostingModel attribute'u ile belirlenir. Publish sonrası bu değeri kontrol etmek iyi bir alışkanlıktır.

The hosting model is determined by the hostingModel attribute in the web.config file. Checking this value after publishing is a good habit.

xml
<!-- inprocess: uygulama IIS worker process (w3wp.exe) içinde çalışır -->
<aspNetCore processPath="dotnet"
            arguments=".\MyApp.dll"
            stdoutLogEnabled="false"
            stdoutLogFile=".\logs\stdout"
            hostingModel="inprocess" />

<!-- outofprocess: uygulama kendi dotnet.exe process'inde çalışır -->
<aspNetCore processPath="dotnet"
            arguments=".\MyApp.dll"
            stdoutLogEnabled="false"
            stdoutLogFile=".\logs\stdout"
            hostingModel="outofprocess" />
💡
Shared hosting'de 5 site aynı app pool'u paylaşıyorsa tümü outofprocess olmalı — biri inprocess kalırsa pool'u etkiler. If 5 sites on shared hosting share the same app pool, all must be outofprocess — if one stays inprocess, it affects the pool.
6
Mini quiz Mini quiz
MİNİ QUIZ MINI QUIZ
Shared hosting'de birden fazla site aynı app pool'u paylaşıyorsa hangi hosting modeli seçilmelidir? If multiple sites on shared hosting share the same app pool, which hosting model should be chosen?
inprocess — daha hızlı olduğu için inprocess — because it is faster
outofprocess — crash izolasyonu için outofprocess — for crash isolation
Her ikisi de kullanılabilir, fark etmez Either can be used, it doesn't matter
Shared hosting'de hosting modeli seçilemez Hosting model cannot be chosen on shared hosting