HowTo: Check Ubuntu OS Version

lsb_release -a 顯示發行版本資訊。

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.1 LTS
Release: 12.04
Codename: precise

cat /proc/version 查看作業系統版本

Linux version 3.2.0-36-generic (buildd@komainu) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #56-Ubuntu SMP Wed Jan 2 21:50:39 UTC 2013

cat /etc/debian-version 查看 debian 版本。

wheezy/sid

Asp.net session mode = stateserver , let session disappear no longer.

ASP.NET的sessionState的三種屬性

InProc(預設):也就是將Session保存在Process裡面(IIS5是aspnet_wp.exe,而IIS6是W3wp.exe),這個Process算是不穩定,在某些事件發生時,Process會重新啟動。在web.config的設定:

<configuration>
      <system.web>
             <sessionState   mode="InProc"
                  timeout="20"
                  cookieless="UseCookies">
             </sessionState>
      </system.web>
</configuration>

StateServer:本機的一個服務,可以在系統服務裡看到服務名為ASP.NET State Service的服務,預設下是不啟動的。當我們設定mode為StateServer之後,要在服務那邊手動將該服務啟動喔。在web.config的設定:

   <configuration>
      <system.web>
            <sessionState mode="StateServer" timeout="500"
            stateConnectionString="tcpip=127.0.0.1:42424"/>
      </system.web>
  </configuration>

SQLServer:將 session 存於 SqlServer 資料庫中,必需要有ASPState資料庫,所以要使用 aspnet_regiis.exe 工具來新增,步驟如下:

(1.)新增 ASPState 資料庫:進入命令模式視窗輸入 aspnet_regsql.exe -S ServerName -E -ssadd -sstype p
(2.)如果要移除:進入命令模式視窗輸入aspnet_regsql.exe -S ServerName -E -ssremove
(3.)在web.config的設定:

<configuration>      
      <system.web>   
             <sessionState mode="SQLServer"   
                        sqlCommandTimeout="30"   
                        sqlConnectionString="data  source=localhost;Integrated             
                        Security=SSPI">   
              </sessionState>   
      </system.web>   
</configuration>

from:http://www.dotblogs.com.tw/boei/archive/2010/07/06/16414.aspx

網卡綁定:bonding mode6(abl) 會造成arpwatch flipflop 判斷錯誤,改為mode5(tbl)可避免此問題。

bonding mode6(abl):是以「網路介面卡」為 LoadBlance 的模式,當某主要的網卡介面達到啟動條件,會啟用其它 bonding 的網卡作資料的傳輸與接收。此一模式下 IP-MAC pair 會因為 loadblance 的啟動,而傳送 arp 定址的廣播封包,將之後要傳送與接收的資料指定給次要網卡處理。

bonding mode5(tbl):是資料傳送為啟動條件的模式,當主要的網卡介面達啟動條件次要的網卡就會幫忙處理資料傳送的工作,接收資料仍由主要的網卡負責。