Hi Richard,

Thanks for your suggestion.

Yes, Apache is the wrong platform for the server.  What would be 
ideal is a custom designed TCP based multi-threaded server.

Since we had lots of constraints, we went in for Apache / PHP.  
What i'm trying to do is to reduce the number of compromises being 
made in this architecture.

If i have a long running script, the script is still "polling" the 
database, wasting precious server CPU cycles.  Having an open 
socket on which the server calls select() is much less CPU 
intensive.

"Instant" is how the response should be.  Thats why i'm clamouring 
for the socket so that i can send data directly to the client, 
 from a C++ binary or maybe another script.

And to have the script running for hours, i would have to change 
the script timeout to a ludicrous setting, which would leave open 
many more possiblities for other problems.

Tx,
Vinod.

On Wed, 22 May 2002 Richard Archer wrote :
>At 7:01 AM +0000 22/5/02, Vinod  Panicker wrote:
>
> >What i have at the other end is a Instant Messenger client :)
>
>Which is presumably accepting some form of HTML or at least a
>stream of data sent over HTTP and displaying the data. If it's
>notdoing this, Apache is almost certainly the wrong platform
>for the server!!
>
>So, just keep on streaming the data to the client. Keep the
>script running and keep on sending the message.
>
>If you need to have the client send a status stream to the
>server, have it trigger a new message which will be received
>by a second script on the server. This script would insert the
>new status for that client in a database and the long-running
>script would periodically poll the database and act upon
>whatever status info it finds. Might not be "instant" update,
>but that's dependent on how often you poll for change of 
>status.
>
>
> >Cant have the script running till the time the user logs out 
>can
> >i?
>
>Why not? You're planning on sending data to them until they log
>out, so why not keep one script running?
>
>  ...R.
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

_________________________________________________________
Click below to visit monsterindia.com and review jobs in India or 
Abroad
http://monsterindia.rediff.com/jobs


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to