2014年4月29日 星期二

[Azure] 如何讓 Azure Website 支援 json 檔案的存取

預設 Azure Website 是沒有支援 json MIME Type 的

要開啟的方式很簡單,修改 Web.config 檔案即可

若沒有 Web.Config 這個檔案,直接使用以下內容:

儲存後,上傳至 /site/wwwroot 目錄下即可

若是已經有 Web.Config 檔案,則直接加入 這個段落的設定並重新佈署即可

[Azure] 透過 FTP 上傳靜態網頁至 Azure WebSite

今天突然有個要將靜態網頁(static html)放到 Azure WebSite 的需求

想想之前都是用 Visual Studio 佈署的,只是放個網頁應該不需要用到 Visual Studio 這種龐然大物吧......?

後來發現原來可以透過 FTP 簡單把網頁上傳即可,找到以下資料可供參考!

Windows Azure Website: Uploading/Downloading files over FTP and collecting Diagnostics logs - Avkash Chauhan's Blog - Site Home - MSDN Blogs

運用 FTP 上傳檔案至 Windows Azure Web Sites - Tom Lee's blog - Site Home - MSDN Blogs

透過 FTP 軟體連上後,再把網頁丟到 /site/wwwroot 目錄下就可以囉!

2014年4月20日 星期日

[VMware] 學習筆記 - vSphere Installation and Setup

Introduction to vSphere Installation and Setup

安裝 vSphere 包含以下部分:
  1. 確認硬體與軟體的需求皆符合
  2. 安裝 vCenter Server
    1. (optional) 安裝 vCenter Server database
      【註】小型環境(5 ESXi host 或 50 VMs 以內) 可使用內建的 MS SQL Server 2008 Express 即可。
    2. 安裝完整 vCenter 順序為:
      vCenter Single Sign-On => vSphere Web Client => vCenter Inventory Service => vCenter Server
  3. 安裝 ESXi 
    1. 確認要安裝的位置(Local Disk or USB or .... etc)
    2. 安裝 ESXi 有三種選項:
      (1) 互動式安裝
      (2) 使用 Scritp 安裝 / 升級 / 轉移
      (3) 使用 vSphere Auto Deploy
  4. 安裝完成後,進行開機 & 網路設定
  5. 若本機硬碟儲存空間很有限,建議設定遠端的 syslog server,或是安裝 vSphere Syslog Collector 來收集所有 ESXi Host 上的 log

System Requirements

安裝 ESXi 5.5,硬體限制如下:

  • 僅支援 64 位元 x86 架構的 CPU
  • 至少要雙核心的主機
  • 僅支援 LAHF & SAHF CPU 指令集
  • BIOS 中必須啟用 CPU 中的 NX/XD bit
  • 主機至少必須要有 4GB 以上的記憶體,官方建議 8GB 以上
  • 若要支援 64 位元的 VM,x64 CPU 上的虛擬化的功能(Intel VT-x / AMD RVI)必須啟用
  • SATA 裝置會被視為遠端裝置,非本機裝置,因此無法作為 scratch partition 之用
  • ESXi 不支援在本機內的 SATA 硬碟上建立可跨多台 ESXi 主機共同分享的 VMFS datastore

【註】在 ESXi 5.5 上無法將 SATA-CDROM 連接至 VM,必須改成 IDE emulation mode 才可用

ESXi Booting Requirements

vSphere 5.5 支援使用 UEFI 開機,透過 UEFI,可選擇使用硬碟、光碟、甚至於 USB 隨身碟開機。
若要使用網路開機 or 使用 VMware Auto Deploy 開機,就必須選擇傳統的 BIOS 模式,不能選擇 UEFI。
【註】安裝完 ESXi 5.5 之後,若更改開機模式(legacy BIOS <-> UEFI) 可能會造成無法正常開機










zh-CN → zh-TW
順序

2014年4月17日 星期四

[Azure] 解決部署到 Cloud Service Web Role 後,第一次進入網頁速度很慢的問題

最近開發的一個 Azure 上的專案,發現若是 Cloud Service 上的 web role 重新佈署後,網頁第一次瀏覽都會非常的慢,等個 30 秒以上是常態~

後來發現原來是 IIS IdleTime 的問題,可以透過 startup command 來解決~

詳細的原因 & 解決方式可參考以下兩個網頁:

  1. Windows Azure WebSites and Cloud Services Slow on First Request | Simon J.K. Pedersen's SharePoint blog
  2. c# - Disable IIS Idle Timeouts in Azure Web Role - Stack Overflow

