Apache Multi-threaded?
Posted by: Enill (---.0-176-173.mc.videotron.ca)
Date: October 13, 2012 03:06AM

Hi,
i am developing a PHP application application where i sometime have to send and ajax request to some long polling function.

If i try to send another request while the long polling loop is still running, the server seems to be waiting until the loop is returned before executing the second request.

I tried session_write_close() on the php side but without success.

Now i am suspecting that the Apache setting might be the problem and running only one worker.

It is possible? What should i do to fix this?

Thanks in advance!

Options: ReplyQuote
Re: Apache Multi-threaded?
Posted by: toivo (---.belrs5.nsw.optusnet.com.au)
Date: October 14, 2012 04:41AM

Apache on Windows is multi-threaded: [httpd.apache.org]

Are you sure your AJAX requests are sent asynchronously?

Options: ReplyQuote
Re: Apache Multi-threaded?
Posted by: stevenmartin99 (Moderator)
Date: October 14, 2012 08:06AM

yes you probably didnt send them async , but there is an issue in older versions of internet explorer that only allows two http requests to the same server,

to test, write a small script that takes a few seconds to complete, then open about 10 tabs in the browser,

try refresh all the pags at once, you will see the loading bar on each tab, if only 2 run , and the rest wait,, until the others finish , you will know.

you can modify this in the registru

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: Apache Multi-threaded?
Posted by: Enill (---.0-176-173.mc.videotron.ca)
Date: October 14, 2012 12:22PM

Thanks for the replies.

Here is what i did before posting my question:

- Used Firefox for my tests
- Used jQuery $.get(); which is ASync by default if i am right
- I did created about 10 tabs and refreshed them all at once, 9 were blocked/waiting, 1 was working

I changed some settings and i'll be testing it soon.

* httpd.conf
-----------
Uncommented 'Include conf/extra/httpd-mpm.conf'

Also added:

<location /server-status>
SetHandler server-status
Order Deny,Allow
Deny from all
Allow from all
</location>



* httpd-mpm.conf
----------------
<IfModule mpm_winnt_module>
ThreadsPerChild 500
MaxRequestsPerChild 0
</IfModule>



Edited 2 time(s). Last edit at 10/14/2012 12:37PM by Enill.

Options: ReplyQuote
Re: Apache Multi-threaded?
Posted by: stevenmartin99 (Moderator)
Date: October 14, 2012 01:10PM

It's nothing to do with apache,
Since it occurs in Firefox too I I think it's a particular tcpip setting.

If you let me know which version of windows , ill explai how to change it

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: Apache Multi-threaded?
Posted by: Enill (---.0-176-173.mc.videotron.ca)
Date: October 14, 2012 01:24PM

I suppose at this point i could give a look at the Registry.

Which key in the registry are you refering to?


Using Windows 7 Ultimate.

Options: ReplyQuote
Re: Apache Multi-threaded?
Posted by: stevenmartin99 (Moderator)
Date: October 14, 2012 01:41PM

Ok there is two keys you can try ,

first try these two keys

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings

create two 32bit dword keys

MaxConnectionsPer1_0Server
MaxConnectionsPerServer

set both to 10 for now, you may not increase above 20 as it would break your license and get you possible banned when searching on certain websites that don't allow concurrent connections. most set their banning threshold to 15 so 10 is good.


YOU WILL NEED TO RESTART AS THESE ARE CHANGES WINDOWS TCP INITIATION


-----------------------------------------

if you dont get the result you want, leave them there but add this one also at

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\

Create a dword 32bit key named

EnableConnectionRateLimiting

set to 1



YOU WILL NEED TO RESTART AS THESE ARE CHANGES TO THE NETWORK ADAPTOR

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote


Sorry, only registered users may post in this forum.