Meteor Refuses connections after several hours running


#1

Hi Everybody!!!
I’m developing an app with Meteor,
I start the app executing “meteor” in the app root folder. And it works like a charm for several hours.
But at some point (whit nobody browsing the site) it suddenly start to refuse all connections even local host on the listening port.
The NODE process and the mongod process looks fine on htop.

I think permissions and firewall and many more thing are fine because it works properly for a long time span, some times even an entire day. (but most times the problem appears between 2 and 6 hours of being running)

The project includes meteorhacks:cluster but the problem is the same with cluster active or inactive.

Some Ideas???
Thank you in advance.


#2

check open network connections, like netstat -ano
I noticed when working with Polymer, that when I had 1 typo in included library, 1 client could block all ports etc.
Maybe you have some similar issue there which eat up connections over time (in some loop or by cron function).


#3

Thank You shock,
I’m looking at netstat -ano and each time I access the site in the browser a new connection shows up as ESTABLISHED.
But when I close the tab in the browser the connection keep the ESTABLISHED state.
So, each time I do the same a new connection shows up and never leave.
The problem is obvious. The system reach the maximum allowed connections for this port.

The question is why?? I’m not using polymer by the way. How can I find the problem cause?


#4

If you close the tab/browser it does not close the connection immediatelly, but it should timeout some time later.
Problem would be if it is opening these connection without client interaction over time and do not timeout them.


#5

Hi Again, Sorry I didn’t respond quicker.
I can reproduce the problem, I start the meteor App. and it stop responding. So I wait for 2 entire days. in netstat all waiting and Established connections disappear and only remain the listen open.
But is not working. So I guess is somthing else, not the connections limit.
I never get an error and the program don’t look very memory hungry.

Some other ideas?


#6

Hi Matias!

I remember having a chat app that we used on a company I worked for, working for several days (I’m not sure how often I deployed, that might be a factor).

I’d suggest some sort of binary search, removing all non core libraries and looking if the app works uninterrupted. I would start but removing meteorhacks:cluster (this seems like it could be very intrusive, and I will remove the library instead of just disabling it, to try). Could you share the list of libraries that you are using on the app?

Also, as a parallel test (and assuming you have the available servers), I’d suggest deploying a plain newly created Meteor app to see if the problem can be reproduced there. In such case you should open a ticket to Meteor.

Hope I provided some ideas, good luck and let me know how it goes!

Abrazo