2014年3月26日 星期三

NexentaStor(ZFS) 與 Windows Storage Server 2012(ReFS + NTFS) 比較



NexentaStor
Windows Storage Server 2012 (ReFS + NTFS)
File System
ZFS
ReFS(無法作為開機磁區) + NTFS
發表年份
2005
2012
Hybrid Storage Pool
ZFS 原生支援
支援
Volume Max Size
16EB
256EB(理論) 16EB(實際)
Hot Spares
支援
支援
Read Cache
支援,分為 ARC(DRAM) & L2ARC(SSD) 兩層處理
支援 SSD Cache,但不支援 DRAM Cache(可透過 3-party 的元件解決)
Write Cache
支援 SSD
支援 SSD
授權方式/費用
以下價格最多能使用 8TB 的容量:


共有三種不同的 Support Level,分別為:
Silver($51,750)
Gold($83,700)
Platinum($125,550)


功能皆相同,磁碟數量、記憶體數量、CPU 數量都沒限制,但有總使用空間的限制(8TB / 16TB / 32TB …. etc)


每年續約 or 一次買 2 / 4 / 6 年的授權合約(買越長平均價格越便宜)
分為 Workgroup & Standard 版本:
=== Workgroup ===
最多 50 個連線
單一處理器插槽
最多 32 GB 的記憶體
最多 6 部磁碟 (不使用外接式 SAS)


=== Standard ===
連線數量無授權限制
多重處理器插槽
記憶體無授權限制
磁碟數量無授權限制
解除複寫、虛擬化 (主機外加 2 部虛擬機器,提供存放區及磁碟管理工具) 以及網路服務(無網域控制站)容錯移轉叢集,提供更高可用性
Microsoft BranchCache,降低 WAN 流量
支援協定
CIFS / SMB / NFS / iSCSI …. etc
CIFS / SMB / NFS / iSCSI …. etc
ReFS volume 無法使用 NFS,僅有 NTFS 能使用 NFS
操作介面
普通,透過 Web Browser
優,直接在作業系統 GUI 中操作
Deduplication(重複資料刪除)
ZFS 原生支援
支援,但有以下限制:
1. Windows Server 2012才能用 (沒有Deduplication Feature的Windows會抓不到Deduplicate後的檔案)
2. Boot 或 System 磁碟不能用
3. 不是NTFS的磁碟不能用 (新的ReFS也不行)
4. Cluster Shared Volumes(CSV)不能用
5. 加密檔案不能用
6. 暫時不能以群組原則設定
Snapshot (快照)
ZFS 原生支援
支援,但必須與 VSS(Volume Shadow Copy Service) 搭配才可以
Compress
ZFS 原生支援
不支援
HA(High Availability)
支援(JBOD + Multiple Servers)
支援(JBOD + Multiple Servers)
與 AD 整合
支援
支援
整合雲端
查無相關資訊
可與 Windows Azure 雲端服務整合

【備註】很多一樣的功能其實我並沒有列出來......只是個很簡單的比較...

心得


感覺 ReFS 根本就是跟著 ZFS 在走的,成熟度上還不足! (畢竟 ZFS 已經發展十年了....)

微軟雖然在廣告文宣上把 storage server 2012 的功能寫得很強,但事實上很多限制都沒寫出來.....評估 storage 解決方案時還是要注意一下...

不過看得出來微軟來勢洶洶啦~希望以後他可以更進步囉!

參考資料




2014年3月20日 星期四

[ZFS] 效能調校觀念 (ZIL、ARC、L2ARC)

要調校 ZFS storage 的效能,首先必須知道的就是 ZIL、ARC、L2ARC 這三個重要的機制,以下說明一下這三個機制的特性:

ZIL

因為 ZFS 在寫入的特性是 copy-on-write,因此若是要將 storage 用在大量 sync write 的情境下(例如:ESXi over NFS),要在大量的 IO 下兼顧效率與穩定性,SLC SSD 將會是較好的選擇。
且因為 ZIL 不需要太大容量,因此選擇小容量且高速的 SLC SSD 可以在大量 sync write 的情況下提升不少效能(國外論壇推薦 ZeusRAM)。
【重要】ZIL 要儘量選用耐用的裝置(或是不要設定 ZIL),因為 ZIL 掛掉可能也會造成 zpool 的損毀。(這問題在 ZFS v28 之後似乎已經解決,可參考此討論串)

