asmith3006
August 26th, 2008, 09:25 AM
Hi,
I've developed an AJAX chat system for the company I work for which has a php/mysql backend to it for storing and administering. The system requests new posts from the server ever 2-4 seconds (random time to make it feel more 'live').
This is all the server does. The chat system itself is very very small. The page with the chat box is inserted into an iframe on a page that comes from another server. The chat page itself is about 4kb in size and then the system returns 12B of data if there is no new messages and about 4K per new message. I.e. very little data is actually passed.
I'm having problems with capacity. Last night we had over 150 users using the system and I hit the "MaxClients" variable on Apache. I've raised this temporarily but I think this is a bad idea.
Apache seems to use one thread per user and I think that the default for the "KeepAlive" is 15 seconds. First of all, does this mean that the system will wait 15 seconds, keeping the connection to each user open, to see if a user requests another page? If so, this is bad for my system isn't it? Should I turn off the "Keep Alive"? (can this be turned off using website.url.conf or does it have to be turned off in apache2.conf?)
Also, I've read that it's possible to run apache as a single thread rather than one thread per user. Would this be better for my situation?
Edit: Finally, is there a way to find out how many clients I have connected? (i.e. how many of the "MaxClients" value I've used?)
Thanks for any and all help.
Andrew.
I've developed an AJAX chat system for the company I work for which has a php/mysql backend to it for storing and administering. The system requests new posts from the server ever 2-4 seconds (random time to make it feel more 'live').
This is all the server does. The chat system itself is very very small. The page with the chat box is inserted into an iframe on a page that comes from another server. The chat page itself is about 4kb in size and then the system returns 12B of data if there is no new messages and about 4K per new message. I.e. very little data is actually passed.
I'm having problems with capacity. Last night we had over 150 users using the system and I hit the "MaxClients" variable on Apache. I've raised this temporarily but I think this is a bad idea.
Apache seems to use one thread per user and I think that the default for the "KeepAlive" is 15 seconds. First of all, does this mean that the system will wait 15 seconds, keeping the connection to each user open, to see if a user requests another page? If so, this is bad for my system isn't it? Should I turn off the "Keep Alive"? (can this be turned off using website.url.conf or does it have to be turned off in apache2.conf?)
Also, I've read that it's possible to run apache as a single thread rather than one thread per user. Would this be better for my situation?
Edit: Finally, is there a way to find out how many clients I have connected? (i.e. how many of the "MaxClients" value I've used?)
Thanks for any and all help.
Andrew.