<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-7047093</id><updated>2009-03-01T02:57:41.574-08:00</updated><title type='text'>Simple is Best</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://devil4heaven.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default'/><link rel='alternate' type='text/html' href='http://devil4heaven.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>devil4heaven</name><uri>http://www.blogger.com/profile/10045664492964436386</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7047093.post-2351877753265243452</id><published>2008-04-18T02:19:00.001-07:00</published><updated>2008-04-25T02:46:12.631-07:00</updated><title type='text'>voip beginning</title><content type='html'>A new telphone system based on voip two weeks ago, the TARGET is a low-cose call center on voip system link with pstn like 800 or 400 hotline.&lt;br /&gt;I need to choose the voip server, client, pstn gateway and ata etc, it's boring but very challengingly, i like it:)&lt;br /&gt;&lt;br /&gt;voip protocol:&lt;br /&gt;h323(old man?), sip(common use but nat problem?), iax2(asterisk support, other supported server?),mgcp etc&lt;br /&gt;&lt;br /&gt;voip server software:&lt;br /&gt;asterisk(support sip,iax2,conditional h323), gnukeeper(support h323),&lt;br /&gt;voip protocol, ser, sipx, trixbox(based on asterisk), callweaver  etc, many servers but we need only one,&lt;br /&gt;&lt;br /&gt;voip client:&lt;br /&gt;softphone iax2 client(zoiper?), sip client(x-lite xten?), but the h323 client?, cisco hardphone?&lt;br /&gt;&lt;br /&gt;voip pstn linker:&lt;br /&gt;voip gateway, Digium pci card&lt;br /&gt;&lt;br /&gt;voip hareware:&lt;br /&gt;one Dell poweredge 1425 enough? or another application pc server?&lt;br /&gt;&lt;br /&gt;then the other problem, performance and the stability and the expandability and the last one: COST&lt;br /&gt;&lt;br /&gt;total is a long way,  but i am on the way:)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7047093-2351877753265243452?l=devil4heaven.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devil4heaven.blogspot.com/feeds/2351877753265243452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7047093&amp;postID=2351877753265243452' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/2351877753265243452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/2351877753265243452'/><link rel='alternate' type='text/html' href='http://devil4heaven.blogspot.com/2008/04/voip-beginning.html' title='voip beginning'/><author><name>devil4heaven</name><uri>http://www.blogger.com/profile/10045664492964436386</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10586956192566421090'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7047093.post-4276289724194330024</id><published>2008-03-19T02:33:00.000-07:00</published><updated>2008-04-18T02:18:09.856-07:00</updated><title type='text'>don't use reverse proxy before mod_deflate/gzip armed web server</title><content type='html'>don't use squid as reverse proxy(like squid) before a mod_deflate/mod_gzip apache/lighty/web server, especial for dynamtic pages, otherwise the reverse proxy cached page will be special linked  to only one client(because of ziped page contain http cookie ?), thus the efficiency of the proxy will become terrible and the load of the behind server will increase a lot(depend on cached your pages and vistors).&lt;br /&gt;deep in finding a solution.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7047093-4276289724194330024?l=devil4heaven.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devil4heaven.blogspot.com/feeds/4276289724194330024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7047093&amp;postID=4276289724194330024' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/4276289724194330024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/4276289724194330024'/><link rel='alternate' type='text/html' href='http://devil4heaven.blogspot.com/2008/03/dont-use-reverse-proxy-before.html' title='don&apos;t use reverse proxy before mod_deflate/gzip armed web server'/><author><name>devil4heaven</name><uri>http://www.blogger.com/profile/10045664492964436386</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10586956192566421090'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7047093.post-1720428583792145946</id><published>2008-03-11T00:57:00.000-07:00</published><updated>2008-03-11T01:28:58.502-07:00</updated><title type='text'>reverse proxy with squid 2.6</title><content type='html'>upgrade from squid 2.5 to 2.6 because of the new epoll support under linux kernel 2.6, but the  most import reason is squid 2.6 now support ssl communcation between cache server and web server, which is NOT support in squid 2.5 version.&lt;br /&gt;like 2.5, before compile 2.6 u should check max file descriptor and install openssl, then compile and install like below&lt;br /&gt;&lt;br /&gt;&lt;span&gt;./configure --prefix=/opt/squid2.6 --enable-large-cache-files --with-large-files --with-aufs-threads=3 --with-pthreads --with-aio --enable-storeio=diskd,ufs,aufs --enable-ssl --with-openssl=/opt/openssl&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;the squid config file is changed too much from version 2.5, the new reverse proxy config file like below, enable ssl support and no longer need the custom log patch:&lt;br /&gt;&lt;br /&gt;&lt;span&gt;http_port 80 accel defaultsite=www.yourdomain.com vhost protocol=http&lt;br /&gt;https_port 443 accel defaultsite=www.yourdomain.com cert=/etc/ssl/cacert.pem key=/etc/ssl/privkey.pem&lt;br /&gt;vhost protocol=https&lt;br /&gt;ssl_unclean_shutdown on&lt;br /&gt;sslproxy_flags DONT_VERIFY_PEER&lt;br /&gt;&lt;br /&gt;cache_peer 123.123.123.123 parent 443 0 no-query originserver name=server_www1 ssl sslflags=DONT_VERIFY_PEER&lt;br /&gt;&lt;br /&gt;cache_peer_domain server_www1 www.youdomain.com others.yourdomain.com&lt;br /&gt;&lt;br /&gt;hierarchy_stoplist cgi-bin ?&lt;br /&gt;&lt;br /&gt;acl apache rep_header Server ^Apache&lt;br /&gt;broken_vary_encoding allow apache&lt;br /&gt;&lt;br /&gt;cache_mem 256 MB&lt;br /&gt;cache_dir diskd /opt/cachedir_2.6 4000 64 256&lt;br /&gt;&lt;br /&gt;logformat combined %&gt;a %ui %un [%{%d/%b/%Y:%H:%M:%S +0000}tl] "%rm %ru HTTP/%rv" %Hs %&lt;st&gt;h" "%{User-Agent}&gt;h"&lt;br /&gt;access_log /opt/squid2.6/var/logs/access.log squid&lt;br /&gt;cache_log /opt/squid2.6/var/logs/cache.log&lt;br /&gt;cache_store_log none&lt;br /&gt;&lt;br /&gt;hosts_file /etc/hosts&lt;br /&gt;&lt;br /&gt;refresh_pattern -i .jsp 360 25% 720 override-expire ignore-reload&lt;br /&gt;refresh_pattern -i .php 360 20% 720 override-expire ignore-reload&lt;br /&gt;refresh_pattern -i .htm 360 25% 720 override-expire ignore-reload&lt;br /&gt;refresh_pattern -i .html 360 25% 720 override-expire ignore-reload&lt;br /&gt;refresh_pattern -i .js 360 25% 720 override-expire ignore-reload&lt;br /&gt;&lt;br /&gt;acl manager proto cache_object&lt;br /&gt;acl localhost src 127.0.0.1/255.255.255.255&lt;br /&gt;acl to_localhost dst 127.0.0.0/8&lt;br /&gt;acl SSL_ports port 443&lt;br /&gt;acl CONNECT method CONNECT&lt;br /&gt;&lt;br /&gt;http_access allow manager localhost&lt;br /&gt;http_access deny manager&lt;br /&gt;http_access deny !Safe_ports&lt;br /&gt;http_access deny CONNECT !SSL_ports&lt;br /&gt;&lt;br /&gt;acl webserver_networks src 123.123.213.64/24&lt;br /&gt;http_access allow webserver_networks&lt;br /&gt;&lt;br /&gt;acl www1 dstdomain www.yourdomain.com youdomain.net&lt;br /&gt;http_access allow www1&lt;br /&gt;&lt;br /&gt;acl PURGE method PURGE&lt;br /&gt;acl me src 127.0.0.1&lt;br /&gt;http_access allow PURGE me&lt;br /&gt;http_access deny PURGE&lt;br /&gt;http_access deny all&lt;br /&gt;icp_access allow all&lt;br /&gt;&lt;br /&gt;cache_mgr admin@yourdomain.com&lt;br /&gt;visible_hostname squid.yourdomain.com&lt;br /&gt;&lt;br /&gt;client_persistent_connections off&lt;br /&gt;server_persistent_connections off&lt;br /&gt;&lt;br /&gt;coredump_dir /opt/squid2.6/var/cache&lt;span br=""&gt;&lt;br /&gt;when compile with openssl under centos4/rhel4, a known issue if OpenSSL is compiled as a static library will raise, and make will failed, resolve is so simple. after running squid configure, manually edit src/Makefile and add -ldl after -lcrypto, then make&amp;amp; make install will be ok.&lt;br /&gt;the new config file is simple different from the old complex 2.5 version config,  the performance will increase about 20-30% in our test when compile it with epoll under high concurrent speed. but the stability is need  more  firm, we encountered a ssl leak bug in early version, so often watch the new version changelog to resolve your problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7047093-1720428583792145946?l=devil4heaven.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devil4heaven.blogspot.com/feeds/1720428583792145946/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7047093&amp;postID=1720428583792145946' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/1720428583792145946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/1720428583792145946'/><link rel='alternate' type='text/html' href='http://devil4heaven.blogspot.com/2008/03/reverse-proxy-with-squid-26.html' title='reverse proxy with squid 2.6'/><author><name>devil4heaven</name><uri>http://www.blogger.com/profile/10045664492964436386</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10586956192566421090'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7047093.post-8841915450112619742</id><published>2008-03-11T00:14:00.000-07:00</published><updated>2008-03-11T00:55:03.885-07:00</updated><title type='text'>reverse proxy with squid 2.5</title><content type='html'>old document about 3 years ago&lt;br /&gt;using reverse proxy to increase customer visit speed, concurrent performance  etc,we use squid cluster  to cache our dynamic jsp file before our web server cluster.&lt;br /&gt;&lt;br /&gt;first compile with gcc under linux, without openssl, if u want,pls compile with the -with-openssl option,then make&amp;amp;make install&lt;br /&gt;&lt;br /&gt;&lt;span&gt;./configure --prefix=/opt/squid --disable-internal-dns --enable-async-io --enable-storeio=diskd,ufs --enable-removal-policies --e&lt;br /&gt;nable-cache-digests --enable-poll --enable-gnuregex&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;edit the default squid.conf, open HTTPD-ACCELERATOR OPTIONS and others like http_port, our simple config file below:&lt;br /&gt;&lt;br /&gt;&lt;span&gt;http_port 80&lt;br /&gt;#https_port 443 cert=/etc/ssl/cacert.pem key=/etc/ssl/privkey.pem&lt;br /&gt;icp_port 0&lt;br /&gt;hierarchy_stoplist cgi-bin ?&lt;br /&gt;cache_mem 128 MB&lt;br /&gt;cache_swap_low 90&lt;br /&gt;cache_swap_high 95&lt;br /&gt;maximum_object_size 6144 KB&lt;br /&gt;maximum_object_size_in_memory 512 KB&lt;br /&gt;ipcache_size 2048&lt;br /&gt;fqdncache_size 2048&lt;br /&gt;cache_replacement_policy heap GDSF&lt;br /&gt;memory_replacement_policy heap LRU&lt;br /&gt;cache_dir diskd /opt/cachedir 2048 32 256&lt;br /&gt;#cache_access_log /opt/squid/var/logs/access.log&lt;br /&gt;logformat combined %&gt;a %ui %un [%{%d/%b/%Y:%H:%M:%S +0000}tl] "%rm %ru HTTP/%rv" %Hs %h" "%{User-Agent}&gt;h"&lt;br /&gt;cache_access_log /opt/squid/var/logs/access.log combined&lt;br /&gt;cache_log /opt/squid/var/logs/cache.log&lt;br /&gt;cache_store_log none&lt;br /&gt;emulate_httpd_log on&lt;br /&gt;debug_options ALL,1&lt;br /&gt;dns_children 32&lt;br /&gt;hosts_file /etc/hosts&lt;br /&gt;redirect_children 50&lt;br /&gt;redirect_rewrites_host_header off&lt;br /&gt;&lt;br /&gt;auth_param basic children 50&lt;br /&gt;auth_param basic realm Squid proxy-caching web server&lt;br /&gt;auth_param basic credentialsttl 2 hours&lt;br /&gt;&lt;br /&gt;refresh_pattern -i .jsp 360 25% 720 override-expire ignore-reload&lt;br /&gt;refresh_pattern -i .php 360 20% 720 override-expire ignore-reload&lt;br /&gt;refresh_pattern -i .htm 360 25% 720 override-expire ignore-reload&lt;br /&gt;refresh_pattern -i .html 360 25% 720 override-expire ignore-reload&lt;br /&gt;refresh_pattern -i .js 360 25% 720 override-expire ignore-reload&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;connect_timeout 2 minute&lt;br /&gt;peer_connect_timeout 60 seconds&lt;br /&gt;read_timeout 10 minutes&lt;br /&gt;request_timeout 60 seconds&lt;br /&gt;persistent_request_timeout 60 seconds&lt;br /&gt;client_lifetime 10 minutes&lt;br /&gt;half_closed_clients off&lt;br /&gt;pconn_timeout 1 seconds&lt;br /&gt;ident_timeout 5 seconds&lt;br /&gt;shutdown_lifetime 45 seconds&lt;br /&gt;&lt;br /&gt;acl all src 0.0.0.0/0.0.0.0&lt;br /&gt;acl manager proto cache_object&lt;br /&gt;acl localhost src 127.0.0.1/255.255.255.255&lt;br /&gt;acl to_localhost dst 127.0.0.0/8&lt;br /&gt;acl trust_group 123.123.123.0/255.255.255.0&lt;br /&gt;acl SSL_ports port 443 563i&lt;br /&gt;acl CONNECT method CONNECT&lt;br /&gt;acl PURGE method PURGE&lt;br /&gt;acl Safe_ports port 80 # http&lt;br /&gt;acl Safe_ports port 443 563 # https, snews&lt;br /&gt;acl PURGE method PURGE&lt;br /&gt;&lt;br /&gt;http_access allow PURGE localhost&lt;br /&gt;http_access deny PURGE&lt;br /&gt;http_access allow manager localhost&lt;br /&gt;http_access deny manager&lt;br /&gt;http_access deny !Safe_ports&lt;br /&gt;http_access deny CONNECT !SSL_ports&lt;br /&gt;&lt;br /&gt;http_access allow trust_group&lt;br /&gt;&lt;br /&gt;http_access deny all&lt;br /&gt;http_reply_access allow all&lt;br /&gt;icp_access allow all&lt;br /&gt;&lt;br /&gt;cache_mgr admin@youdomain.com&lt;br /&gt;visible_hostname squid.youdomain.com&lt;br /&gt;&lt;br /&gt;httpd_accel_port 80&lt;br /&gt;httpd_accel_host 222.60.80.65&lt;br /&gt;httpd_accel_single_host off&lt;br /&gt;httpd_accel_with_proxy off&lt;br /&gt;httpd_accel_uses_host_header on&lt;br /&gt;&lt;br /&gt;memory_pools off&lt;br /&gt;memory_pools_limit 100 MB&lt;br /&gt;&lt;br /&gt;coredump_dir /opt/squid/var/cache&lt;br /&gt;ie_refresh off&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;in the config file, i patched squid 2.5 with the customlog patch from squid-cache.org, using refresh_pattern   to force squid cache the jsp/php file and ie_fresh to anti the F5 fresh under ms ie  and open the ssl port as u wish etc.ps:  increase  system file-max parameters to anti squid  run out of filedescriptor(squid max use 32768,suggest to change file-max more than it), otherwise in high traffic squid will run out of file descrptor and response slow and slow.&lt;br /&gt;the last thing is the /etc/hosts file, edit it to  add the reverse cache domain name and  ip address which resolve to the behind web server. DON'T use the outside name server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7047093-8841915450112619742?l=devil4heaven.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devil4heaven.blogspot.com/feeds/8841915450112619742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7047093&amp;postID=8841915450112619742' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/8841915450112619742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/8841915450112619742'/><link rel='alternate' type='text/html' href='http://devil4heaven.blogspot.com/2008/03/reverse-proxy-with-squid-25.html' title='reverse proxy with squid 2.5'/><author><name>devil4heaven</name><uri>http://www.blogger.com/profile/10045664492964436386</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10586956192566421090'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7047093.post-3150016102105097701</id><published>2008-03-07T00:14:00.000-08:00</published><updated>2008-03-07T01:03:01.126-08:00</updated><title type='text'>mysql's stability with glibc2.3(nptl)</title><content type='html'>one week ago, the user trace table in our mysql database reached about 2,00,000,000 rows, it used about 40G tablespace,&lt;br /&gt;but works great without any crash last 24 months after last change.&lt;br /&gt;we are using innodb engine on old mysql4.0.x version(self compiled) with rhel3/4,it began at 2005,which migrated from mysql4/rhas2.1 to mysql4/rhel3.&lt;br /&gt;but after the upgrade,the db often crashed  and the log only gave me an innodb internal error. i try to upgrad mysql to mysql4.0.27 and it still happened,  checked INSTALL-SOURCE from mysql.tar.gz,nothing wrong,but can't resolve the crash.&lt;br /&gt;we used the compile  in INSTALL-SOURCE like below&lt;br /&gt;&lt;span&gt;&lt;i&gt; ./configure \&lt;br /&gt;        --prefix=/opt/mysql --enable-assembler \&lt;br /&gt;        --with-mysqld-ldflags=-all-static&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;but recompile can't reslove the crash, after about two days search, finally found mysqld manual compile like below works unstable with  new glibc2.3  from rhel3 which began support nptl .&lt;br /&gt;the solution is sample, compile the mysql without the ldflags all-static mark,  compile like below:&lt;br /&gt;&lt;i&gt;&lt;span&gt;./configure --prefix=/opt/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --enable-assembler --without-debug&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;after this compile, the innodb engine  works perfect with nptl from glibc2.3, the reason maybe glibc2.3's backward compatibility for LinuxThreads.&lt;br /&gt;Maybe it's time for mysql.tar.gz update the INSTALL-SOURCE txt:)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7047093-3150016102105097701?l=devil4heaven.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devil4heaven.blogspot.com/feeds/3150016102105097701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7047093&amp;postID=3150016102105097701' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/3150016102105097701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/3150016102105097701'/><link rel='alternate' type='text/html' href='http://devil4heaven.blogspot.com/2008/03/mysqls-stability-with-glibc23nptl.html' title='mysql&apos;s stability with glibc2.3(nptl)'/><author><name>devil4heaven</name><uri>http://www.blogger.com/profile/10045664492964436386</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10586956192566421090'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7047093.post-8477810738998049280</id><published>2008-03-06T00:52:00.000-08:00</published><updated>2008-03-06T01:31:18.315-08:00</updated><title type='text'>special linux kernel shmall adjustment on x86_64 oracle9i/rhas4 system with more than 8G memory</title><content type='html'>About two months ago, we changed our database server from five years old IBM x360 to a new Dell poweredge 6850 with four dual-kernel xeon and 32 G memory  and raid5 array. Because we encountered the x86_32 memory limit and the x360 is too old for it's stability. &lt;br /&gt;So we changed from x86_32 to x86_64. the operation system migrated from rhas3 to rhas4(we even used rhas2.1 about  seven years ago) x86_64 version, and database still using the Oracle 9i(9208) x86_64, and the not to upgrade to Oracle 10G because our old running applications based on oracle old rbo NOT new cbl. &lt;br /&gt;After the successfull os/database install, i setup the kernel  shmmax to 30G, Oracle started successful with default 2G sga, then i changed    sga to 26G memory for better performance ,but when  startup oracle under sqlplus, it gived me  a strange ora-27102  error.&lt;br /&gt;i checked the kernel shmmni,shmall,sem and file-max parameters etc again,nothing goes wrong,strange, except the ora-27102. &lt;br /&gt;after many hours search, the reason raised from deep water. the DEFAULT shmall is 219702 under rhas4, so the system max use memory is 219702*PAGE_SIZE(default 4096)=8G, so when the oracle try to use more than 8G memory, kernel can't permit do this,  error ora-21702 then come.&lt;br /&gt;The resolve is sample, changed shmall to 32212254720(30G) under /etc/sysctl.conf, reboot system or /sbin/sysctl -p to let kernel accpet the new setting, then successed to startup oracle with 26G memory.&lt;br /&gt;It's the sample but boring shmall parameter under  rhel4 x86_64 kernel.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7047093-8477810738998049280?l=devil4heaven.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devil4heaven.blogspot.com/feeds/8477810738998049280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7047093&amp;postID=8477810738998049280' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/8477810738998049280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/8477810738998049280'/><link rel='alternate' type='text/html' href='http://devil4heaven.blogspot.com/2008/03/special-linux-kernel-shmall-adjustment.html' title='special linux kernel shmall adjustment on x86_64 oracle9i/rhas4 system with more than 8G memory'/><author><name>devil4heaven</name><uri>http://www.blogger.com/profile/10045664492964436386</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10586956192566421090'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7047093.post-115028036200745513</id><published>2006-06-14T03:14:00.000-07:00</published><updated>2006-06-14T03:36:05.556-07:00</updated><title type='text'>linux完整web邮件系统的架设</title><content type='html'>正好最近需要把原来架设的web mail系统整体转移，顺便把原来放了N久的文档补齐吧:p..目的是为用户提供web方式的邮件系统，注意，只有web方式，不提供pop3等等方式，要求系统良好的扩展性以及相应的安全（防病毒、垃圾邮件）等等。&lt;br /&gt;系统中apache+php+hivemail来提供web访问，hivemail通过pipe gateway默认于mta连接，&lt;br /&gt;整个邮件系统涉及：&lt;br /&gt;1.linux rhas3&lt;br /&gt;2.mta postfix&lt;br /&gt;3.database mysql&lt;br /&gt;4.webmail apache+php+hivemail&lt;br /&gt;5.anti-virus,anti-spam f-secure internet gatekeeper&lt;br /&gt;&lt;br /&gt;A。操作系统，linux，习惯了rhas3 当然debain、suse等都可以，安装过程忽略。推荐使用较大的硬盘，大用户量下还是感觉mail放在硬盘上比放在mysql数据库里性能要好的多，硬盘大小根据你的用户量以及邮箱容量计算。 注意因为偶是采用的硬盘目录存储邮件，ext3文件系统存在单一目录下子目录不能超过32k的限制，推荐使用reiserfs文件系统。&lt;br /&gt;B。postfix配置 而不是sendmail，可以使用rhas3自带的，也可以手工编译，偶是懒人，直接使用了rhas3自带的postfix，需要编辑更改一下main.cf以及alias文件main.cf需要更改myhostname、mydomain、myorigin、inet_interfaces、mydestination、mynetworks、relay_domains等等，整个相当于postfix作为mta开始对外使用，注意不要打开open relay针对我们的web系统，需要优化一下postfix，例如maximal_queue_lifetime、smtpd_timeout减小之类以避免影响性能最终需要配置main.cf，这个是使用pipe-gateway方式来连接hivemail，注意一下两项都需要&lt;br /&gt;luser_relay = hivemail&lt;br /&gt;local_recipient_maps =&lt;br /&gt;这个是保证postfix把接受的邮件转移个hivemail用户，当然需要在alias文件里添加用户如下&lt;br /&gt;hivemail: /opt/php/bin/hivemail_process.php&lt;br /&gt;然后更新一下aliases.db# postalias aliases最后重启一下postfix服务，看看postfix是不是配置正确。&lt;br /&gt;C。Mysql编译&lt;br /&gt;偶不喜欢rh自带的mysql，使用的是mysql4.0.27源码编译的，参数如下&lt;br /&gt;./configure --prefix=/resource/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --enable-assembler --disable-shared --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --without-debug&lt;br /&gt;make &amp; make install&lt;br /&gt;然后参照INSTALL-SOURCE完成数据库安装，具体请查看INSTALL-SOURCE内容，配置/etc/my.cnf等等，包括需要的表类型、数据库引擎类型等等。 最终需要创建我们需要的数据库跟用户&lt;br /&gt;mysql&gt;create database hivemail;&lt;br /&gt;mysql&gt;grant all on hivemail.* to &lt;a href="mailto:"&gt;'user'@'%'&lt;/a&gt; identified by 'pwd';&lt;br /&gt;注意这里我们user用户是可以在任何地点连接的，需要通过防火墙阻止非信任ip对mysql 3306端口的访问。&lt;br /&gt;D。apache＋php＋hivemail编译安装&lt;br /&gt;注意这里没有使用lighty或者zeus，zeus4.2完全可以使用hivemail，只要正确配置的fastcgi，但lighty＋fastcgi＋php方式却不能正常使用hivemail，怀疑某个变量没有被传输过来，偶没有时间来继续做测试，有兴趣的可以测试一下。&lt;br /&gt;apache2编译安装，偶需要对apache加装mod_evasive、mod_security、ssl等等，所以编译比较繁琐，正常情况下简化即可&lt;br /&gt;./configure --prefix=/opt/apache2 --enable-so --enable-rewrite --enable-forward --enable-deflate --enable-headers --enable-ssl --with-ssl=/opt/openssl&lt;br /&gt;make &amp; make install&lt;br /&gt;php编译安装，主要是--with-apxs2参数编译mod_php，参数如下，偶打开了fastcgi&lt;br /&gt;./configure --prefix=/opt/php --enable-fastcgi --enable-force-cgi-redirect --with-config-file-path=/etc --with-zlib --with-mysql=/resource/mysql --with-xml --with-mysql-sock=/tmp/mysql.sock --enable-discard-path --with-apxs2=/opt/apache2/bin/apxs&lt;br /&gt;make &amp;amp; make install&lt;br /&gt;如果需要增加其它例如ecacceleator、zend optimizer之类的，请自己手动安装一提高php执行性能。&lt;br /&gt;hivemail安装，这里我们是使用pipe gateway方式来连接postfix，偶这里是hivemail1.2.2，没有采用最新的hivemail1.3，因为偶改了N多东西，所以一直没有升级。&lt;br /&gt;ⅰ。hivemail web安装很简单，仔细看INSTALL安装文件，需要把upload ftp到服务器上，然后修改upload/include/config.php，正确设置mysql连接，然后通过web访问upload/install/index.php通过web一路next即可。&lt;br /&gt;注意这里有个sql_install.php，实际上就是它创建的hivemail各项使用表，默认的为myisam表格式，偶喜欢innodb，所以通过更改sql_install.php，直接创建为innodb表。&lt;br /&gt;2。pipe gateway连接mta，需要把hivemail_process.php上传到我们的php执行路径下，编辑一下hivemail_process.php设置正确的各个路径，包括php路径，hivemail安装目录等等，最后chmod +x hivemail_process.php。&lt;br /&gt;3.使用你创建的admin登陆，然后更改存储方式为storage method，即硬盘存储邮件方式，以减轻大用户量下mysql的压力。&lt;br /&gt;E。防毒防垃圾邮件，推荐f-secure internet gatekeeper，比偶原来使用Trend IMSS性能好的多internet gatekeeper是优秀的网关防毒软件，当然也是商业软件:p，支持http、ftp、smtp、pop3防毒。&lt;br /&gt;到f-secure下载个for linux的30天试用版本，tar zxvf解压，sh INSTALL.sh即默认安装到/opt/f-secure/fsigk下，默认的管理端口为127.0.0.1:9012，更改一下fsigk/etc/fsigk.ini改成公网ip重新启动fsigk_admin服务即可远程管理，这里打开smtp，监听9025端口，parent smtp设置127.0.0.1 25，打开virus以及spam检查，对于收到virus以及spam邮件自个设定如何处理。fsigk_smtp会自动启动，监听9025端口&lt;br /&gt;注意这里需要我们把对25端口的收信转移到9025上以方便gatekeeper检查病毒、spam，然后再转移回postfix，利用iptables的nat端口转换功能来完成此项操作。&lt;br /&gt;iptables -t nat -A PREROUTING -d publicip -p tcp -m tcp --dport 25 -j DNAT --to-destination publicip:9025&lt;br /&gt;系统的优化：&lt;br /&gt;偶使用的是hivemail1.2.2，性能在默认情况下有些问题，经过检查发现一个sql占用了大量的cpu，就是对hive_emailid的操作，表现为系统中有N个hivemail_process.php，mysql占用大量的系统cpu，对此表emailid字段创建index即可坚决此严重的性能问题。此问题曾经在hivemail forum多次出现，官方只推荐升级到hivemail1.&lt;br /&gt;3。偶没有测试过1.3，所以不知道1.3是否解决此性能问题。至少在1.2.2上创建index后在偶的接近10W用户里没再出现相应的性能问题。&lt;br /&gt;题外话：&lt;br /&gt;hivemail作为商业web mail系统，已经2年没更新了，怀疑已经是个dead project，但其用户还是挺多的，对于中小型使用非常合适而且可以根据需要更改php程序，整体界面非常漂亮。这么死掉的话非常可惜。&lt;br /&gt;最近发现的hivemail漏洞是因为对于各个id的检查不够，各位可以在相应的php程序开头加入intme($*id)以防止此注入。&lt;br /&gt;要求安全性高的话可以在apache加装mod_security、mod_evasive等以防止一些常见的攻击。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7047093-115028036200745513?l=devil4heaven.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devil4heaven.blogspot.com/feeds/115028036200745513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7047093&amp;postID=115028036200745513' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/115028036200745513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/115028036200745513'/><link rel='alternate' type='text/html' href='http://devil4heaven.blogspot.com/2006/06/linuxweb.html' title='linux完整web邮件系统的架设'/><author><name>devil4heaven</name><uri>http://www.blogger.com/profile/10045664492964436386</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10586956192566421090'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7047093.post-113833930115519307</id><published>2006-01-26T21:17:00.000-08:00</published><updated>2006-01-26T21:21:41.170-08:00</updated><title type='text'>today,it's time to release</title><content type='html'>today,all the work in this year ended,next year,a new begging for life.&lt;br /&gt;now it's time to release,happy new year to the world.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7047093-113833930115519307?l=devil4heaven.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devil4heaven.blogspot.com/feeds/113833930115519307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7047093&amp;postID=113833930115519307' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/113833930115519307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/113833930115519307'/><link rel='alternate' type='text/html' href='http://devil4heaven.blogspot.com/2006/01/todayits-time-to-release.html' title='today,it&apos;s time to release'/><author><name>devil4heaven</name><uri>http://www.blogger.com/profile/10045664492964436386</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10586956192566421090'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7047093.post-111407913657349925</id><published>2005-04-21T03:17:00.000-07:00</published><updated>2005-04-21T03:25:36.573-07:00</updated><title type='text'>oracle &amp; sqlserver</title><content type='html'>some application now using sqlserver, after the install and learning,sql server is easy using under windows,but the performance and stability less than oracle&lt;br /&gt;sql serve2k with sp3a, easy with using and performance tunning&lt;br /&gt;oracle 9.2.0.6, difficult with using and tunning,but stability is more much better than sqlserver.&lt;br /&gt;as database cluster,Oracle is much more better than sqlserver with RAC.&lt;br /&gt;&lt;br /&gt;maybe my opinion is not equity,as oracle dba 4 years,and sqlserver dba not more than 1 months.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7047093-111407913657349925?l=devil4heaven.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devil4heaven.blogspot.com/feeds/111407913657349925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7047093&amp;postID=111407913657349925' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/111407913657349925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/111407913657349925'/><link rel='alternate' type='text/html' href='http://devil4heaven.blogspot.com/2005/04/oracle-sqlserver.html' title='oracle &amp; sqlserver'/><author><name>devil4heaven</name><uri>http://www.blogger.com/profile/10045664492964436386</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10586956192566421090'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7047093.post-111407856274686665</id><published>2005-04-21T03:03:00.000-07:00</published><updated>2005-04-21T03:16:02.746-07:00</updated><title type='text'>rebuild MS AD&amp; Exchange</title><content type='html'>domain controler with MS ad crashed last week becaure virus,but  backup server is alive,after the GlobalCatalog server down,then the exchange can't startup, though the backup server is GC too,after two days work on recovering exchange server, nothing can do more even with ms support. shit MS.&lt;br /&gt;Total AD was rebuided because many error in the old Ad, win2k3 and exchange2k3 sp1,but the internet mail can't be sended,only stay in the smtp query.maybe be the bug under next url&lt;br /&gt;&lt;a href="http://forums.msexchange.org/ultimatebb.cgi?ubb=get_topic;f=18;t=000384"&gt;http://forums.msexchange.org/ultimatebb.cgi?ubb=get_topic;f=18;t=000384&lt;/a&gt;&lt;br /&gt;after set the internet outgo mail relay to a linux postfix server,the problem was solved,nothing can said to MS.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7047093-111407856274686665?l=devil4heaven.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devil4heaven.blogspot.com/feeds/111407856274686665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7047093&amp;postID=111407856274686665' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/111407856274686665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/111407856274686665'/><link rel='alternate' type='text/html' href='http://devil4heaven.blogspot.com/2005/04/rebuild-ms-ad-exchange.html' title='rebuild MS AD&amp; Exchange'/><author><name>devil4heaven</name><uri>http://www.blogger.com/profile/10045664492964436386</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10586956192566421090'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7047093.post-111407776110927718</id><published>2005-04-21T02:52:00.000-07:00</published><updated>2005-04-21T03:02:41.110-07:00</updated><title type='text'>All sytem performance tunning finished</title><content type='html'>after the tunning on Oracle9.2.0.6 under Rhel3 u4, the all system performance tunning was finished last week.&lt;br /&gt;total architecture includes cache,web,application,database, tunning on all the part began at july last year, finished at april this year.&lt;br /&gt;now the system can have about 10k-20k concurrent online user with the same hardware, the on bottle is database, though now we have oracle,mysql and sql server,maybe postgresql later, but none db is clustered.the expensive oracle rac-.&lt;br /&gt;performance now become about 5-20 times than last year.&lt;br /&gt;next step is the dirtributed architecture.maybe MQ,JMS &amp;amp; EJB.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7047093-111407776110927718?l=devil4heaven.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devil4heaven.blogspot.com/feeds/111407776110927718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7047093&amp;postID=111407776110927718' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/111407776110927718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/111407776110927718'/><link rel='alternate' type='text/html' href='http://devil4heaven.blogspot.com/2005/04/all-sytem-performance-tunning-finished.html' title='All sytem performance tunning finished'/><author><name>devil4heaven</name><uri>http://www.blogger.com/profile/10045664492964436386</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10586956192566421090'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7047093.post-111407566340016234</id><published>2005-04-21T02:25:00.000-07:00</published><updated>2005-04-21T02:27:43.403-07:00</updated><title type='text'>Linux下负载均衡器LVS简单设置</title><content type='html'>简单术语：&lt;br /&gt;Director：前端负载均衡器，运行lvs，目前只能为Linux，针对FreeBSD刚刚出来，性能不知道如何。可以针对web、ftp、cache、mms甚至mysql等服务做loadbalance。&lt;br /&gt;RealServer：后段需要负载均衡的服务器，可以为各类系统，Linux、Solaris、Aix、BSD、Windows都可，甚至Director本身也可以作为RealServer使用&lt;br /&gt;&lt;br /&gt;过完春节一直忙的稀里糊涂，脑袋一直转的太快，下午暂时有点空闲，正好最近N多朋友要做web 方式下的负载均衡，简单描述一下lvs的设置（不涉及HA、Mult-homing），当做大脑休息好了:p&lt;br /&gt;&lt;br /&gt;lvs Linux Virtual Server，Linux下的负载均衡器，不多作介绍了，跟DNS轮询以及一些商业产品的比较等不做论述，具体看看LVS网站，支持LVS-NAT、LVS-DR、LVS-TUNL三种不同的方式，nat用的不是很多，这里简单介绍一下DR、TUNL方式。&lt;br /&gt;DR方式适合所有的RealServer同一网段下，即接在同一个交换机上&lt;br /&gt;TUNL方式就RealServer可以任意了，完全可以跨地域、空间，只要系统支持Tunnel就成（Win2k3好像已经不支持了……）&lt;br /&gt;方便以后扩充的话直接Tunl方式即可&lt;br /&gt;&lt;br /&gt;Director系统为RHEL3＋ClusterSuite（偶是懒人，懒得打kernel patch了:p）&lt;br /&gt;RealServer系统为Rhel3＋noarp补丁&lt;br /&gt;&lt;br /&gt;Director设置：&lt;br /&gt;需要在Director设置的就是/etc/sysconfig/ha/lvs.cf，以及安装ClusterSuite后启动pulse服务（Redhat的lvs服务，当然也可以手动），下面是一个简单的lvs设置（没有设置director HA），man lvs.cf看看详细设置，RHEL3里已经有了详细的手册&lt;br /&gt;203.x.x.a为Director公网ip地址&lt;br /&gt;203.x.x.b为需要Loadbance的域名的Ip地址&lt;br /&gt;203.x.x.c 为第一个RealServer&lt;br /&gt;203.x.x.d为第二个RealServer&lt;br /&gt;&lt;br /&gt;#cat /etc/sysconfig/ha/lvs.cf&lt;br /&gt;serial_no = 45&lt;br /&gt;primary = 203.x.x.a&lt;br /&gt;service = lvs&lt;br /&gt;rsh_command = ssh&lt;br /&gt;backup_active = 0&lt;br /&gt;backup = 0.0.0.0&lt;br /&gt;heartbeat = 1&lt;br /&gt;heartbeat_port = 539&lt;br /&gt;keepalive = 10&lt;br /&gt;deadtime = 20&lt;br /&gt;network = direct（Tunl方式改为tunnel）&lt;br /&gt;nat_nmask = 255.255.255.255&lt;br /&gt;reservation_conflict_action = preempt&lt;br /&gt;debug_level = NONE&lt;br /&gt;virtual www.test.com {&lt;br /&gt;     active = 1&lt;br /&gt;     address = 203.x.x.b eth0:0 &lt;br /&gt;     vip_nmask = 255.255.255.255&lt;br /&gt;     port = 80&lt;br /&gt;     send = "GET / HTTP/1.0\r\n\r\n"&lt;br /&gt;     expect = "HTTP"&lt;br /&gt;     load_monitor = uptime&lt;br /&gt;     scheduler = wlc&lt;br /&gt;     protocol = tcp&lt;br /&gt;     timeout = 10&lt;br /&gt;     reentry = 15&lt;br /&gt;     quiesce_server = 0&lt;br /&gt;     server r1 {&lt;br /&gt;         address = 203.x.x.c&lt;br /&gt;         active = 1&lt;br /&gt;         weight = 1&lt;br /&gt;     }&lt;br /&gt;     server r2 {&lt;br /&gt;         address = 203.x.x.d&lt;br /&gt;         active = 1&lt;br /&gt;         weight = 1&lt;br /&gt;     }&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;上面的设置是对某个域名的web访问进行负载均衡，Director使用ssh定时收集RealServer上的负载，然后决定Loadbalance的分配，分配方式为WLC方式，然后启动pulse服务，看看/var/log/message里有没有什么配置错误，RHEL3里设置已经非常方便、简单&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;RealServer配置：&lt;br /&gt;RS系统为Rhel3，针对DR、Tunl需要不同的设置，但关键的是arp问题，这里使用的noarp module，当然Rhel3里也提供了arptables来配合lvs（效果可能不是很好），这里介绍一下noarp&lt;br /&gt;noarp编译不做介绍了，configure install后，insmod noarp把noarp加入内核，然后需要执行&lt;br /&gt;noarpctl  add 203.x.x.b 203.x.x.a &lt;br /&gt;这是把所有对203.x.x.b的arp请求转向203.x.x.a（Director），然后建立虚拟ip以完成路由&lt;br /&gt;DR的话需要建立网卡，放在eth0或者lo都行&lt;br /&gt;ifconfig eth0:1 203.x.x.b netmask 255.255.255.255 up&lt;br /&gt;Tunl方式的话需要启动tunl虚拟网卡&lt;br /&gt;ifconfig tunl0 203.x.x.b netmask 255.255.255.255 up&lt;br /&gt;同样在RealServer2上同样的设置&lt;br /&gt;在两个RealServer上启动apache&lt;br /&gt;&lt;br /&gt;Director上检测一下连接&lt;br /&gt;ipvsadm -Ln&lt;br /&gt;看看当前的负载分配&lt;br /&gt;&lt;br /&gt;lvs的稳定性不用置疑，Rhas2.1、Rhel3里的LVS在偶这个懒人的4年使用里极其稳定，访问量从当时的几百人在线到现在的接近10K，只需要根据负载增加后段的RealServer即可，但Rhas2.1的LVS对Tunl支持的不好，建议使用Rhel3进行tunl方式的Loadbalance&lt;br /&gt;&lt;br /&gt;几句题外话：&lt;br /&gt;lvs这两年里已经很稳定了，应用也已经很多了，maillist已经很活跃了，一些问题完全可以在maillist里找到答案，不用象偶当时完全是瞎子摸象:p。&lt;br /&gt;上面只是lvs一个简单的应用，其它的复杂应用完全可以到lvs主页、maillist等查找。&lt;br /&gt;&lt;br /&gt;可以任意转载，转载请注明出处http://devil4heaven.blogspot.com/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7047093-111407566340016234?l=devil4heaven.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devil4heaven.blogspot.com/feeds/111407566340016234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7047093&amp;postID=111407566340016234' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/111407566340016234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/111407566340016234'/><link rel='alternate' type='text/html' href='http://devil4heaven.blogspot.com/2005/04/linuxlvs.html' title='Linux下负载均衡器LVS简单设置'/><author><name>devil4heaven</name><uri>http://www.blogger.com/profile/10045664492964436386</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10586956192566421090'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7047093.post-110127907897553113</id><published>2004-11-23T22:43:00.000-08:00</published><updated>2004-11-23T22:51:18.976-08:00</updated><title type='text'>jsp or php page cached using squid</title><content type='html'>&lt;div align="left"&gt;Squid now is serving as reverse proxy before apache cluster server&lt;/div&gt;&lt;br /&gt;some php and jsp page must be cached in squid to increase the response speed and decrease the j2ee or apache thread number.&lt;br /&gt;using refresh_patterns solved it.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;refresh_pattern -i .jsp         720     25%     1440  override-expire  ignore-reload&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;refresh_pattern -i .php         720     20%     1440  override-expire  ignore-reload&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;ignore-reload will prevent request no-cache etc,like ctrl+F5 under ie will refresh the squid cache,but ignore-reload will prevent it.&lt;br /&gt;ATT:&lt;br /&gt;squid default squid.conf include &lt;em&gt;refresh_pattern -i .js        360     25%     1440, &lt;/em&gt;the above -i .jsp must stay top before this.else -i .js will be suit for the parsing.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7047093-110127907897553113?l=devil4heaven.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devil4heaven.blogspot.com/feeds/110127907897553113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7047093&amp;postID=110127907897553113' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/110127907897553113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/110127907897553113'/><link rel='alternate' type='text/html' href='http://devil4heaven.blogspot.com/2004/11/jsp-or-php-page-cached-using-squid.html' title='jsp or php page cached using squid'/><author><name>devil4heaven</name><uri>http://www.blogger.com/profile/10045664492964436386</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10586956192566421090'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7047093.post-110127860270711735</id><published>2004-11-23T22:34:00.000-08:00</published><updated>2004-11-23T22:43:22.706-08:00</updated><title type='text'>delay for such time</title><content type='html'>&lt;div align="center"&gt;&lt;em&gt;&lt;strong&gt;Total web HA architecture under linux maybe like below&lt;/strong&gt;&lt;/em&gt;&lt;/div&gt;&lt;br /&gt;&lt;strong&gt;Load balancer&lt;/strong&gt;: lvs(ha include),now LVS included in RHEL&lt;br /&gt;&lt;div align="left"&gt;&lt;strong&gt;Web Server:&lt;/strong&gt; multi httpd server,now apache(file rsync or distributed file sytem or nfs)&lt;/div&gt;&lt;strong&gt;Stream server&lt;/strong&gt;: Helix or WMS&lt;br /&gt;&lt;strong&gt;Other Service&lt;/strong&gt;: smtp,ftp etc&lt;br /&gt;&lt;strong&gt;Application server&lt;/strong&gt;(j2ee Container): tomcat(javagroups,tangol),jboss,weblogic etc,now using mod_jk link web to app&lt;br /&gt;&lt;strong&gt;Database&lt;/strong&gt;:oracle rac,mysql(using clusterjdbc,no mysql cluster which now testing)&lt;br /&gt;&lt;strong&gt;Cluster Filesytem&lt;/strong&gt;: now testing lustre1.2.1 under sles9(Suse Enterprise server 9),but too less document&lt;br /&gt;&lt;br /&gt;SAN too expensive and NAS not suite for so much server&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7047093-110127860270711735?l=devil4heaven.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devil4heaven.blogspot.com/feeds/110127860270711735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7047093&amp;postID=110127860270711735' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/110127860270711735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/110127860270711735'/><link rel='alternate' type='text/html' href='http://devil4heaven.blogspot.com/2004/11/delay-for-such-time.html' title='delay for such time'/><author><name>devil4heaven</name><uri>http://www.blogger.com/profile/10045664492964436386</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10586956192566421090'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7047093.post-108504403313089667</id><published>2004-05-20T02:06:00.000-07:00</published><updated>2004-05-20T02:07:13.130-07:00</updated><title type='text'>my blog begin</title><content type='html'>it now begin from 2004.05.20&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7047093-108504403313089667?l=devil4heaven.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devil4heaven.blogspot.com/feeds/108504403313089667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7047093&amp;postID=108504403313089667' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/108504403313089667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7047093/posts/default/108504403313089667'/><link rel='alternate' type='text/html' href='http://devil4heaven.blogspot.com/2004/05/my-blog-begin.html' title='my blog begin'/><author><name>devil4heaven</name><uri>http://www.blogger.com/profile/10045664492964436386</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10586956192566421090'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>