Mikrotik keeps connection "established", stacking too many

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)

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.

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

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.