是ASP.NET多线程(它是如何执行的请求) [英] Is ASP.NET multithreaded (how does it execute requests)

查看:550
本文介绍了是ASP.NET多线程(它是如何执行的请求)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是有点愚蠢的问题,但;

This might be a bit of a silly question but;

如果我有两个人正好在同一时间登录到我的网站,将服务器端code执行一前一后还是会被他们在单独的线程同时执行的?

If I have two people logging on to my site at exactly the same time, will the server side code be executed one after the other or will they be executed simultaneously in separate threads?

我在关于一个网站登录服务拒绝攻击好奇。服务器是否减缓,因为它有登录的大规模队列还是慢,因为它有一个十亿同时登录!

I'm curious in regards to a denial of service attack on a website login. Does the server slow down because it has a massive queue of logins or is it slow because it has a billion simultaneous logins!

推荐答案

这是不相关的ASP.NET本身(我在这方面知之甚少),但一般的Web服务器。大多数Web服务器使用线程(或程序)来处理请求,所以基本上,你有一个并行连接都将执行什么code的片段。当然,如果你访问其中锁被放置,允许只有一个会话执行查询数据库或者其他后端系统,你可能有隐式序列化所有请求。

This is not related to ASP.NET per se (I have very little knowledge in that area), but generally web servers. Most web servers use threads (or processes) to handle requests, so basically, whatever snippet of code you have will be executed for both connections in parallel. Of course, if you access a database or some other backend system where a lock is placed, allowing just one session to perform queries, you might have implicitly serialized all requests.

Web服务器通常具有一个最小和工人,它们被调谐到当前硬件(CPU,内存等)的最大数量。如果这些都用尽,新的请求将排队等待工作变得可用,或者直到未决请求的最大队列长度已达到此时它无视新的连接,有效的拒绝服务(如果这是有目的的,这就是所谓的一个拒绝服务或拒绝服务攻击)的。

Web servers typically have a minimum and maximum number of workers, which are tuned to the current hardware (CPUs, memory, etc). If these are exhausted, new requests will be queued waiting for a worker to become available, or until a maximum queue length of pending requests has been reached at which point it disregards new connections, effectively denying service (if this is on purpose, it's called a denial of service or DoS attack).

所以,在你而言这是一个组合,这是一个巨大的填补了队列的并发请求数。

So, in your terms it's a combination, it's a huge number of simultaneous requests filling up the queue.

这篇关于是ASP.NET多线程(它是如何执行的请求)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