Contact SalesSitemapCustomer Login

Go Back   VPSlink Forums > Technical Discussion > Linux

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 08-23-2006, 11:49 AM
Junior Member
 
Join Date: Aug 2006
Posts: 13
Default Are you hitting Socket Resource Limits?

While well below my 256MB memory quota, I am finding that I am hitting socket resource limits fairly often (every time SpamAssassin runs I overrun dgramrcvbuf and numothersock). While I knew RAM would be a limited quantity, I was surprised at all of the other OpenVZ resource limitations that can be easilly hit.

I was wondering if any other users are hitting their socket resource limits?

You can tell if you are overrunning any virtual machine resource limits with:

grep -v ' 0$' /proc/user_beancounters

which will show you any resources which have exceeded their limit - ie, have a non-zero fail count (failcnt) in the last column.

In my case this is causing socket-related mail.log errors, and I fear dropped mail.

Does anyone else have any experience with how to manage within these limits?

-braddock
Reply With Quote
  #2 (permalink)  
Old 08-23-2006, 01:01 PM
Senior Member
 
Join Date: Aug 2006
Posts: 524
Send a message via AIM to kelvinn Send a message via MSN to kelvinn Send a message via Yahoo to kelvinn Send a message via Skype™ to kelvinn
Default

I'm only on a Link2, but on idle used to always use around 110 (in regards to the numothersock).

I requested from VPSLink that the limit be raised, however was notified I needed a Link3 account to reallocate resources. Since my VPS runs at around 50% utilization of memory, there isn't an immediate need to upgrade. It sounds like you are on a Link3, so maybe a support ticket would allow an official VPSLink person to upgrade your resources, I don't know.

I hunted the problem down to postfix, which I do like indeed, but it appears to hog sockets. Throwing out unneeded processes would shave about 20 used sockets, however I hate the idea of crippling postfix.

Eventually I needed to simply switch to exim4. Now I usually run at about 25 numothersock.

Are you using postfix?

Another tip for people to check what is hogging their sockets is lsof:

lsof -U

I look forward to hearing other responses
__________________
Kelvin Nicholson
http://www.helomx.com - Blacklist and availability monitoring built from the ground up for outsourced IT providers.
Reply With Quote
  #3 (permalink)  
Old 08-23-2006, 01:20 PM
Junior Member
 
Join Date: Jun 2006
Posts: 17
Default

What is "dgramrcvbuf" because i'm on a Link 4, and in the failcnt is "665"
Reply With Quote
  #4 (permalink)  
Old 08-23-2006, 02:05 PM
Junior Member
 
Join Date: Aug 2006
Posts: 13
Default

Quote:
Originally Posted by Moonman
What is "dgramrcvbuf" because i'm on a Link 4, and in the failcnt is "665"
I found resource definitions at (not formatted correctly): http://forums.cacti.net/files/extend...n_data_202.txt

dgramrcvbuf = "The total size of receive buffers of UDP and other datagram protocols."

The corresponding tcprcvbuf defintion has a little more detail: "i.e. the amount of kernel memory allocated for the data received from the remote side, but not read by the local application yet."

My Link-3 barrier for dgramrcvbuf is set at 108000. If that means only 108 kbytes, then I'm not surprised that it is routinely exceeded!

numothersock = "The number of sockets other than TCP ones. Local
(UNIX-domain) sockets are used for communications inside the system. UDP
sockets are used, for example, for Domain Name Service (DNS) queries. UDP
and other sockets may also be used in some very specialized applications
(SNMP agents and others).
"

My Link-3 numothersock limit is 256. From what I can find, on a "real" Linux kernel it is at least 4,096, and usually much higher.
Reply With Quote
  #5 (permalink)  
Old 08-23-2006, 02:16 PM
Junior Member
 
Join Date: Aug 2006
Posts: 13
Default

