-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange spikes in users online count #17
Comments
Hey @samim23 I've come across this issue a couple of times, right now I'm trying to see if I can find a way to reproduce it. I'm also wanting to determine if this issue has been introduced in some of the later changes that have been made. Seems like @gabrielhpugliese has a similar issue: #12 |
ok cool. what is your recommendation for the mean time? i´m thinking about removing presence for now. |
You could try downgrade to an earlier version, perhaps e59a127 |
It's hard to debug. I tried to debug localhost and coderstv.com with 50 chrome tabs, but couldn't reproduce. Do not know where to console.log either. |
Hey, I've built a package just for this purpose. I do the interval on Gabriel Pugliese On Fri, Nov 22, 2013 at 11:43 PM, David Burles [email protected]:
|
@gabrielhpugliese very much looking forward to your patch as especially the issues with counters going up to 100 for a second seems to be getting worse and worse with scale. i´ve been researching "not using a heart" #10 a bit and seems like there is a more fundamental fix to be had in conjunction with that, or i´m i off track? |
Well, it worked like a charm for a few minutes. I think it needs more Gabriel Pugliese On Thu, Nov 28, 2013 at 7:20 AM, samim [email protected] wrote:
|
NP hard problem? how come a quake server browser solved this efficiently back in 1999 already? ;-) Anyhow, my issues are getting worse and worse now i´m hitting 1k daily users, even suspecting its pretty bad for the overall performance, could that be true? I´m gonna put in a day next week and will try to merge some of these libraries into a working solution, will share if i succeed. |
Well, the load on my application hosted on a single-core CPU 2GHz goes to Gabriel Pugliese On Thu, Nov 28, 2013 at 10:34 PM, samim [email protected] wrote:
|
Well, I just improved it. Instead of inserting things on client, defining Gabriel Pugliese On Fri, Nov 29, 2013 at 12:19 AM, Gabriel Pugliese <
|
@gabrielhpugliese you are amazing! i´m going to give this a spin right now and test it in-depth - will give you feedback asap. |
Forgot to say, it works with 0.6.4.1 only - what's the meteor version Gabriel Pugliese On Fri, Nov 29, 2013 at 4:06 AM, samim [email protected] wrote:
|
Ah to bad, i´m stuck on meteor 0.6.6.3 for now until the new render engine reaches a stable release. Hope i will get to that soon and i´ll get to check out your fix. |
Hey guys. I've just done a complete rewrite to make use of livedata. Would be awesome if you could try it out and let me know how it works for you. You can grab it from the livedata branch. |
Nice David, gonna try it :) Thanks Gabriel Pugliese On Sun, Dec 1, 2013 at 9:12 PM, David Burles [email protected]:
|
@gabrielhpugliese thanks!, interested to hear how you go. |
@dburles very cool stuff, thanks! I´ve been testing on my localserver and so far works like a charm! haven´t performance monitored fully yet but looking better off the bat. Might give it a shoot on the production server soon, anything to keep in mind with the transition? |
@samim23 Good to hear! the main differences I can think of are that A. the _id coming from the presences collection now is tied directly to the livedata session id, so these will drop on hot code reload, where previously it would reattach the session to the existing presence _id. and B. clients not connected through a socket, (long polling) take a while to drop off when disconnecting, not sure of the exact duration, but somewhere around 1 minute. I believe though that this may have already been an issue with the previous version. Anyway it's probably useful to be aware of this limitation. |
Will this work on 6.4.1 ? Gabriel Pugliese On Tue, Dec 3, 2013 at 10:34 AM, David Burles [email protected]:
|
@gabrielhpugliese I don't think so as it's relying on upsert which was introduced with 0.6.6 |
Okay :( Gabriel Pugliese On Tue, Dec 3, 2013 at 11:57 AM, David Burles [email protected]:
|
If you're feeling adventurous, it should work if you modify the upsert to the typical, check if exists, then run either an update or insert. |
Or maybe update my project to 0.6.6 :P I'm postponing it forever. My Gabriel Pugliese On Tue, Dec 3, 2013 at 12:07 PM, David Burles [email protected]:
|
Yeah updating the project would be a good idea :) |
@dburles i´m running your new version on the production server now at https://hyperboring.com. So far works perfect and no strange user counter raises anymore. Performance is much better to, with memory consumption and CPU time both down by allot. Nice job, this is great! |
You guys may want to check out https://github.com/mizzao/meteor-user-status, which I've used in many projects and seems to be pretty stable and straightforward. |
I've never used it because on docs it does not mention the possibility to Gabriel Pugliese On Tue, Dec 3, 2013 at 10:52 PM, Andrew Mao [email protected]:
|
@gabrielhpugliese I see - I always just assumed that anyone who would want to add anything on the client side would just add it to the |
For example, I need to know where an user is at the moment. I think it's Gabriel Pugliese On Wed, Dec 4, 2013 at 12:11 AM, Andrew Mao [email protected]:
|
@dburles i´ve been testing your new code for an evening and works nicely, except for "ghost" users that get stuck in the system for hours even though nobody is there. happens only sporadically, only reboot seems to work as a fix. |
@dburles Take a look at meteor/meteor#1552 to make sure you are using upsert correctly; if you don't include |
@mizzao thanks. looking into it more, i can cause ghost users to appear by refreshing the browser rapidly while logged in. also, strangely the socket close event fires twice on the same id for logged in users. |
Hey so i'm pretty confident i've now corrected the ghosting issue, the one i mentioned above. So assuming that this was causing the same problems that you were seeing @samim23 hopefully it will now no longer happen! It would be great if you could try it out and let me know if there are any issues @samim23. Make sure you grab it from here: https://github.com/dburles/meteor-presence |
@dburles super cool! i´ve just uploaded your new version to my production server. Not much testing yet but will give you proper feedback soon. |
thanks, appreciated! |
@dburles So i´ve done some testing today, two issues: Ghosts still can appear even though far less frequent. Unfortunately it stopped tracking non-logged in users completely which is bad for my usecase. |
@samim23 hey yeah sorry about that, I was doing a lot of testing with logged in users. I need to figure out how to write tests for this! I've patched it up now so just grab the code again from dburles/presence. If you don't mind, when you are seeing ghost users, could you show me what they appear like in the collection? |
@dburles i´ve just uploaded your most recent patch but now in my server stats the project average response time went from somewhere around 100ms to over a value of 150000ms. Evil ! As i did not change much else, i´m asking myself if this could be related to your update at all? I´ll look into making a snapshot of my collection asap and sending it over. |
Hmm I'm not sure how that correlates with the changes made. Wonder if On Sunday, 8 December 2013, samim wrote:
|
I apologize as it seems to be just a snafu random correlation with my host going insane exactly after my upload. Now looking into making a custom output page, showing everything in the presence collection, will share that URL with you asap. |
So it's nice to use now ? Gabriel Pugliese On Sat, Dec 7, 2013 at 9:12 PM, samim [email protected] wrote:
|
I believe so! Give it a try, some real world testing is good :) On Sunday, 8 December 2013, Gabriel H Pugliese wrote:
|
@gabrielhpugliese if you want to try it, make sure you grab it from https://github.com/dburles/meteor-presence |
Do you mean https://github.com/dburles/meteor-presence/ ? Gabriel Pugliese On Sat, Dec 7, 2013 at 9:32 PM, David Burles [email protected]:
|
@dburles did a intensive test with around 30 users over the course of a day. The ghosting issue is indeed still present, user will show up in the presence collection even though nobody is there. An additional new issue is, that sometimes users who are online in a room, wont be counted at all - leading to to low user count. Let me know how i can help to resolve these issues. |
Would it be possible to pinpoint any areas that may trigger the ghost users? HCR? login/logout? etc |
|
Quick update on the "user is in room but counter shows 0" issue. It seems like this occurs after a client is inactive for a while but remains in room/browser open/computer not sleeping. The disappearing users still show up in the overall presences counter though, just the field data gets lost. Not sure if this helps. |
That is really bad for me since my app is a platform for long videos :( Gabriel Pugliese On Wed, Dec 11, 2013 at 7:53 PM, samim [email protected] wrote:
|
Hey Gabriel there are some changes coming in the next version of meteor On Friday, 13 December 2013, Gabriel H Pugliese wrote:
|
Yeah. I'm going to stick with my own method. I just upgraded to 0.6.6.3. If Gabriel Pugliese On Fri, Dec 13, 2013 at 1:30 AM, David Burles [email protected]:
|
Yeah that's cool. The goal here is to not have to rely on polling so user On Friday, 13 December 2013, Gabriel H Pugliese wrote:
|
Would save our lives :) Gabriel Pugliese On Fri, Dec 13, 2013 at 2:17 AM, David Burles [email protected]:
|
@samim23 @gabrielhpugliese and @dburles In meteor-user-status am also (rarely) observing imaginary users being online after long periods of inactivity. It seems that the Meteor 0.6.7 seems to give us the option to get out of this mess. Unfortunately, it doesn't keep track of IP addresses, yet. I think I will submit a PR for that :) |
My users-counter package is not presenting ghost users :) Gabriel Pugliese On Thu, Dec 19, 2013 at 6:53 PM, Andrew Mao [email protected]:
|
I just had a moment of clarity about this bug while washing dishes. At least some of the problem in this package and also in meteor-user-status is the fact that the SockJS close event isn't fired when people sleep their computers, at least not for several hours. Sometimes it just isn't fired ever. This may be due to an older version of SockJS that Meteor is using or just something that isn't fixed yet, but I'm pretty sure this is the issue that's causing these ghost users. |
@mizzao makes sense, thanks for the pointer. Has anybody had the chance looking into the new meteor "facts" package? might solve our issues |
hey guys, i've decided to add a heartbeat here to deal with sleeping/unclosed sockets by maintaining a server side list of connected clients alongside a tick method. I currently don't have any real-world apps to properly test this over time with so any help with that is really appreciated, thanks. The updated presence package can be found over here: https://github.com/dburles/meteor-presence |
i´m using presence in a production app over at hyperboring.com.
noticing strange spikes at time in the online users count. 3 users are online but it will show 50-100 for 3-4 seconds and then go gradually back down.
Today the entire server died and when i looked at the logs, it was presence killing it.
Could this be related somehow? any thoughts are super welcome!
here´s my error log http://snipt.org/Bnv7
The text was updated successfully, but these errors were encountered: