As apache
creates a new thread on new client request. so I wanted to configure apache to create an only single thread so it will not be able to handle more than one request at a time.
What I have done
Changes in apache httpd-mpm.conf
mpm_winnt_module
module
<IfModule mpm_winnt_module>
ThreadsPerChild 1
MaxConnectionsPerChild 0
</IfModule>
Created a block.php
which keep script sleep for 30 sec
<?php
sleep(30);
phpinfo();
echo "Done";
?>
Created a hello.php
which print hello
<?php
echo "hello";
?>
Now what should be happening is when running block.php
apache will create a new thread for it will take 30 sec to execute. In this 30sec the threads will busy.
At the same time, if I run hello.php
it should not run because I have configured apache to create only one thread so hello.php
should not be executed at the same time it should wait for 30sec.
But this is not working as I am thinking, is there anything I am missing? I just wanted to understand apache multithreading behavior.