php chat concept
Moderator: General Moderators
php chat concept
How does php chats work? Do they keep open a live connection or it just looks that way?
I don't know about the irc module for php. where can I find it? I just a saw site which had php chat, and I'm wondering whats the concept, because browser don't keep the connection alive. As soon as the page is loaded the connection is closed.
Second, it must be all server side processing and that means too much load on the server.
thanks for the replies
Second, it must be all server side processing and that means too much load on the server.
thanks for the replies
Oh... I understand now.
I'm working on (ha!) something along the lines of what you're talking about.
I'll be quite happy to release the source code to you if you want to develop it further, as i'm notorious for developing things to a certain point and then losing interest...
http://www.vanillacity.com/geek/phptalker/
I'm working on (ha!) something along the lines of what you're talking about.
I'll be quite happy to release the source code to you if you want to develop it further, as i'm notorious for developing things to a certain point and then losing interest...
http://www.vanillacity.com/geek/phptalker/
In PHP chat scripts the database connection is never closed, refreshing the browser mearly gathers the new information entered into the database. And yes, php chat scripts do place a high load on the servers performance, think about it, 30 people chatting = 30 database queries every 3 seconds (refresh rate) + bandwidth consumption.
- Skittlewidth
- Forum Contributor
- Posts: 389
- Joined: Wed Nov 06, 2002 9:18 am
- Location: Kent, UK
server load
I've very recently written a chat script which is only for use between 2 or 3 people, and I've deliberately slowed the refresh rate down to once every 30 seconds for two reasons - one because when I'm chatting I should probably be working and so should the other person, and two I'm concerned about the load on the server.
I reckon the database gets queried up to once every 5 seconds if a particluarly good discussion is going and once every 15 to 20 seconds if the message pane is left open (you can temporarily close it when you aren't paying attention to avoid needlessly refreshing and calling the database).
My question is, just how much of a load will this create on the server? Normally I wouldn't be too concerned, but its hosted (I bought space) on the company that I work for 's commercial server, and the last thing I want is for my boss to pick out my IP address from the log files! Would a drop in server perfomance be noticable or even caused by just two people running this script between 9am and 4pm?!
Skittlewidth
I reckon the database gets queried up to once every 5 seconds if a particluarly good discussion is going and once every 15 to 20 seconds if the message pane is left open (you can temporarily close it when you aren't paying attention to avoid needlessly refreshing and calling the database).
My question is, just how much of a load will this create on the server? Normally I wouldn't be too concerned, but its hosted (I bought space) on the company that I work for 's commercial server, and the last thing I want is for my boss to pick out my IP address from the log files! Would a drop in server perfomance be noticable or even caused by just two people running this script between 9am and 4pm?!
Skittlewidth
-
fractalvibes
- Forum Contributor
- Posts: 335
- Joined: Thu Sep 26, 2002 6:14 pm
- Location: Waco, Texas
Here is a link to an ASP-based chatroom application:
http://www.aspalliance.com/peterbrunone/chatroom.asp
If PHP has the equivalent of Application variables, it could be adapted.
Application vars can be shared by all sessions using an application. If PHP has no equivalent, you could use a DB instead.
Phil J.
http://www.aspalliance.com/peterbrunone/chatroom.asp
If PHP has the equivalent of Application variables, it could be adapted.
Application vars can be shared by all sessions using an application. If PHP has no equivalent, you could use a DB instead.
Phil J.