Posts Tagged server
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
Apache之suExec
Apache的suExec可以通过切换用户来提高一些应用的安全系数
今天配置的时候出现下列错误
“Internal Server Error”
检查日志
(13)Permission denied: exec of ‘/usr/sbin/suexec’ failed
[Mon Mar 02 13:35:55 2009] [error] [client myip] Premature end of script headers: index.cgi
Read the rest of this entry »
Linux-Vserver安装笔记
http://linux-vserver.org/ 官方网站
具体不同系统的安装方法:
http://linux-vserver.org/Documentation
这里我在CentOS 5.1上安装
http://linux-vserver.org/Installation_on_CentOS
过程:
1、vi /etc/yum.repos.d/dhozac-vserver.repo
内容
Read the rest of this entry »
关于服务器虚拟化技术
晚上看了一些关于虚拟化的东西,下面是一个研究报告
http://www.enlamp.cn/book/vt_study.pdf
http://en.wikipedia.org/wiki/Comparison_of_platform_virtual_machines
提到了Linux Vserver,以前记得也看过。但是没有做过实验。
今天又看了一下它官方网站。
http://linux-vserver.org
装了一下,很顺利。因为在我这台服务上装的,没有重启。呵呵
http://linux-vserver.org/Installation_on_CentOS
装完了,添加了一个新的内核。
title CentOS (2.6.22.19-vs2.3.0.34.1)
root (hd0,6)
kernel /boot/vmlinuz-2.6.22.19-vs2.3.0.34.1 ro root=LABEL=/
initrd /boot/initrd-2.6.22.19-vs2.3.0.34.1.img
貌似它的GuestOS安装起来和Openvz/Proxmox不太一样,有空实验一下。
Proxmox虚拟技术的选择
用过Vmware,Openvz. 个人是偏向Openvz的。
今天看到一个更好的Proxmox,感觉它结合了Openvz的优点,
并且还有了Openvz不具备的东西,就是你可以自己安装Guest OS了。
怎么感觉有点像广告啊,闲话不多说了。开工
系统需求: 64bit,如果要支持自己安装GuestOS,那么CPU需要支持Inter VT/AMD V技术
我的测试机器是CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 5200+ RAM: 1G
千万注意:Proxmox是需要一个干净的系统的,如果不干净它会把你的系统删
光光的,所以一定要是测试机器,切记!!!
Read the rest of this entry »
优化Apache
硬件上的优化就不用说,花银子买了。呵呵
软件上的说一下吧
系统级别上:
1. 关掉不需要的服务,一方面是安全,还就是优化了。
2. 保持软件更新,也是安全和优化方面的事。
vi /etc/sysctl.conf
# Use TCP syncookies when needed
net.ipv4.tcp_syncookies = 1
# Enable TCP window scaling
net.ipv4.tcp_window_scaling = 1
# Increase TCP max buffer size
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
# Increase Linux autotuning TCP buffer limits
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
# Increase number of ports available
net.ipv4.ip_local_port_range = 1024 65000 Read the rest of this entry »