socat dying intermittently

  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

rabbas

New Around Here
Hello,
I have an asus RT-AC68U. I have installed the latest version of Asus Merlin. I have a socat process that redirects packets via an ssh tunnel to a server in the cloud. These are started via post-mount scripts.

I have a local ubuntu server doing the same thing and an openwrt (running as service).

Everthing works well but once in a whilte I have socat shutting down with the following error: "socat[1250] E fork(): Cannot allocate memory"

From the error it seems that there is no memory for a new socat fork. My typical memory usage is as follows
[email protected]:/jffs/scripts# free -mh
total used free shared buffers cached
Mem: 255700 73968 181732 0 1232 13100
-/+ buffers/cache: 59636 196064
Swap: 0 0 0

I am not sure if this specifically with socat (as in memory leak) or it is general for my device.

Has anyone expericed this? Should I add swap?

Any advise would be greatly appreciated.

Raza
 

Jack Yaz

Part of the Furniture
Yes add swap. While you won't see it used, it's known that a 2GB or more swap file alleviate cannot fork errors
 

rabbas

New Around Here
Thx Jack. I will give that a shot. For now I have turned off dlna and samba and to add to that I will activate swap.
 

rabbas

New Around Here
Following up. Adding swap certainly helped because it reduced the frequency with which the problem occurred. However it does occur but less often. For socat I am udp:recvfrom and this does not seem to support max children to control number of forks. I tried with udp:listen but that does not seem to work because it does not reply. Is there a way around this issue so that I can either control number of forks or an alternative to passing udp dns packets thru ssh tunnel.
 
Similar threads

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top