Quote:
Originally Posted by kelvinn
I requested from VPSLink that the limit be raised, however was notified I needed a Link3 account to reallocate resources. Since my VPS runs at around 50% utilization of memory, there isn't an immediate need to upgrade. It sounds like you are on a Link3, so maybe a support ticket would allow an official VPSLink person to upgrade your resources, I don't know.
Thanks kelvinn. I did file a trouble ticket, but was told I would have to upgrade to Link4 to increase the limit. Since moonman is on Link4 and is at least still hitting the dgramrcvbuf limit, I'm not sure even that will help.

You are entirely correct about the numothersock limit excesses being due to postfix. Postfix master is using a lot of sockets to talk to its various children. Thanks for that 'lsof -U' gem.

However, I've now made enough tweaks (below) that I don't seem to be routinely exceeding the socket number limit. But that dgramrcvbuf buffer size limit is tougher...spamassassin still exceeds that fairly regularly.

Here is a set of tweaks that I did to limit my socket usage...not by much, but after a few hours at least I haven't exceeded my numothersock socket count:

Tweaking the number of sockets used down:

1) Make dovecot use a single login process.

Edit /etc/dovecot/dovecot.conf, add line:
login_processes_count = 1
(instead of the default of 5)
saves about 10 sockets in the numothersock resource.
/etc/init.d/dovecot restart

2) Make spamassassin use a single process thread:

Edit /etc/default/spamassassin, set '--max-children 1'
Saves at least 3 sockets, probably much more when spam is run through.
/etc/init.d/spamassassin restart

3) Make saslauthd use a single thread (instead of default 5)
Edit /etc/default/saslauthd and add "-n 1" to the PARAMS line.

Note that /etc/init.d/saslauthd stop failes to work. I had to do a
'killall saslauthd' and then '/etc/init.d/saslauthd start'
Saves possibly 8 sockets.

I also tried stopping the spamassassin daemon entirely, and just having procmail run it stand-alone hoping that would cut down on IPC...but to no avail, dgramrcvbuf is still hitting the limit at least half the time.
Reply With Quote
  #6 (permalink)  
Old 08-23-2006, 06:10 PM
Senior Member
 
Join Date: Jun 2006
Location: Guadalajara, Mexico
Posts: 541
Default

maybe you could avoid using spamassassin as it is such a hogger

http://www.freesoftwaremagazine.com/..._spam_postfix/
Reply With Quote
  #7 (permalink)  
Old 08-23-2006, 10:14 PM
Administrator
 
Join Date: Feb 2006
Posts: 773
Default

Guys,

Thanks for bringing this to my attention. We're going to be pushing out new values in short order. There was a fairly high incident rate of failure with dgramrcvbuf.
Reply With Quote
  #8 (permalink)  
Old 08-24-2006, 08:28 AM
Junior Member
 
Join Date: Jun 2006
Posts: 17
Default

Thanks guys, it just keeps getting better
Reply With Quote
  #9 (permalink)  
Old 08-24-2006, 01:15 PM
Junior Member
 
Join Date: Aug 2006
Posts: 13
Default

Quote:
Originally Posted by vpslinkdotcom
We're going to be pushing out new values in short order.
Nifty! Can't wait to see the new values.

pablasso - thanks for that anti-spam article tip. I didn't think it was possible without SpamAssassin (my host receives over 10k spam attempts per day), but simple greylisting, HELO restrictions, and RBL's have entirely eliminated any spam.
Reply With Quote
  #10 (permalink)  
Old 09-10-2006, 09:46 PM
Junior Member
 
Join Date: Aug 2006
Posts: 13
Default

Quote:
Originally Posted by vpslinkdotcom
We're going to be pushing out new values in short order. There was a fairly high incident rate of failure with dgramrcvbuf.
Any update on when the more realistic socket limit values will be pushed out?

I've been logging my beans file for a couple weeks, and hit the dgramrcvbuf limit about once or twice every day with a fairly minimal mail server setup on a Link 3 VPS.

I worry about a key piece of e-mail getting glitched...
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT. The time now is 03:36 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0