Solved

pushing squid to the limit

Posted on 2004-09-13
4
1,972 Views
Last Modified: 2013-11-22
I am back again, We are using squid  squid-2.5.STABLE6 on FreeBSD 4.9-RELEASE-p8 , at first we had the following problem the server after few hours hangs up and give this error
2004/08/25 15:42:48| comm_udp_sendto: FD 6, 217.21.5.35, port 53: (55) No buffer  space available
2004/08/25 15:42:48| idnsSendQuery: FD 6: sendto: (55) No buffer space available
2004/08/25 15:42:48| comm_udp_sendto: FD 6, 217.21.5.35, port 53: (55) No buffer space available
2004/08/25 15:42:48| idnsSendQuery: FD 6: sendto: (55) No buffer space available

The machine has 2G Ram and 4*36 SCSI HDDs,
We increased
kern.ipc.nmbclusters=64000
kern.ipc.nmbufs=256000
net.inet.udp.maxdgram=65535
we also used a caching DNS server on loopback interface.

Then we got the following problem
    (49) Can't assign requested addressSquid is unable to create a TCP socket
We increased

kern.maxusers=512
kern.maxfilesperproc: 39491
kern.maxfiles: 42768

after that we had the following problem

2004/09/09 15:33:04| commBind: Cannot bind socket FD 2021 to *:0: (49) Can't assign requested ad
dress
2004/09/09 15:33:04| commBind: Cannot bind socket FD 1797 to *:0: (49) Can't assign requested address

So we increased
net.inet.ip.portrange=49151

After that we had the following error


2004/09/10 15:26:27| comm_open: socket failure: (24) Too many open files
2004/09/10 15:26:27| comm_open: socket failure: (24) Too many open files
2004/09/10 15:26:27| comm_open: socket failure: (24) Too many open files
2004/09/10 15:26:28| comm_accept: FD 26: (53) Software caused connection abort
2004/09/10 15:26:28| httpAccept: FD 26: accept failure: (53) Software caused connection abort
2004/09/10 15:26:32| comm_accept: FD 26: (53) Software caused connection abort
2004/09/10 15:26:32| httpAccept: FD 26: accept failure: (53) Software caused con nection abort

We set
kern.ipc.somaxconn: 16384
 
we found out
su - squid -c ulimit -n was 8192 we recompiled squid and increased to 32768

Everything worked fine for 24 hours, now we are back to the very first problem

system just goes off the network, no ping
idnsSendQuery: FD 6: sendto: (55) No buffer space available
comm_udp_sendto: FD 6, 217.21.5.35, port 53: (55) No buffer space available
it is not only UDP, to bring the machine up again we have to shut down the network and bring up again

Any other suggestions
0
Comment
Question by:ahmedfpis
4 Comments
 

Author Comment

by:ahmedfpis
ID: 12043079
cache1# top
last pid:  2076;  load averages:  1.11,  1.07,  1.02    up 0+23:47:47  16:05:20
28 processes:  2 running, 26 sleeping
CPU states: 30.0% user,  0.0% nice, 62.2% system,  3.3% interrupt,  4.5% idle
Mem: 761M Active, 200M Inact, 349M Wired, 694M Cache, 255M Buf, 3052K Free
Swap: 4096M Total, 14M Used, 4082M Free

  PID USERNAME PRI NICE  SIZE    RES STATE  C   TIME   WCPU    CPU COMMAND
  361 squid     58   0   755M   745M CPU1   1  18.6H 96.68% 96.68% squid
  162 root       2   0  3716K   924K select 1  16:50 21.29% 21.29% snmpd
 2073 root      28   0  1900K   988K CPU0   1   0:01  2.78%  1.86% top
  265 root       2   0 16572K 14288K select 0  11:57  0.59%  0.59% named
  368 squid     -4   0  1904K   576K msgwai 0   3:05  0.00%  0.00% diskd
  365 squid     -4   0  1904K   572K msgwai 1   3:00  0.00%  0.00% diskd
  366 squid     -4   0  1904K   576K msgwai 1   2:58  0.00%  0.00% diskd
  367 squid     -4   0  1904K   560K msgwai 1   2:57  0.00%  0.00% diskd
  363 squid     -4   0  1904K   576K msgwai 0   2:48  0.00%  0.00% diskd
  364 squid     -4   0  1904K   548K msgwai 1   2:47  0.00%  0.00% diskd
  156 root       2   0  4072K   624K select 1   0:05  0.00%  0.00% httpd
  119 root       2   0   984K   284K select 0   0:00  0.00%  0.00% syslogd
  127 root      10   0  1024K   256K nanslp 0   0:00  0.00%  0.00% cron
 2045 root       2   0  2428K  1172K select 1   0:00  0.00%  0.00% sshd2
  225 root       3   0  1384K     0K ttyin  0   0:00  0.00%  0.00% <csh>
  185 root       2   0  2284K     0K select 0   0:00  0.00%  0.00% <sshd2>
0
 
LVL 61

Accepted Solution

by:
gheist earned 500 total points
ID: 12155978
Use local named as cache, not external nameservers. This will meke name lookups quicker with less buffer space eaten.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now