ARC (Adaptive Replacement Cache)

ARC 是存在於記憶體中的超快速暫存區,大小約為系統總記憶體容量減去 1GB,假設系統共安裝了 32GB 的記憶體,ARC 的容量約為 31(32 - 1)GB。
這表示若是安裝了 32 GB 的記憶體在 server 上,ZFS system 則會使用約 31GB 作為 ARC 暫存讀取資料用。
想當然爾,系統記憶體越大,ARC 空間自然就越大,read performance 自然就會提升。

L2ARC (Second Level Adaptive Replacement Cache)

由於 RAM 價格的關係,ARC 的容量無法無限制的提升,因此 L2ARC 就被用來做為第二部份的 read cache 之用,因此適合使用速度快且符合經濟效益的裝置,以目前的狀況來說 SSD 是最佳選擇。(雖然速度比記憶體慢,但卻比一般硬碟快上許多)
由於此區掛了不會讓 zpool 中的資料損毀,選擇大容量且速度快的 MLC SSD 就可以了,建議容量是 ARC 容量(假設 31GB RAM)的 5 倍以下(150GB SSD),因為 L2ARC 的資料還是需要存放 index 資訊於 ARC 中,所以 L2ARC 容量過大也不會有太顯著的效果,當然選企業級的 SSD 穩定性肯定是更好,推薦 Intel DC S3500/S3700 系列(容量越大速度越快......)。
若是上述例子,做成 80GB SSD striped,效能應該會比單顆 160GB 更好。

ARC + L2ARC = 減少硬碟實際存取次數

當 ZFS 收到  read request 時,會做以下動作:
  1. 到 ARC 尋找資料,找到則 response
  2. ARC 沒有資料,到 L2ARC 尋找資料,找到則 response
  3. ARC 與 L2ARC 都沒有,到 Hard Disk 尋找資料,找到則 response
因此可以得知,若是 ARC & L2ARC 可以 cache 越多常用資料,容量大但速度慢的硬碟存取資料機會相對就會少了許多,資料大多都從 memory & SSD 回傳,自然可以大幅提升 ZFS 的讀取效能。

其他注意事項

  1. 在 ZFS layout 設定中,選擇兩個裝置 for ZIL,ZFS 會將其視為 miror,但 L2ARC 則不會視為 mirror。(實際上也真的不需要....)
  2. L2ARC 可以選用便宜的 MLC SSD,但 ZIL 最好選用 SLC SSD,因為 SLC SSD 較耐用且穩定(速度沒比較快)。
  3. 若是要打造全 SSD 的 ZFS filesystem,L2ARC 也就不需要了.....
  4. 若是要將 ZFS 用於虛擬化環境中,透過 template 產生大量 VM,讓每個 VM 擁有許多共同的資料;在存取時就會被視為常用資料存於 ARC or L2ARC 中,如此一來讀取效率可大幅提升。

參考資料

2013年10月13日 星期日

[Azure] 障礙排除筆記



Q1:從其他資料庫將資料匯入到 Windows Azure SQL Database 時(或是直接新增資料時),出現以下訊息:

Tables without a clustered index are not supported in this version of SQL Server. Please create a clustered index and try again
Ans:Windows Azure SQL Database 規定每個 table 都必須要有一個 clustered index,才可以進行資料的編輯。
新增 Clustered Index 的語法如下:
CREATE UNIQUE CLUSTERED INDEX [index name] ON [Schema Name].[Table Name]([Column Name 1], [Column Name 2], .... etc);

Q2:如何將 Visual Studio、Team Foundation Service、Windows Azure 整合在一起?

Ans:這使用到 Continuous Integration(持續整合) 的技術,請參考此篇文章 => Continuous delivery with Team Foundation Service in Windows Azure

Q3:在專案中加入 Entity Framework 後,在本機測試正常,但佈署到 Windows Azure 卻出現以下訊息:

Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Ans:將專案中的所有參考,在屬性頁中都設定為"複製到本機(Copy To Local)"即可


Q4:在本機中存取 Windows Azure Storage 都正常,但佈署到 Windows Azure Web Site 上後,卻出現以下訊息:

 Could not load file or assembly 'msshrtmi' or one of its dependencies
Ans:Windows Azure Web Site 不支援 Microsoft.WindowsAzure.ServiceRuntime,改用雲端服務(Cloud Services) 即可。

Q5:WCF Data Services 不支援 $format=json

