bbs/mysql 优化参数
时间:2006-01-06 来源:luweinet
一点论坛/mysql服务器优化的 记录,懒得记
#!/bin/bash hd=/dev/hdc export PATH=$PATH:/sbin:/usr/sbin #hdparm -tT $hd #view you harddisk read test before change. hdparm -d1 $hd #DMA mode hdparm -X69 $hd #set transte mode hdparm -c3 $hd #io_support hdparm -u1 $hd #active unmaskirq hdparm -m16 $hd #one i/o MaxMultSect hdparm -W1 $hd #read quick hdparm -A1 $hd #read before #hdparm -a8 $hd # #echo 33554432 > /proc/sys/net/ipv4/ip_conntrack_max #/sbin/modprobe ip_conntrack hashsize=4194304 <Connector className="org.apache.catalina.connector.http.HttpConnector" port="8080" minProcessors="10" maxProcessors="1024" enableLookups="true" redirectPort="8443" acceptCount="1024" debug="0" connectionTimeout="5000"/> <!-- Note : To disable connection timeouts, set connectionTimeout value to -1 --> <!-- Define a non-SSL HTTP/1.1 Connector on port 80 --> <Connector className="org.apache.catalina.connector.http.HttpConnector" port="80" minProcessors="5" maxProcessors="100" enableLookups="true" redirectPort="8443" acceptCount="30" debug="0" connectionTimeout="5000"/> #!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don''t # want to do the full Sys V style init stuff. touch /var/lock/subsys/local echo 33554432 > /proc/sys/net/ipv4/ip_conntrack_max /sbin/modprobe ip_conntrack hashsize=4194304 echo "40 1024 64 256 500 3000 500 1884 2" > /proc/sys/vm/bdflush #!/bin/sh # netbilling # case "$1" in start) echo -n "Starting netbilling ..." /sbin/iptables -L -t nat -n > /tmp/iptables /root/netbilling/netbilling start loop=0 while [ "$loop" -lt 3 ] ; do loop=$(($loop+1)) waited=0 while [ "$waited" -lt 100 ] ; do usleep 10000 waited=$(($waited+1)) done /sbin/iptables -L -t nat -n > /tmp/iptables if [ `wc -l < /tmp/iptables` -lt 10 ] then echo -n "..." /root/netbilling/netbilling restart fi done echo "" ;; stop) echo "Stop netbilling ..." /root/netbilling/netbilling stop ;; *) echo "Restart netbilling ..." $0 stop; $0 start; ;; esac mysql 3.25 large server.cnf ############## [client] port = 3306 socket = /var/lib/mysql/mysql.sock [mysqld] port = 3306 socket = /var/lib/mysql/mysql.sock skip-locking set-variable = key_buffer=256M set-variable = max_allowed_packet=1M set-variable = table_cache=256 set-variable = sort_buffer=1M set-variable = record_buffer=1M set-variable = myisam_sort_buffer_size=64M set-variable = thread_cache=8 set-variable = thread_concurrency=8 log-bin server-id = 1 [mysqldump] quick set-variable = max_allowed_packet=16M [mysql] no-auto-rehash [isamchk] set-variable = key_buffer=128M set-variable = sort_buffer=128M set-variable = read_buffer=2M set-variable = write_buffer=2M [myisamchk] set-variable = key_buffer=128M set-variable = sort_buffer=128M set-variable = read_buffer=2M set-variable = write_buffer=2M [mysqlhotcopy] interactive-timeout ########### running=`ps -ef |grep /usr/local/tomcat |grep -v grep` if [ "x" != "x$running" ] then echo "Tomcat already running!" exit 0 fi su - -c "/usr/local/tomcat/bin/startup.sh &" sleep 3 running=`ps -ef |grep /usr/local/tomcat |grep -v grep` if [ "x" = "x$running" ] then echo "Tomcat start error!" exit 1 else echo "Tomcat restore succeed" exit 0 fi |
相关阅读 更多 +