Archive for April, 2009
Conclusion of Optimize Squid for Reverse Proxy
Conclusion of Optimize Squid for Reverse Proxy:
After having read and tested the guides from the articles, I got some tips on the topic:
1. recompile the squid if you can, tuning the compile parameters.
#ulimit -n8192 (system setting)
./configure … –with-filedescriptors=8192 …
of course the 8192 is just my parameters. if your hardware is more powerful, just increase it to handle more concurrence requests. the max is 65535
2. squid.conf
cache_mem = 70-90% physical memory #if your server just for squid
maximum_object_size 1024KB #we just cache some small things just as js/css/jpg/gif.
maximum_object_size_in_memory 1024KB
#aufs is for async-io, offload disk reads to a thread. big cache is always good.
cache_dir aufs /var/spool/squid 50000 16 256
#cache_dir ufs Directory-Name Mbytes L1 L2 [options] L1 means 16 subdirectories L2 means 256 subdirecotries. if you don’t have good reason, just leave it.
#don’t cache 404′s, always go to origin servers
negative_ttl 0 minutes
#ignore the store logs
cache_store_log none
half_closed_clients off
3. /var/spool/squid
set a individual partition for cache disk.
suggest to choose reiserfs file system.
mount -t defaults,noatime # esp noatime
Tips: write a shell into /etc/crontab
Tips: write a shell into /etc/crontab check the service automatically
#!/bin/bash
PORT=:80 #The port, the : makes it easy to snag only ports and not other numbers in the output.
INITS=httpd #The name of the service in /etc/init.d/
COUNT=$(netstat -lpn | grep $ | wc -l)
if [ $COUNT -lt 1 ]
then
/etc/init.d/$INITS start
fi
Q: when you umount /mnt/usb it shows: um…
Q: when you umount /mnt/usb it shows:
umount: /mnt/usb: device is busy
umount: /mnt/usb: device is busy
A: > lsof +D /mnt/usb
find the PID of using /mnt/usb, kill it or quit the application.
In the past time, I always used the CentOS
In the past time, I always used the CentOS. but after I used OpenSUSE just about a week. I found that the OpenSUSE is more friendly than CentOS.
I spent about 2 hours to settle lots of problems after I `yum install bind`
It don’t create named.conf and some need files. Faint !!
when I tried `sudo /etc/init.d/named start`
Locating /etc/named.conf failed: [FAILED]
what’s going on? I just
sudo cp /usr/share/doc/bind-9.3.4/sample/etc/named.conf /etc/
[edyliu@centos53-edy ~]$ sudo /etc/init.d/named startStarting named:
Error in named configuration:
/etc/named.conf:57: open: /etc/named.root.hints: file not found [FAILED]
Although I settled the problems after remove some samples and uneed things.
I still want to ask :
Why Can’t I start the service after It has been Installed successfully ?
But In OpenSUSE, it just works after the installation.
What happened to you, My CentOS/RHEL ? Are you trying to go away from my focus ?
Data from http://distrowatch.com/
1 Ubuntu 2373>
2 openSUSE 1562<
3 Mint 1458<
4 Fedora 1372>
5 Debian 1221<
6 Mandriva 959=
7 PCLinuxOS 920<
8 Puppy 726=
9 MEPIS 689<
10 CentOS 687<
Optimizing SQUID in Linux
Optimizing SQUID in Linux, although the 1st is very old, it still has some tips to learn.
http://www.linux-faqs.com/squid.php
http://2bits.com/articles/increasing-drupals-speed-squid-caching-reverse-proxy.html
http://hotops.blogspot.com/2007/06/high-performance-reverse-proxy-squid.html
Ulimit details. always in /etc/security/limits.conf at least in CentOS&OpenSuse
http://wiki.linuxquestions.org/wiki/Ulimit
I just try to rebuild the squid3 for ope…
I just try to rebuild the squid3 for opensuse, i changed the filedescriptor and threads
modified squid3.spec
edit the following line about line 273
export CFLAGS=”$RPM_OPT_FLAGS -DNUMTHREADS=32 -fPIE -fPIC -fno-strict-aliasing”
and the following line on line 315
–with-filedescriptors=8192
Install Requires Packages:
sudo zypper install krb5-devel libxml2-devel openldap2-devel opensp-devel pam-devel db-devel
patch autoreconf make libexpat-devel libtool
Today, I reopen www.enlamp.cn
Today, I reopen www.enlamp.cn with the help of Master XiaoDian.
May him live long.
Thank you for your drop by. and see you next time.
Great_Linux_Links as the file name
Great_Linux_Links as the file name, there is lot of useful link about Linux
http://www.brunolinux.com/10-General_Info/Great_Linux_Links.html
Tips on Linux ( lots of tips, can be helpful in learning Linux)
http://www.brunolinux.com/
Subversion版本控制,svn命令速查…
Subversion版本控制,svn命令速查手册
http://www.yolinux.com/TUTORIALS/Subversion.html