What's new

socat dying intermittently

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

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
admin@RT-AC68U-BA30:/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
 
Yes add swap. While you won't see it used, it's known that a 2GB or more swap file alleviate cannot fork errors
 
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.
 
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

Sign Up For SNBForums Daily Digest

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