Ans:預設安裝的 WCF Data Services 元件的版本為 5.0.0.0,升級到 5.6.0.0 即可(目前最新版本為 5.6.0.0),同時為了避免部署到 Azure 上之後發生錯誤,必須修改 WcfDataService1.svc 的內容,將 Version 的參數從 5.0.0.0 改為 5.6.0.0














2013年4月10日 星期三

[MCSA] Windows Server 2012 - Install Servers


License

Windows Server DataCenter & Standard 兩種版本都支援 Hyper-V,其中差別在於可用的 VM 數量不同;每一個 Windows Server 2012 的執行個體都可被分類為 POSE(Physical Operation System Environment) or VOSE(Virtual Operating System Environment)。

或有虛擬化的需求,則要按照以下流程安裝:
  1. 進行 POSE 的安裝
  2. 安裝 Hyper-V 的 Role
  3. 透過 Hyper-V Role 來建立 VM 並安裝 VOSE

以下是 Windows Server 2012 各版本合法授權內的 POSE & VOSE 的數量:
  • Datacenter:1 POSE + Unlimited VOSE
  • Standard:1 POSE + 2 VOSE
  • Foundation:1 POSE + 0 VOSE
  • Essentials:1 (POSE or VOSE) + 1 (POSE or VOSE)
以上是各版本合法授權內可用的 POSE & VOSE,但並不代表為軟體的限制;若安裝超過授權數量的軟體,必須購買足夠的授權才行。

Minimum Server Interface

安裝 Windows Server 2012 時,除了可以選擇傳統式的全圖形化安裝,也可選擇最精簡的 Server Core 的安裝方式。

除了上述兩者,還有另外一種折衷的選擇,稱作 Minimum Server Interface,僅留下 Server Manager & MMC Applications(例如:Device Manager & 完整的 PowerShell 介面),足以讓管理者用來管理本地 & 遠端伺服機。

若要讓 Server 變成僅有 Minimum Server Interface,可透過以下步驟執行:
  1. 點選左下角的 Server Manager
  2. 在 Server Manager 的視窗中點選右上角的 Manage -> Remove Roles and Features
  3. 經過了幾個畫面,到了 Features 的視窗,將 User Interfaces and Infrastructure -> Server Graphic Shell 取消勾選,並選擇 Remove
  4. 重新開機



























Features on Demand

Windows Serve 2012 安裝時,安裝程式會將所有相關元件程式放在 C:\Windows\WinSxS 資料夾中,因此若是隨時要啟用特定功能,就不需要使用光碟或是其他安裝媒體。

但若是很多功能都不需要時怎辦? 一堆其他不需要的元件程式都擺在 server 上,若是 server 很多台時,許多寶貴的磁碟空間就浪費掉了;於是,微軟提供了 Features on Demand 這樣的功能。

Features on Demand 針對每種系統程式功能提供了三種安裝狀態:
  • Enabled
  • Disabled
  • Disabled with payload removed

在之前的 Windows Server 版本中,只有提供前兩種,在 2012 裡面提供了第三種安裝狀態,第三種表示除了將特定功能停用外,也移除在 C:\Windows\WinSxS 資料夾中相對應的安裝程式,但此種方式只能透過 PowerShell 的 cmdlet 來完成,假設以上面要移除 Server Graphic Shell 來舉例,就要執行以下指令:
Uninstall-WindowsFeature Server-Gui-Shell -Remove
透過加上 -Remove 參數,指定 2012 將相關的安裝程式一併移除。

不過,將本機上的安裝程式移除了,也不代表沒辦法再度安裝相關的服務或功能,可以透過以下幾種方式重新安裝啟用服務:
  • Windows Update
  • 使用 PowerShell 中的 Install-WindowsFeature 指令搭配 -Source 指定 image 的位置
  • 系統管理員可以透過 Group Policy 指定多個安裝來源

Upgrade Servers

透過 Upgrade 的方式也可以升級至 2012(如果可以,還是儘量執行 clean installation 最穩定),但有以下限制:
  1. 無法從 2008 之前的版本升級
  2. 無法從 2012 pre-RTM 版本升級
  3. 無法從 WorkStation 版本升級
  4. 無法跨版本升級,例如 Enterprise -> Datacenter
  5. 無法跨平台升級,例如 32-bits -> 64 bits
  6. 無法從任何的 Itanium 版本升級
  7. 無法跨語言升級,例如 English -> Chinese

