Hello Neighbour,
Here is the javascript code:
function init() { var options = { type: "POST", url: "testSharing", }; for(var i = 0; i < 100; i++) $.ajax(options); } $(document).ready(init);
You need to download jQuery so that this code works but you can also create equivalent code that does not use jQuery and that does the same thing. At least you have the idea of what I am doing.
As far as permissions go:
sudo chown www-data:www-data /testSharing.log sudo chmod 660 /testSharing.log
will do the trick.
In your case, you are running multiple processes, as you can see in your log output (the four digit number before the hyphen after the milliseconds field). In order to force Apache to run as a single process with multiple threads, you need to change the config in apache2.conf by adding/changing:
<IfModule mpm_worker_module> StartServers 1 MinSpareThreads 5 ThreadsPerChild 20 MaxRequestsPerChild 0 ServerLimit 1 PerlInterpMax 1 </IfModule>
Also, install the worker mpm by running:
sudo apt-get install apache2-mpm-worker
Then, you will only have a single process and multiple threads, as you will clearly see when you run the javascript above and check the log file.
I hope someone can help me with this problem. Still not clear why multiple instances are initialized.
Sincerely,
Pawel
In reply to Re^3: Threaded MPM Sharing Variables (this time with complete test code)
by busymeister
in thread Threaded MPM Sharing Variables (this time with complete test code)
by busymeister
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |