Pergunta

I was testing sessions behavior in Web Garden mode.

Why do all major browsers use only one process (on server) except Opera? and how is it done?

Here is very simple web application:

Code-behind:

protected void Page_Load(object sender, EventArgs e)
{
    Response.Write(Process.GetCurrentProcess().Id);
}

Markup:

<div>
    <asp:Button ID="Button2" runat="server" Text="Button" />
</div>

Every time I click on button in Opera I get different numbers (depending on Worker processes count), which is normal. But in Chrome, I always get same process id.

Foi útil?

Solução

You have made something wrong here and there is not sticky to browser process on web garden.

I have made some time ago the same tests and I never face this issue. I do not know the exactly mechanism, on how the asp.net is select what process will get the next request, but is not stick on the browser.

Some more

Web garden is when you use on the same computer/server/pool more than one process to proceed each client requests.

The Process.GetCurrentProcess().Id show what process is actual run the page you ask. I am not sure how the asp.net select what process will be selected to run the next request, probably have to do with the availability of each one, and the threads of each one run.

How ever did not have to do with the client and the calling browser data. So if you get the same or different ids, have to do with the load of the server, maybe the cache of the page on client, but for sure not have to do with the browser.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top