Sunucu, yapılandırmasına bağlı olarak, genel olarak hizmet verebilir hundreds of requests at the same time - Apache kullanması durumunda, MaxClients
yapılandırma seçeneği söyleyerek biridir:
The MaxClients
directive sets the
limit on the number of simultaneous
requests that will be served.
Any
connection attempts over the
MaxClients
limit will normally be
queued, up to a number based on the
ListenBacklog directive.
Once a child
process is freed at the end of a
different request, the connection will
then be serviced.
The fact that two clients request the same page is not a problem.
Yani:
Istekleri sıraya olacak?
No; eğer hariç:
- Orada bazı lock yerde - ki iki istekleri aynı istemciden gelen ve kullandığınız file-based sessions in PHP eğer, örneğin, olabilir: bir komut dosyası idam edilirken, oturumu sunucu / istemci ilk istek (and the file unlocked), ikinci kullanıcı için oturum açmak için dosyayı kullanmak mümkün bitene kadar beklemek zorunda kalacak anlamına gelir, "kilitli" olduğunu.
- istekleri aynı istemci ve aynı tarayıcı geliyor; Sunucu tarafında bu davranışı üreten bir şey olduğunda bile tarayıcıların çoğu, bu durumda istekleri sıraya.
MaxClients
etkin işlemlerin daha vardır - hemen önce Apache kılavuzundan alıntı bakın.
Bunlar göz ardı edilecektir?
No: Bu sadece tek bir kullanıcı aynı anda bir web sitesini kullanabilirsiniz anlamına gelir; Bu, oldukça güzel olmazdı, değil mi?
If it was the case, I could not post this answer, if you where hitting F5 at the same moment to see if someone answered !
(Well, SO is not in PHP, but the principles are the same)
Başka bir olasılık?
Evet ^ ^
edit after you edited the OP and the comment :
Will each request have its own script
instance?
"script instance" gibi bir şey yoktur: basitçe, ne bir komut dosyası için bir istek yapıldığında nerede oluyor olduğunu:
- webserver çatal another process isteği işlemek için (often, for performance reasons, those forks are made in advance, but this changes nothing)
- the process reads the PHP script from disk
- several processes can do this at the same time, dosya okumada herhangi bir kilitleme de mevcut değildir
- Dosya belleğe yüklenir; Her işlem için ayrı bir bellek bloğunda
- hala bellekte - bellekte PHP dosyası "compiled" opcodes için
- Bu opcodes yürütülür - hala isteğinizi yanıtlayan sürecine ait bellek bloğundan
Really, you can have two users sending a request to the same PHP script (or to distinct PHP scripts that all include the same PHP file) ; that's definitly not a problem, or none of the website I ever worked on would work !