LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-04-2010, 05:55 PM   #1
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Rep: Reputation: 30
improving squid proxy performance


I am starting to get bottlenecks in the loading of webpages via squid.
It is not the actual playback of video that has performance issues, this is very good. However, when a webpage is first requested, it is the initial response that takes more than a few seconds to load the page.
I am wondering how to troubleshoot the issue as I don't know whether it is squid, the dns lookup, the number of users, RAM, or the bandwidth. Bandwidth seems to be the least likely since the server has a high bandwidth and video streaming appears to have no problems.
I do not have caching turned on yet, which would certainly help because I do not want to cache flb, mp3, etc. files and the last time I turned on caching the performance was actually worse. The slow loading of pages has only just beguin to creep into the performance, it wasn't an issue before.

Last edited by qwertyjjj; 02-04-2010 at 05:57 PM.
 
Old 02-05-2010, 03:44 PM   #2
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by qwertyjjj View Post
when a webpage is first requested, it is the initial response that takes more than a few seconds to load the page.
I don't know the best way to confirm this, but that does sound like DNS. Have you tried using dig to examine the time that a lookup takes? And whether the first lookup is rather long compared to subsequent ones. (Are you just using the standard stub resolver (is the first server slow?) or do you have a cache?)

Mind you, you can get exactly the same effect by having a non-used IPV6 service in first and always waiting for that to time out before doing anything useful.

... RAM ...

That won't be the problem if no swapping is going on, so may be easy to eliminate.

Quote:
I do not have caching turned on yet, which would certainly help because I do not want to cache flb, mp3, etc. files
when you get there, you might want to look at this.
 
Old 02-06-2010, 07:12 PM   #3
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Original Poster
Rep: Reputation: 30
Didn't seem to make much difference:
Quote:
[root@s~]# dig www.skyplayer.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.2 <<>> www.skyplayer.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11343
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.skyplayer.com. IN A

;; ANSWER SECTION:
www.skyplayer.com. 86400 IN CNAME redirect.sky.com.
redirect.sky.com. 300 IN A 80.238.9.232

;; Query time: 69 msec
;; SERVER: 213.171.192.249#53(213.171.192.249)
;; WHEN: Sun Feb 7 01:09:43 2010
;; MSG SIZE rcvd: 78

[root@ser]# dig www.skyplayer.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.2 <<>> www.skyplayer.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41606
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.skyplayer.com. IN A

;; ANSWER SECTION:
www.skyplayer.com. 86400 IN CNAME redirect.sky.com.
redirect.sky.com. 300 IN A 80.238.9.232

;; Query time: 92 msec
;; SERVER: 213.171.192.249#53(213.171.192.249)
;; WHEN: Sun Feb 7 01:10:36 2010
;; MSG SIZE rcvd: 78

Could I add openDNS to squid somehow to improve the p[rocess?
At the moment I am restarting nscd every 6 hrs in case something happens - I'm sure this disconnects a few users.
I also have BIND on my server.

Not sure what the standard stub resolver is. I thought the cache was handled by nscd?

Last edited by qwertyjjj; 02-07-2010 at 12:21 PM.
 
Old 02-07-2010, 02:20 PM   #4
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by qwertyjjj View Post
Not sure what the standard stub resolver is. I thought the cache was handled by nscd?
the standard stub resolver is the entry in resolv.conf that just says 'go to this other computer and that computer will get a name resolution for you'. The alternative is to be using something line BIND/DNSMASQ/DJBDNS/PDNSD as a caching nameserver.

Based on the evidence that you give, your lookups are not lightning fast, but then they are not disastrously slow, either (';; Query time: 69 msec', ';; Query time: 92 msec'). This probably isn't then the cause of this problem, and you'd want to do more testing, but the fact that the second resolve isn't a whole load faster than the first, and both are on the slow side, suggests that there is no local caching going on.

I'd guess you could get down to a half or a quarter of those figures with, eg, DNSMASQ/DJBDNS/... but as there is another problem, this isn't the place to start.

Quote:
Could I add openDNS to squid somehow to improve the p[rocess?
...not massively...a local cache (local to wherever squid runs) will be your best thing, and you can choose where to hook up your local cache. You can benchmark the external sources of lookups, but they often the top ones are quite similar, and it doesn't now look as if DNS is you biggest problem.

Does this problem exist when video streaming is not happening? It is possible that video streaming is eating all of the bandwidth.

The RAM/swapping issue ought to be easy to eliminate; check that there is no traffic to your swap when things are slow.

Then check that the memory usage of squid itself is sensible; is the video streaming using all of squid's memory allowances?
 
Old 02-07-2010, 02:48 PM   #5
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Original Poster
Rep: Reputation: 30
I have BIND running on the server but I turned nscd off since someone else said it made no apparent efficiency improvement. Worth noting that /etc/named.conf is just an empty file at present.
I added dns_nameserver and the opendns IP address to the squid.conf and restarted...no difference.
It is difficult to tell as there is always some video streaming happening on the site so I can't be 100% sure about an answer to this. However, I have much more bandwidth available than is being used as the server should have 100Mbit/s

How can I check the RAM/swap?
Squid mem usage is set to defaults in the squid.conf
I am trying to figure out how to use oprofile but no success yet...

These are the results from top:
Quote:
top - 21:11:17 up 2 days, 16:40, 2 users, load average: 0.00, 0.00, 0.00
Tasks: 128 total, 1 running, 127 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.2%us, 0.2%sy, 0.0%ni, 99.3%id, 0.0%wa, 0.0%hi, 0.3%si, 0.0%st
Mem: 950408k total, 935616k used, 14792k free, 228260k buffers
Swap: 522072k total, 156k used, 521916k free, 579656k cached
Quote:
Complete!
[root@]# vmstat 5
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 156 53016 229044 542224 0 0 11 20 91 17 0 1 99 0 0
0 0 156 53012 229056 542244 0 0 0 18 1050 226 0 0 100 0 0
0 0 156 53012 229064 542240 0 0 0 5 1064 224 0 0 100 0 0

Last edited by qwertyjjj; 02-07-2010 at 03:19 PM.
 
Old 02-07-2010, 05:45 PM   #6
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Original Poster
Rep: Reputation: 30
.....

Last edited by qwertyjjj; 02-07-2010 at 10:20 PM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using tmpFs is not improving performance souvikdatta Linux - General 12 10-16-2009 12:52 AM
Squid Proxy Performance sanketsharma LinuxQuestions.org Member Intro 1 08-28-2009 05:35 AM
Improving the performance !!! kshkid Programming 9 12-20-2006 12:23 PM
improving 3d performance ababkin Linux - Hardware 1 04-08-2004 11:33 PM
Improving hd performance psyklops Linux - General 2 08-21-2003 08:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration