Page 1 of 1

Mikrotik keeps connection "established", stacking too many

Posted: Mon Apr 04, 2016 12:30 pm
by marathoneer
Hello!

I have RB751G-2HnD, running 6.33.5. Internet link via PPPoE.

I also have Ubuntu Server behind, NATed by Mikrotik to internet. There is job running on server, it tries to connect to my clients on specific TCP port, to check if it's open to communicate, written @ php, ordinary fsockopen/fclose . Runs daily, about 1-2K ips.

The problem I'm running in to - mikrotik tracks connection established forever, despite the fact Ubuntu server dropped it, other side aswell. Leaving me with thousands of connection esteblished, which at some point overload the router (usually close to 6-7K)

Image

Full size link

===============
root@10:/home/hostmit# netstat -ant|wc -l
171
===============

Netstat shows only 171 connections, while mikrotik ~2K+. Any ideas how do solve it? Why mikrotik keeps track it as established? Thanks.

Re: Mikrotik keeps connection "established", stacking too many

Posted: Mon Apr 04, 2016 1:20 pm
by BartoszP
Push "Tracking" button and lower maximum TCP session time-out ...
Seems that Ubuntu servers does not closes connections properly but leaves/orphanes them "open/active" and router waits till each one times-out ... 24h is default value

Re: Mikrotik keeps connection "established", stacking too many

Posted: Fri Apr 08, 2016 12:16 pm
by marathoneer
Thanks for reply. Tested - problem is Ubuntu Server related. Launched the same application at FreeBSD, it doesnt spawn tons of connections, not a single one appears on tracking tab with timeout over 5 mins.

I've limited tracking time, yet with at least 20 threads running, my internet connection goes unstable.