# OpenVZ tcpsndbuf and tcprcvbuf - safe values? [solved]

## CanuteTheGreat

I am running OpenVZ on a Gentoo Linux production server. The VPSs include a mix of Gentoo, Debian, and Centos. I've noticed that the Gentoo VPSs tend to hit the tcprcvbuf faster than the others when updating as emerging source packages tend to be larger than some binary packages. One of the Gentoo VPSs is a download mirror and I see lots of failcounts for both tcprcvbuf and tcpsndbuf. So, my question is: I obviously need to increase the bean counters for tcp send and receive, but I'm not sure what to send to to? I don't want to set them too large and have problems with network connections in the host or other VPSs. Reading through the OpenVZ user guide, wikis, and some googling doesn't turn up much wrt safe values. Does anyone have any recommendation for what values (or range of values) are safe?

Also, I don't think the "low memory" issue mentioned in the OpenVZ wiki applies as the host is an AMD64 machine (64-bit Gentoo install) with 16GB of RAM. I doubt there would be a problem with overloading/overburdening the NIC as the system has dual 100MBit/s connections that are bonded together - so the chances of maxing out the network are a lot lower...Last edited by CanuteTheGreat on Mon Jun 30, 2008 2:06 pm; edited 1 time in total

----------

## zeek

 *rbf wrote:*   

> One of the Gentoo VPSs is a download mirror and I see lots of failcounts for both tcprcvbuf and tcpsndbuf. So, my question is: I obviously need to increase the bean counters for tcp send and receive, but I'm not sure what to send to to? I don't want to set them too large and have problems with network connections in the host or other VPSs.

 

I don't think setting these values too high has detrimental effect for networking, rather it is wasteful of "low memory" ... but low memory only applies to x86, amd64 has no limitations.  I would just increase the values until the failures go away.

----------

## CanuteTheGreat

Thanks for the reply!

It appears this is the case. I slowly increased them (on a test VPS) in 1MB increments until the failures went away. Later I found a configuration example (in a less than obvious place, but that's IMO) that showed recommended values for a VPS running moderately busy services. For anyone else who finds this thread and has the same problem, the settings that seemed to do the trick were:

tcpsndbuf 5365760:10485760

tcprcvbuf 5365760:10485760

kmemsize 16384000:18022400

othersockbuf 1503232:4063232

dgramrcvbuf 262144

oomguarpages 102400

I will update the other affected VPSs and see how they go for the time being, but so far that seems to have solved it.

----------

