LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   squid using 100 percent of processor (https://www.linuxquestions.org/questions/linux-software-2/squid-using-100-percent-of-processor-746610/)

ashfaq 08-10-2009 11:42 PM

squid using 100 percent of processor
 
HI...
i am squid on enterprise redhat linux (hp proliant 385 server) ... its working ok...
but when i give top command..
its shows:
99 or 100 percent usage of prcessor by the squid process..
what should i suppose to do..
pl help me out

centosboy 08-12-2009 08:44 AM

Quote:

Originally Posted by ashfaq (Post 3638682)
HI...
i am squid on enterprise redhat linux (hp proliant 385 server) ... its working ok...
but when i give top command..
its shows:
99 or 100 percent usage of prcessor by the squid process..
what should i suppose to do..
pl help me out

maybe your server does not have enough resources left for running squid?
maybe your config has become too large for processing with the available resources?

could be one of many things. would need much more info

ashfaq 08-12-2009 11:02 PM

Thanks for reply..
 
1 Attachment(s)
Thanks buddy..
i have checked the processor through top command :
result of top command is attached.. as gif file...
resources are available..
disk space is quite enough..its a proliant Hp 380 server.
space for cache is available in GBs.
size of log files are quite ok...
but running processor usage is almost 100 percent for squid...
although no problem significantly notices...except that some users are experiencing slow speed...
looking forward for your response..
thanks.

centosboy 08-13-2009 08:08 AM

Quote:

Originally Posted by ashfaq (Post 3641306)
Thanks buddy..
i have checked the processor through top command :
result of top command is attached.. as gif file...
resources are available..
disk space is quite enough..its a proliant Hp 380 server.
space for cache is available in GBs.
size of log files are quite ok...
but running processor usage is almost 100 percent for squid...
although no problem significantly notices...except that some users are experiencing slow speed...
looking forward for your response..
thanks.


from that screenshot i am seeing 21.8% user space.
Not as bad as you first made out. the squid process does seem a little hungry.
Load averages are pretty low.
You might need to tune squid a bit.
Check disk write io

Code:

iostat -x sda/hda 5

check for rrqm/s and wrqm/s in the output of iostat. Look for relatively small numbers here.

hdparm can also tell you at which speed the disk is writing if io problems

Code:

hdparm -t /dev/sda  or /dev/hda
run an strace against the squid pid to see wht it is doing

Code:

strace -p 11630
check your squid log too to see what it is doing.
Does look a bit strange as my squid server, although i have just fired it up to gauge how much resources it uses, it is nowhere near as long as yours - but like i said - i have just started it up....

you might need to graph the cpu/load over a period of time?
cacti or mrtg can easily do this for you.
you might want to monitor the cpu and load too with nagios or the like. at least when warnings flag up, you can dive straight on the server and have a look at what is going on..
but like i said, looking at the screenshot, i cant see anything drastic.
pretty low load averages and 21% cpu usage...not too bad considering squid is the only major thing running on this box

unSpawn 08-13-2009 09:13 AM

Quote:

Originally Posted by centosboy (Post 3641755)
check your squid log too to see what it is doing.

Considering low LA values and Squid's low mem + high CPU that would be the first thing I'd look at.


Quote:

Originally Posted by centosboy (Post 3641755)
you might need to graph the cpu/load over a period of time?
cacti or mrtg can easily do this for you.
you might want to monitor the cpu and load too with nagios or the like. at least when warnings flag up, you can dive straight on the server and have a look at what is going on..

Having to install Cacti or MRTG seems a bit overkill to me for just graphing CPU/IO where reasonably less complex alternatives like Atop, Dstat or collectl exist. Sure it comes at a price as they won't generate pretty pretty graphs but at least Dstat allows you to export CSV so you can import in OOo and graph to your hearts content. For monitoring I'd choose Monit since a "watch resource and alert by email" kind of task will be *way* easier to configure.

centosboy 08-13-2009 09:18 AM

Quote:

Originally Posted by unSpawn (Post 3641823)
Considering low LA values and Squid's low mem + high CPU that would be the first thing I'd look at.



Having to install Cacti or MRTG seems a bit overkill to me for just graphing CPU/IO where reasonably less complex alternatives like Atop, Dstat or collectl exist. Sure it comes at a price as they won't generate pretty pretty graphs but at least Dstat allows you to export CSV so you can import in OOo and graph to your hearts content. For monitoring I'd choose Monit since a "watch resource and alert by email" kind of task will be *way* easier to configure.

yeah true....in fact installing cacti wont help, cos that is a memory hog too

chrism01 08-13-2009 08:13 PM

You've got very low Load Averages (anything <1 is small) and the cpu itself is only at 21.8 %, again trivial.
Squid is using 89% of 21.8%, a small amt of total cpu.
Also, I note only 1 user logged in.
Implication is that this box is more or less dedicated to squid and coping easily. If your users are complaining, I'd check those complaints to see if they are real or perceived and whether you can reproduce them.
They may well be nothing to do with this box.
Maybe check network io load.

anomie 08-14-2009 12:13 AM

It looks like OP has a four-way CPU, which is why 21.8% total CPU is being shown used. I'm not sure I see a problem here.


All times are GMT -5. The time now is 12:37 AM.