How does the server manage different user requests at the same time?

can you tell me how the server handles different HTTP requests at a time. If 10 users logged in and sent a page request at the same time, what will happen?

+5
source share
5 answers

Typically, each user sends an HTTP request to the page. The server receives requests and delegates them to various employees (processes or threads).

Depending on the given URL, the server reads the file and sends it to the user. If the file is a dynamic file, such as a PHP file, the file is executed before it is sent to the user.

, .

. HowStuffWorks Web Servers

+6

HTTP TCP, . TCP-, .

. .

Apache ( HTTP-) (MPM). / Apache . , . Apache MPM "" , , .

ab ( ApacheBench), Apache, , , HTTP-.

Apache , . , .

, HTTP ( 1.1) , HTTP- , , .

MPM Apache:

Apache (MPM). Apache 1.x prefork, Apache , . , .

Apache 2.x MPM, "", ( ) . , . .

, , mod_php. , "", , . . / , , , . , . PHP , , mod_php, MPM Apache "worker".

+2

Apache 2 . threaded server , "prefork" ( ).

0

, HTTP-.

, HTTP , , . /, , , /. / , . , , - -, , , / , .

0

(apache) , . , , . , . - .

PHP- . , . , CPU, , , .

" " - ( "", ), , . , - . , .

, .

0

All Articles