# 載入mod_jk
# loadmodule jk_module modules/mod_jk.so
# # 配置mod_jk
# jkworkersfile conf/workers.properties
jklogfile logs/mod_jk.log
jkloglevel info
#請求分發,對jsp檔案,.do等動態請求交由tomcat處理
documentroot "c:/apache/htdocs"
jkmount /*.jsp loadbalancer
jkmount /*.do loadbalancer
jkmount /servlet/* loadbalancer
#關掉主機lookup,如果為on,很影響效能,可以有10多秒鐘的延遲。
hostnamelookups off
#快取配置
loadmodule cache_module modules/mod_cache.so
loadmodule disk_cache_module modules/mod_disk_cache.so
loadmodule mem_cache_module modules/mod_mem_cache.so
cacheforcecompletion 100
cachedefaultexpire 3600
cachemaxexpire 86400
cachelastmodifiedfactor 0.1
cacheenable disk /
cacheroot c:/cacheroot
cachesize 327680
cachedirlength 4
cachedirlevels 5
cachegcinterval 4
cacheenable mem /
mcachesize 8192
mcachemaxobjectcount 10000
mcacheminobjectsize 1
mcachemaxobjectsize 51200
worker. properties檔案
# # workers.properties ,可以參考
::url::
# in unix, we use forward slashes:
ps="
# list the workers by name
worker.list=tomcat1, tomcat2, loadbalancer
# ------------------------
# first tomcat server
# ------------------------
worker.tomcat1.port=8009
worker.tomcat1.host=localhost
worker.tomcat1.type=ajp13
# specify the size of the open connection cache.
#worker.tomcat1.cachesize
# # specifies the load balance factor when used with
# a load balancing worker.
# note:
# ----> lbfactor must be > 0
# ----> low lbfactor means less work done by the worker.
worker.tomcat1.lbfactor=900
# ------------------------
# second tomcat server
# ------------------------
worker.tomcat1.port=8009
worker.tomcat1.host=202.88.8.101
worker.tomcat1.type=ajp13
# specify the size of the open connection cache.
#worker.tomcat1.cachesize
# # specifies the load balance factor when used with
# a load balancing worker.
# note:
# ----> lbfactor must be > 0
# ----> low lbfactor means less work done by the worker.
worker.tomcat1.lbfactor=2000
# ------------------------
# load balancer worker
# ------------------------
# # the loadbalancer (type lb) worker performs weighted round-robin
# load balancing with sticky sessions.
# note:
# ----> if a worker dies, the load balancer will check its state
# once in a while. until then all work is redirected to peer
# worker.
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=tomcat1,tomcat2
# # end workers.properties
# tomcat1配置:
啟動記憶體配置,開發configure tomcat程式即可配置:
initial memory pool: 200 m
maxinum memory pool:300m
tomcat2配置:
配置和tomcat1差不多,需要改動的地方如下:
啟動記憶體配置,開發configure tomcat程式即可配置:
initial memory pool: 512 m
maxinum memory pool:768m
mysql配置:
server型別:dedicated mysql server machine
database usage:transational database only
併發連線數量:online transaction processing(oltp)
字符集:utf8
資料庫連線池的配置:
我們採用的是spring 框架,配置如下:
org.hibernate.dialect.mysqldialect
com.mysql.jdbc.driver
jdbc:mysql:
safalse
false
true
2200
512000501
swoole優化配置 壓力測試
四 服務端核心優化 五 測試 2 vcpu 4 gb i o優化 100mbps 峰值 server new swoole websocket server 0.0.0.0 9556 options max connection 150000,最大鏈結數 worker num 6,worker 數 ...
ab壓力測試 mysql MySQL壓力測試
1.什麼是壓力測試 壓力測試是針對系統的一種效能測試,但是測試資料與業務邏輯無關,更加簡單直接的測試讀寫效能 2.壓力測試的指標 qps 每秒鐘處理完請求的次數 tps 每秒鐘處理完的事務次數 併發量 系統能同時處理的請求數 3.壓力測試工具 mysqlslap sysbench jmeter 長時...
mysql 壓力測試 golang 壓力測試
1.壓力測試 1.1.1.go怎麼寫測試用例 開發程式其中很重要的一點是測試,我們如何保證 的質量,如何保證每個函式是可執行,執行結果是正確的,又如何保證寫出來的 效能是好的,我們知道單元測試的重點在於發現程式設計或實現的邏輯錯誤,使問題及早暴露,便於問題的定位解決,而效能測試的重點在於發現程式設計...