Migration

要從其他版本升級到 2012,比起 Upgrade,Migration 或許是比較好的方式,因為 Migration 是將目前系統中重要的設定,透過 Migration Tool 備份起來後,再移到 2012 上面。

透過 Migration,幾乎就沒有前述 Upgrade 的限制存在,不論是不同的 Version(例:2003 -> 2012)、Edition(例:Enterprise -> Datacenter)、Platform(例:x86 -> x64)、實體轉虛擬、不同的安裝選項(GUI -> Server Core),都可以透過 Migration Tool,搭配 2012 的 Migration Guide 來完成轉移的工作。

但要注意的是,在 2012 上的 Migration,並非像以往一次可以完成,而是將 Role 與 Role Service 分開處理的。

要進行 Migration,首先必須要在 2012 上安裝 Migration Tool,安裝方式如下:
  1. 點選左下角的 Server Manager
  2. 在 Server Manager 的視窗中點選右上角的 Manage -> Add Roles and Features
  3. 經過了幾個畫面,到了 Features 的視窗,勾選 Windows Server Migration Tools,選擇 Next -> Install 即可,如下圖:




























但 Migration Tool 的使用,又是另一個 topic 了,下回有讀到再來分享!

問答時間

Ralph recently took delivery of a new server with Windows Server 2012 Datacenter Edition already installed with the full GUI option. Ralph wants to configure the system as a web server, using the absolute minimum of hardware resources. His first step is to use Server Manager to install the Web Server (IIS) role.
With this in mind, answer the following questions:

1. What PowerShell command should Ralph use to convert the full GUI installation to Server Core?
Ans: Uninstall-WindowsFeature Server-Gui-Mgmt-Infra,Server-Gui-Shell –Restart

2. What PowerShell command should Ralph use to remove the GUI installation files completely from the system?
Ans: Uninstall-WindowsFeature Server-Gui-Mgmt-Infra,Server-Gui-Shell -Remove (加上 Remove 參數即可)

3. Which of the following roles implement what can be classified as infrastructure services? (Choose all that apply)
A. DNS
B. Web Server (IIS)
C. DHCP
D. Remote Desktop Services
Ans: A & C
【備註】IIS & RDS 屬於 Application Service,不屬於 Infrastructure Service

4. Which of the following is a valid upgrade path to Windows Server 2012?
A. Windows Server 2003 Standard to Windows Server 2012 Standard
B. Windows Server 2008 Standard to Windows Server 2012 Standard
C. Windows Server 2008 R2 32-bit to Windows Server 2012 64-bit
D. Windows 7 Ultimate to Windows Server 2012 Essentials
Ans: B

5. Which feature must you add to a Windows Server 2012 Server Core installation to convert it to the Minimal Server Interface?
A. Graphical Management Tools and Infrastructure
B. Server Graphical Shell
C. Windows PowerShell
D. Microsoft Management Console
Ans: A
【備註】B 選項會安裝成 Full GUI,C 選項僅有 Command Line 模式,D 選項是 Minimal Service Interface 的其中一個圖形化應用程式,無法單獨安裝

6. What is the name of the directory where Windows stores all of the operating system modules it might need to install at a later time?
A. Windows
B. System32
C. bin
D. WinSxS
Ans: D

7. Which of the following are valid reasons why administrators might want to install their Windows Server 2012 servers using the Server Core option? (Choose all that apply)
A. A Server Core installation can be converted to the full GUI without reinstalling the operating system.
B. The PowerShell 3.0 interface in Windows Server 2012 includes more than 10 times as many cmdlets as PowerShell 2.0
C. The new Server Manager in Windows Server 2012 makes it far easier to administer servers remotely.
D. A Windows Server 2012 Server Core license costs significantly less than a full GUI license.
Ans: A & B & C

2012年12月22日 星期六

[.NET] 輔助開發工具

Entity Visualizer

Entity Framework Debugger Visualizer to display SQL source code generated by Entity Framework.

ADO.NET Entity Framework Query Samples


ADO.NET Entity Framework Query Samples is a small Windows Forms program which contains several basic Entity SQL and LINQ to Entities queries against that NorthwindEF Entity Data Model (a modified version of Northwind).
Its goal is to help you learn the features of the different query languages available in the Entity Framework, and to let you visualize how the results and the translated store queries look like.

LINQPad


