• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

[TODO] Late submission (Lagging)

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
8 posts • Page 1 of 1

Postby Djamoer » Wed Feb 15, 2006 5:59 am

Hi,

I tried to enter a text several time as fast as I could, and I noticed some of the texts are being submitted late. Try to enter 1-20, and you will notice the number is not displaying in order.

Any thought on this?
Thanks
Djamoer
Member
 
Posts: 29
Joined: Sun Feb 12, 2006 12:06 pm
Top

Postby phpfreechat » Wed Feb 15, 2006 9:24 am

Right, this is a bug.

In fact when sending a message, an asynchronous HTTP request is sent. If this request is slow, you have the time to send a second message and sometime, the second request will arrive before your first request !

One solution is to buffer the sent messages on the client side and wait for the server response before sending the next messages.
An other is to disallow text typing when while the last message is not arrived but this is very restrictive for the users !

I add this to the bug list.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby Djamoer » Wed Feb 15, 2006 3:46 pm

I never build a web application with AJAX before, so I can't really help.

But so far what I have in mind is that, is it possible to make the system more responsive? I do understand that it will take way too much resources if we do Async connection too much with the server, but I would love to see the possibility in seeing a IRC like system on the web, without having to see the lag.

Do you think it's do able kerphi? So far what I can understand is IRC displaying the text of the user message being typed to the screen first, before it actually send the message accross the network. I might be wrong.

Let me research this further.
Thanks for the response.
Djamoer
Member
 
Posts: 29
Joined: Sun Feb 12, 2006 12:06 pm
Top

Postby phpfreechat » Wed Feb 15, 2006 4:14 pm

Djamoer wrote:But so far what I have in mind is that, is it possible to make the system more responsive? I do understand that it will take way too much resources if we do Async connection too much with the server, but I would love to see the possibility in seeing a IRC like system on the web, without having to see the lag.

Just tune the "refresh_delay" parameter. Lower this parameter is, more responsive the chat is.

example:
Code: Select all
$params["refresh_delay"] = 1000; // 1000ms = 1s
$chat = new phpFreeChat($params);
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby Djamoer » Thu Feb 16, 2006 4:22 am

But kerphi,

Having 100 or more users in the chat room and each of them connecting with the server for every 1 second, will it put too much load on the web server? I believe you already have this research done when creating the script, and I would personally ask for your advice here. I'm planning to use this as a substitue of IRC for MODx channel, but I'm affraid of the lagging trouble that I encountered, as well as the server load that it will take.

Do you have any idea how IM or IRC implement it, without taking too much load on the server?

Thanks
Djamoer
Member
 
Posts: 29
Joined: Sun Feb 12, 2006 12:06 pm
Top

Postby phpfreechat » Thu Feb 16, 2006 8:55 am

I just answered your question : "is it possible to make the system more responsive?"

And you'r right, if you increase the refresh frequency, the server will certainly overload. You must find the a compromise.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby IAmALlama » Sat Feb 18, 2006 11:46 am

another fix to this might be to disable the textfield for like 1 second after sending a message. to prevent multiple messages to be sent before the httprequest can finish.
IAmALlama
New member
 
Posts: 2
Joined: Sat Feb 18, 2006 10:20 am
Top

Postby phpfreechat » Sat Feb 18, 2006 12:24 pm

IAmALlama wrote:another fix to this might be to disable the textfield for like 1 second after sending a message. to prevent multiple messages to be sent before the httprequest can finish.

I think it would be very displeasing for users. But this is only my belief, I'm accustomed to split my sentences into sevreal part, so if the textfield is disable for 1 second it will be very displesent.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top


Post a reply
8 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 6 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub