• 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

Timeout disconnections

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

Post a reply
16 posts • Page 1 of 2 • 1, 2

Postby awf » Thu Dec 08, 2011 3:35 am

I'd be eternally (and maybe even financially) grateful for any help with this. My group has had to revert to php mini-chat, and it's no where near as fully featured as phpFreeChat, so I'd love to get this going.

* PFC Version: 1.3

* PHP Version: 5.2.17

* Shared or Dedicated Hosting: shared

* Link to your website:
http://www.catplace.net/writer/chat/ or http://catplace.net/awf/chat.php

* Are you able to reproduce the issue on the official demo? No, perhaps because ping times to the demo site are shorter.

* Have you set any parameters?

Yes, to link the chat to a PHPBB site.

I've tried adjusting the refresh_delay, refresh_delay_steps and timeout parameters, to no avail.

Code: Select all
<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../phpbb/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
require($phpbb_root_path . 'common.' . $phpEx);
 
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
 
if ($user->data['user_id'] == ANONYMOUS)
{
    login_box('', $user->lang['LOGIN']);
}
?>
<?php

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["title"] = " ";
//$params["nick"] = "guest".rand(1,1000);  // setup the intitial nickname
$params["nick"] = $user->data['username'];
$params['firstisadmin'] = false;
//$params["isadmin"] = true; // makes everybody admin: do not use it on production servers ;)
if ($user->data['group_id'] == 4 OR $user->data['group_id'] == 5) // Admins and Moderators
{
   $params["isadmin"] = true;
}
$params['frozen_nick'] = true;
$params['admins'] = array('admin' => 'emergency');
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["channels"] = array('Off Topic','Writing');
$params["debug"] = false;
$params['skip_proxies'] = array('censor','noflood');
$params["theme"] = "awf";
$params["max_text_len"] = 2000;
$params["max_msg"] = 50;
$params["display_pfc_logo"] = false;
$params["refresh_delay"] = 4000;
$params["refresh_delay_steps"] = array(4000,20000,5000,60000,8000,300000,15000,600000,30000);
$params["timeout"] = 60000;
$chat = new phpFreeChat( $params );

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>Australian Writers' Forum - Discussion</title>
 </head>
 <body>
   <h1>Australian Writers’ Forum</h1>

   <?php $chat->printChat(); ?>

</body></html>

* What is the issue you are experiencing in detail?

Users, especially those with slow connections, are frequently disconnected without notice. Those who remain connected see 'timeout' messages. Some examples:
Code: Select all
08/07/2011 10:37:11 * Mike Murphy quit (timeout)
08/07/2011 10:45:32 * Mike Murphy quit (timeout)
08/07/2011 11:02:35 * Mike Murphy quit (timeout)
08/07/2011 11:09:59 * Mike Murphy quit (timeout)
08/07/2011 11:17:20 * Bex quit (timeout)
08/07/2011 11:19:56 * Mike Murphy quit (timeout)
08/07/2011 11:21:53 * Mike Murphy quit (timeout)
08/07/2011 11:24:07 * Mike Murphy quit (timeout)
08/07/2011 11:30:04 * Mike Murphy quit (timeout)
08/07/2011 11:33:34 * Mike Murphy quit (timeout)

01/12/2011 19:43:37 * ericsson joins Off Topic
01/12/2011 20:09:29 * PGB joins Off Topic
01/12/2011 20:22:29 * Peter McLennan joins Off Topic
01/12/2011 20:27:46 * PGB quit (timeout)
01/12/2011 20:30:35 * ElleyGirl joins Off Topic
01/12/2011 20:30:38 * PGB quit (timeout)
01/12/2011 20:31:26 * Greta joins Off Topic
01/12/2011 20:37:19 * PGB quit (timeout)
01/12/2011 20:42:26 * ericsson joins Off Topic
01/12/2011 20:43:59 * *Jessie* joins Off Topic
01/12/2011 20:44:22 * PGB quit (timeout)
01/12/2011 20:45:02 * *Jessie* quit (timeout)
01/12/2011 20:47:09 * Greta quit (timeout)
01/12/2011 20:50:41 * *Jessie* quit (timeout)
01/12/2011 20:52:29 * ericsson quit (timeout)

Note: none of these timeouts were the result of people leaving voluntarily.

I know this has been reported elsewhere, but I can't seem to find any solution.

I suspect the issue is related to long ping times (ie, several seconds), typical of slow connections. This may be why I can't duplicate the issue with the demo site. I've tried adjusting the refresh_delay, refresh_delay_steps and timeout parameters, to no avail.

* Are you seeing any error messages, such as javascript errors? No, the disconnected user sees nothing except the (static) chat, and other users see 'timeout' messages for the affected user.

Thanks!

Peter McLennan
Australian Writers' Forum Administrator
awf
New member
 
Posts: 7
Joined: Thu Dec 08, 2011 3:26 am
Top

Postby re*s.t.a.r.s.*2 » Thu Dec 08, 2011 4:52 pm

Hi,

Can you check if your data folder has the correct write privileges chmood 777 and that the server user has the also privileges , this is important because in the data folder there is some nick meta on the server that get updated with the timestamp every refresh delay..

If for some reasons this meta is not updated the checktimeout.class.php proxy will time out this user because his timestamp was not updated..

regards.
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby awf » Thu Dec 08, 2011 9:11 pm

Thanks for your very quick reply!

The data folder was 755; it's now 777. I will test it and see how it goes. However, the problem was intermittent so I'd be surprised if this was the problem. Sometimes people could stay connected and chat for ages; other times it disconnects some users very frequently (as per the above examples). This is why I suspect ping durations have something to do with it: they're practically random and sometimes are more prone to larger values (which I guess makes them stochastic :) ).

I'm afraid I don't understand how to check that 'the server user has the also privileges'. I configure the server using cPanel, although I think I can get command line access via puTTY.

Thanks again for your help.
awf
New member
 
Posts: 7
Joined: Thu Dec 08, 2011 3:26 am
Top

Postby re*s.t.a.r.s.*2 » Thu Dec 08, 2011 9:27 pm

Hi,

I meant to say with "the server user" the user that runs Apache if is the mentioned Webserver you are using...
Its surprisingly to know that you ran the script with the "/data" folder with permission 755..

lets us know what's up


regards.
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby awf » Thu Dec 08, 2011 10:20 pm

Ta again. I'm a bit out of my depth, but it seems that apache/bin/httpd is being executed by 'root' and 'nobody' (multiple times). I don't know how to check what privileges 'nobody' has; I thought that once the data folder was 777, 'nobody' should have permission to write to it.

I can't help but wonder if this is the wrong track. If there was a permission problem, then all of my chat users should be disconnected after the first ping. That's not what's happening. All users can survive at least some longer duration, which suggests that the ping timestamps are being written okay.

I suspect that the problem is a bit more complex; eg, when the ping duration exceeds the refresh delay duration. I've tried to simulate this by setting very short refresh delays (eg, 500ms), but wasn't able to get myself disconnected this way. (Unfortunately, my personal connection to the server is relatively fast so I rarely get the problem.)
awf
New member
 
Posts: 7
Joined: Thu Dec 08, 2011 3:26 am
Top

Postby re*s.t.a.r.s.*2 » Fri Dec 09, 2011 5:34 am

Hi,

If you had chmood your "/data" folder to 755 it wouldn't never worked, not even installed the themes folder in this folder because it wasn't writable , but lets focus now in this, when an user any user send a command "/update" to the chat , the command checktimeout.class.php kicks is, yes indeed any user and every refresh delay, what this command does is check the timestamp + timeout parameter on the "SERVER" meta folder and update the user id , and compare it with the actual timestamps when checking this file if the current timestamp is greater that old timestamp then this user get disconnected..

Now if this is happening and user gets disconnected you need to see if your chat server and the client stop sending the ajax request, if you are in a shared webserver it is possible that your admin is capping the httprequest to the server, so it doesn't get hammered by this constant refresh request..

Try to talk to any admin and ask if you are capped somehow, one that I remember it would do something like this was Hostgator shared service..

Because to be frank the timeout issue exist but not in a big proportion...

And if your user are in very unstable connection best thing overall is to increase the timeout param to a higher integrer...

regards.
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby awf » Fri Dec 09, 2011 8:56 pm

re*s.t.a.r.s.*2 wrote:...if you are in a shared webserver it is possible that your admin is capping the httprequest to the server, so it doesn't get hammered by this constant refresh request..

Try to talk to any admin and ask if you are capped somehow, one that I remember it would do something like this was Hostgator shared service...

This could maybe explain it. I'll check with the web hosting company. What's odd, though, is that some people in my chat are hardly ever affected by it, while others get disconnected every few minutes. For example, in those extracts I posted above, I was never disconnected once during those sessions. If the problem were server capping, I'd expect the problem to affect all users equally or randomly. But I will certainly follow this up.

I have set the timeout parameter to lots of different values, but it didn't seem to help. I remember reading somewhere that there was a maximum limit that was valid due to the need to avoid math overflow. What is the maximum valid value for timeout?

Thank you again for your support! :)
awf
New member
 
Posts: 7
Joined: Thu Dec 08, 2011 3:26 am
Top

Postby awf » Mon Dec 12, 2011 4:31 am

The hosting company has advised that they do not cap or throttle httprequests.

I have set the timeout parameter to lots of different values, but it didn't seem to help. I remember reading somewhere that there was a maximum limit that was valid due to the need to avoid math overflow. What is the maximum valid value for timeout?

I do feel that the timeout parameter won't be the solution. When users' ping times (as indicated in phpFreeChat) get up around 4 or 5 seconds, the user seems to be at risk of disconnection. I've never seen any ping time anywhere near the timeout default of 35 seconds.

