Tuesday, September 14, 2010

Stress Test Tools

Besides using JMeter for Web Stress Test tools, below is a simple tools under Apache.

1. 同時 10 個連線,連續點擊 10000 次 ( 每個 Request 執行完畢後都會自動斷線,然後再重新連線 )

ab -n 10000 -c 10 http://www.example.com/index.aspx

2. 同時 10 個連線,連續點擊 10000 次,並且使用 Keep-Alive 方式連線(當 Web Server 有支援 Keep-Alive 功能時 ApacheBench 會在同一個連線下連續點擊該網頁)

ab -n 10000 -c 10 -k http://www.example.com/index.aspx

3. 將測試的效能原始資料匯出成 CSV 檔

ab -e output.csv -n 10000 -c 10 http://www.example.com/index.aspx



http://blog.miniasp.com/post/2008/06/Using-ApacheBench-ab-to-to-Web-stress-test.aspx

MySQL - little tips - concat function

mysql sharing

this one is correct
SELECT CONCAT('tag_history_' , date_format(sysdate() , '%Y%m%d%H'));

this one is incorrect as concat( is not allow to leave a space in query browser.
SELECT CONCAT ('tag_history_' , date_format(sysdate() , '%Y%m%d%H'));

SQL Server - tips - all table, all column, all stored procedure (sp)

All table
SELECT *
FROM sys.Tables

All column
SELECT SO.NAME AS "Table Name", SC.NAME AS "Column Name", SM.TEXT AS "Default Value"
FROM dbo.sysobjects SO INNER JOIN dbo.syscolumns SC ON SO.id = SC.id
LEFT JOIN dbo.syscomments SM ON SC.cdefault = SM.id
WHERE SO.xtype = 'U'
ORDER BY SO.[name], SC.colid

all sp

SELECT Distinct SO.Name , sc.text
FROM sysobjects SO (NOLOCK)
INNER JOIN syscomments SC (NOLOCK) on SO.Id = SC.ID
AND SO.Type = 'P'
AND SC.Text LIKE '%ftsAccount%'
ORDER BY SO.Name