LINQPad supports everything in C# 5.0 and Framework 4.x:
And that's not all - there's also specific support for:
LINQPad is also a great way to learn LINQ: it comes loaded with 500 examples from the book, C# 5.0 in a Nutshell.  There's no better way to experience the coolness of LINQ and functional programming.

2011年9月16日 星期五

[ASP.NET] Performance Tuning

1. 使用 SqlCommand 搭配 SqlDataReader 時,記得先呼叫 SqlCommand.Cancel() 再呼叫 SqlDataReader.Close(),順序錯誤效能會低落很多
    (若僅呼叫 SqlDataReader.Close() 效能也會很低落)

2. 資料來源控制項的 DataSourceMode 要根據實際需求選擇
    (選擇 DataSet 模式,功能雖然強大,但耗費資訊)

3. 處理大量資料避免使用 ADO.NET Entity Framework 這一類的工具,速度很慢

2011年8月3日 星期三

[.NET] 如何不安裝 Oracle Client 並與 Oracle DB 連線

恩.......我目前手邊這一台 NB 真的很怪....無法安裝 Oracle Client....

但是我要連 Oracle 阿!! 這該怎辦ㄌㄟ....

上網找了一下,必須要在程式執行目錄(bin/)中,放入以下五個 DLL 檔案:

  1. Oracle.DataAccess.dll
  2. oci.dll 
  3. OraOps11w.dll
  4. oraociei11.dll
  5. msvcr71.dll
這些檔案可以在有安裝 Oracle Client 的電腦上找到....我是請同事找給我的.....


另外在連線字串部分,沒辦法使用 OracleDBConnectionStringBuilder 物件產生連線字串,必須用自行組成語法的方式:
string DBConnectionString = @"Data Source=(DESCRIPTION = (ADDRESS_LIST =
                                    (ADDRESS = (PROTOCOL = TCP)(HOST = 這是 Oracle Server IP)(PORT = 1521)) )
                                    (CONNECT_DATA = (SID = 這裡放SID)(SERVER = DEDICATED) ) )
                                    ;Persist Security Info=True;User ID=這是使用者帳號;Password=使用者密碼;";

最後程式中引用 Oracle.DataAccess.dll 作為參考,相關的 Oracle API 就可以使用囉!


2011年6月1日 星期三

[LINQ] 集合已修改; 列舉作業可能尚未執行??

今天同事在寫程式遇到這問題.....

問我.... LINQ 可以在 multi-thread 環境下執行嗎?? 程式起來一直有問題......

我心裡想......怎麼會不行? 如果不行,微軟不就搞了一個大飛機了..........?

後來發現其實跟 LINQ 無關,而是在進行列舉作業時不能去修改集合的值

[JVM] Performance Tuning 相關資源蒐集

JVM調優總結- See World - ITeye技術網站

JVM調優總結(一)-- 一些概念- 和你在一起- ITeye技術網站

JVM調優總結(二)-一些概念- 和你在一起- ITeye技術網站

JVM調優總結(三)-基本垃圾回收算法- 和你在一起- ITeye技術網站

JVM調優總結(四)-垃圾回收面臨的問題- 和你在一起- ITeye技術網站

JVM調優總結(五)-分代垃圾回收詳述1 - 和你在一起- ITeye技術網站

JVM調優總結(六)-分代垃圾回收詳述2 - 和你在一起- ITeye技術網站

JVM調優總結(七)-典型配置舉例1 - 和你在一起- ITeye技術網站

JVM調優總結(八)-典型配置舉例2 - 和你在一起- ITeye技術網站

JVM調優總結(九)-新一代的垃圾回收算法- 和你在一起- ITeye技術網站

JVM調優總結(十)-調優方法- 和你在一起- ITeye技術網站

JVM調優總結(十一)-反思- 和你在一起- ITeye技術網站

JVM調優總結(十二)-參考資料- 和你在一起- ITeye技術網站

2011年5月31日 星期二

[Windows] 修改 JVM 啟動參數

今天早上為了 H2 執行五六個小時後會出現 out of memory 的問題在頭痛...

上到 Google Group 查了一下,有人建議先把 JVM 的 heap 開大一點試試看....

於是.......問題來了,要怎麼開大??

在 Linux 裡面可以直接透過 Alias 的方式解決.......

那 Windows 呢? 答案就是設定一個名稱為 "_JAVA_OPTIONS" 的環境變數

值的部分就設定為 "-Xms512m -Xmx1024m" 應該是很夠用了....

再來繼續長時間測試 H2 看看.....