I was going to try to simulate the problem by artificially adding say 5 seconds to the timestamp value, but I can't work out how.
awf
New member
 
Posts: 7
Joined: Thu Dec 08, 2011 3:26 am
Top

Postby re*s.t.a.r.s.*2 » Mon Dec 12, 2011 7:21 am

HI,

There shouldn't be a cap on the timeout parameter, but I don't think more 120000 = (2 minutes) should be necessary for timeout, I have only used a timeout of 60000..

If I remember this happens for slow connections?

One thing also is if your session is being timeout destroyed , if for some reason the session disappear then the user get timeout..

I am really out of ideas, I have disconnections in others CMS but phpbb3, somehow it never disconnect unless you really leave the chat..

I 've been in your chat and I dint get any timeout..

I'll be keeping an eye in your thread.

regards
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby awf » Mon Dec 12, 2011 7:30 am

Righto; thanks for your help. :)
awf
New member
 
Posts: 7
Joined: Thu Dec 08, 2011 3:26 am
Top

Postby Otterboyy » Thu Aug 23, 2012 9:59 pm

Have you ever come up with a solution?

I've recently gotten a large influx of users into the chat I've run for a few years (the last few months with phpFreeChat) and I've just ignored the timeout issue. Now I'm having to resolve it or move to another solution which I'd rather not do.
Otterboyy
Member
 
Posts: 10
Joined: Thu May 24, 2012 5:41 am
Top

Postby awf » Thu Aug 23, 2012 10:31 pm

Version 1.5 was intended to address this problem, but it didn't seem to help. I've now read elsewhere on this site that the problem is essentially unfindable but should hopefully not exist in the software rewrite now being undertaken. Roll on Version 2!
awf
New member
 
Posts: 7
Joined: Thu Dec 08, 2011 3:26 am
Top

Postby Otterboyy » Thu Aug 23, 2012 11:53 pm

Thanks for the quick reply :)
Otterboyy
Member
 
Posts: 10
Joined: Thu May 24, 2012 5:41 am
Top

Re: Timeout disconnections

Postby el_psycho » Tue Feb 12, 2013 11:16 am

Hi guys, there is some misinformation about unix/linux permissions in this thread, so im gonna clarify some things so people looking for a solution to this problem dont get the wrong information or think the problems is somewhere it's not.

777 is the same as rwx rwx rwx.
r = read, w = write, x = search or execute (search for folders, execute for files. search means you can get into the folder)

in that case of 777 the first 7 is for the owner of the file. so the owner has rwx rights.
the second 7 is for the group. so in this case the group also has rwx rights
and the last 7 is for "others" that means EVERYONE else thats not the user or is not in the group also has rwx rights. that would include the user nobody or ANY other user in the system.

so when you do chmod 777 myfolder it means every user in the system has full rights to that folder.
That is obviously not very secure, but thats not the purpose of this post.

so, technically speaking. if your permissions were set to 755 for the data/ folder it is still possible that everything would work just fine. Assuming of course that the owner of the folder is the user nobody (or http or whatever is called in your linux distrubution). Of course in this thread we dont know that becuase the user didnt post that information.

So, when people tell you to set your permissions to 777 its so that EVERY user in the system has access and we know the problem is not a permissions issue.

This place has a nice explanation of linux permissions for anyone who wants to know more.

Just my two cents.
el_psycho
New member
 
Posts: 1
Joined: Thu Feb 07, 2013 3:41 pm
Top

Re: Timeout disconnections

Postby bendeliduka » Wed Jul 03, 2013 9:42 pm

ok, this 'bug' has been really annoying me... and I've seen some interesting behavior that I think might let me track it down...

my chatroom is here: http://www.straightfacetest.com/freechat/

I switched to the 'static url' demo as it seems to have fewer issues with the timeout disconnects...

I've also noticed that the busier the chat is the lower the incidence of the "quit (timeout)" notices... (btw, where is the code the generates this message?)

The odd behavior is that sometimes users need to enter a message more than once... and it took a few months (and me being on a much slower internet connection) before I first noticed that problem (not that I didn't believe my users... but what you cannot see is hard to debug/troubleshoot)

I've got a minor hack in my code that shows the last command below the chat window so I could track the "/update" commands as I felt that perhaps they were not being sent as needed... and noticed in the code that an ajax command is not sent if a previous command is still pending...

This is where I think the problem lies.... when my submit failed... my chat window appeared 'hung' for several seconds.... and after 48 seconds it finally returned... with a few update cycles that were very slow (15-20 seconds) and then back to nearly normal 150ms or so....

so I'm thinking that perhaps after a few intervals of the update submit failing... an additional request needs to be sent anyway... (anyone know if this will cause issues?) I'm gonna see if I can hack away at a way to implement this and will report back with any success/results...
bendeliduka
New member
 
Posts: 2
Joined: Sat Mar 09, 2013 4:01 am
Top

Next

Post a reply
16 posts • Page 1 of 2 • 1, 2

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