250 likes | 272 Views
contentXXL: performance analysis and optimization. Table of contents. Overview / Intro Chapter 1: Server Hardware – System Requirements Chapter 2: Operating System Configuration Chapter 3: Internet Information Server Configuration Chapter 4: SQL-Server Configuration
E N D
Table of contents • Overview / Intro • Chapter 1: Server Hardware – System Requirements • Chapter 2: Operating System Configuration • Chapter 3: Internet Information Server Configuration • Chapter 4: SQL-Server Configuration • Chapter 5: contentXXL Configuration • Chapter 6: http Traffic Monitoring • Chapter 7: Performance Monitoring • Chapter 8: Load Simulation • Appendix: Tools usedforanalysisandoptimization
Overview / Intro The followingchaptersdescribestepbystephowtoanalyseand tune upyour contentXXL installation. All knowledgeandinformation in thisdocumentationisbased on contentXXL 3.0.2630. These componentsaremostresponsiblefortheperformanceof contentXXL: • Server hardware (processors, memory, diskdrives) • Operating systemconfiguration (service pack status, virutalmemory, network, 3rd partysoftware) • Internet informationserverconfiguration (applicationpool, http headers) • SQL-Server configuration (memorymanagement) • contentXXL configuration (outputcache, generalportalsettings) Note: Only an inter-balancedsystem (of all components) can roll out itsfullachievement potential!
Chapter 1: Server Hardware – System Requirements The hardware must meet the requirements for Microsoft Windows Server and especially Microsoft SQL-Server: • Microsoft Windows Server system requirements: http://technet.microsoft.com/en-us/windowsserver/bb430827.aspx • Microsoft SQL-Server system requirements: http://www.microsoft.com/sql/prodinfo/sysreqs/default.mspx The hardware must meet the requirements for contentXXL (see Installation Manual for details): Please consider that an adequate performance can never be reached with a minimum system configuration.
Chapter 2: Operating System Configuration (part 1) On operating system side the following things should be checked: • /3GB Switch • A 32-bit Windows systems with more than 3GB of physical RAM must have the /3GB switch set within the boot.iniMore information: http://www.microsoft.com/whdc/system/platform/server/PAE/PAEmem.mspx • Virtual memory / pagefile • Have the initial size be at least 1.5 times bigger than the amount of physical RAM. Do not make the Pagefile smaller than the amount of physical RAM you've got installed on the server. • Set the initial size as big as the maximum size. • If possible move the pagefile off the disk that holds system and boot partitions to another fast and dedicated hard disk. If possible avoid putting a pagefile on a fault-tolerant drive, such as a mirrored RAID-1 volume or a RAID-5 volume. • Processor sheduling and memory usage • Processor sheduling must be set to: „Adjust for best performance of: Background services“ • Memory usage must be set to: „Adjust for best performance of: System cache“ • Update / patch status • We recommend: Microsoft Windows Server 2003 Service Pack 2 should be installed. • We recommend: Microsoft SQL-Server 2005 Service Pack 2 should be installed. • Check the Windows Update Website for critical system updates.
Chapter 2: Operating System Configuration (part 2) • Check out theevent log forpossibleerrors • In application log especiallytakecareabout ASP.NET errors. Most ofthiserrorsarereturnedas http error 500 (Server Error in Application) totheclient. • In security log takecareaboutauthorizationfailures.Authorizationerrorscan happen e.g. if asp.net impersonationisusedwithincorrectusernameorpassword. • In system log especiallytakecareabout Service Control Manager errors.If a Windows Service can not bestartedoristerminatedabnormally a Service Control Manager errorislogged. • Test thenetworkconnectionbetweenthe web serverandthesqlorfileserverPerformance problems in contentXXL canbecausedby a poornetworkperformance e.g. between web andsqlserver. Different tools canbeusedfortestingthenetworkconnectionandbandwidthbetween a clientand a server. Oneexample: Howtotest a networkconnectionwithiperf.exe: • copythe iperf.exe to a folder on theclientandtheserver e.g. c:\temp • open a comandlinewindow on theserver an execute iperf.exe withthefollowingparameters: iperf.exe -s -w256k • on yourtestclientexecute iperf.exe withthefollowingparameters: iperf.exe -c 192.168.10.12 -w256k (usetheserversipadress) • after 10 secondsiperfdisplays a smallbandwidthstatistic. Useitto find out bottleneckswithintheexistingconfiguration. • x Fig.: the connection between the client and the server is perfect. Nearly 1GB/s.
Chapter 3: Internet Information Server Configuration (part 1) • IIS Application Pool settings (recommendations) • Try to use as few application pools as possible. Note: each application pool consumes memory! • Disable the automatic process recycling. Use fixed sheduled recycling times instead. E.g 3:00 a.m. • Configure the value for „Maxium used memory“. Recommendations: On a dedicated contentXXL server, 32Bit Windows/Framework, 4GB RAM, running SQL-Server: ~2500 MB On a dedicated contentXXL server, 32Bit Windows/Framework, 4GB RAM, seperate SQL-Server: ~3000 MB On a dedicated contentXXL server, 64Bit Windows/Framework, 8GB RAM, running SQL-Server: ~4000 MB • Disable the process shutdown in idle mode. • Set Request Queue Limit to a value between 1000 and 4000. Normally 1000 should be enough. • Disable process CPU monitoring. • Use only 1 worker process in the web garden configuration. • Disable process pinging and rapid-fail protection. • Set startup limit to 60 seconds and shutdown limit to 120 seconds. • Process idendity configuration should be set to „Network Service“.
Chapter 3: Internet Information Server Configuration (part 2) • Virtual web serversettings • Disable W3SVC loggingifpossible. Thisreducesthe I/O on theharddrives. Ifitcan not bedisabledplacethelogfiledirectory on a fast harddiskdrive. • Activate „contentexpiration“ in http headersettingsforthefollowingdirectories. Set theexpiration time to 1 day. This will enabletheclienttocachethesitemanagercomponents (buttons, gifs, etc.). /aspnet_client/ /componentart_webui_client/ /contentxxl/admin/ /contentxxl/images/ /images/ /webctrl_client/ /_calendar/ • Use a custom http headerforthe desktopdefault.aspx. This will enabletheclienttocachethe desktopdefault.aspx. Recommended valuesare: Cache-Control = private, must-revalidate, max-age=0 Vary = User-Agent
Chapter 4: SQL Server Configuration • Set a memory limit for SQL Server In most environments it makes no sense to assign unlimited memory to the SQL Server. Unusually it will increase the performance of contentXXL. A value between 800-1000 MB should be enough, 500 MB if you are in a low memory situation. • Backup the transaction log regularly A huge transaction log file can result in a poor SQL performance so make sure to have a sheduled backup of the transaction log.
Chapter 5: contentXXL Configuration (part 1) • Page Output Cache • Create a pageoutputcacheconfigurationfileandoptimizeitfortheserverenvironment. More information: http://partner.contentxxl.com/desktopdefault.aspx/tabid-30/30_read-285/ • Set thepageoutputcachetimeout in theportalsettingsofthesitemanager. Toset a perfecttimeoutvalue all ofthefollowingparametersshouldbeconsidered: …amountofmemoryconfiguredfortheapplicationpool. …amountofpages in theportalwhichshouldbecached. …amountofbaseurls in theportal. …amountofuserroleswhichshouldbecached. Ifconfiguredcorrectly a pageoutputcacheisgeneratedfor… …eachbrowser type. …eachbaseurl. …eachuser (ifcachingisconfiguredforlogged on users). • Dataset cache • Set thedatasetcachetimeout in theweb.config. Standard valueshouldbe 600 (seconds). Check theresultsofthecachingconfigurationwiththeperformancemonitor (describedlater in thisdocumentation).
Chapter 5: contentXXL Configuration (part 2) • Completetheportalsettings • Enable „Replace RAID by absolute path“. > Neededtocacheresources on clientside. • Enable „Generatestaticcssfiles“. > Neededtocachethecssfiles on clientside. • Alwaysdisabletheusertrackerif not needed. Thisdecreasesthedatabaseload. • Checkouttheweb.config • Cleanupunusedentries (especiallytheold http compressionmodule). • Usetheqw_usepolicyonlykeyifpossible. • Disablethecompilationdebugmode. • Usethe contentXXL binariescompiled in RELEASE MODE (AnyCPU). The releasemodebinariesrun a littlebitfasterandconsumeslessmemorythedebugmodedlls. Toswitchintoreleasemode: • Empty the /bin folder (exceptcustomdlls) • Copy all filesfrom /bin/releasesubdirectoryto /bin. • Restartthe IIS services.
Chapter 6: http Traffic Monitoring • Use the Fiddler Tool to monitor the http traffic of between the web server and the client. Take care about 40x and 50x errors. If client chaching is used the Fiddler protocol should display only a few entries if a page is refreshed.
Chapter 7: Performance Monitoring • Use the Windows Performance Monitor to check out the behavior of the system. Counters used: More information about the results and how to read them: http://partner.contentxxl.com/desktopdefault.aspx/tabid-34/29_read-762/
Chapter 8: Load Simulation • For stress test and load simulation we recommend using Microsoft Visual Studio 2005 Tester Edition. A free 180 day trial is available here: http://msdn2.microsoft.com/en-us/evalcenter/bb188238.aspx For more information about Microsoft Visual Studio 2005 please contact Microsoft.
Appendix: Tools used for analysis and optimization • Iperf (Network testing tool): http://dast.nlanr.net/Projects/Iperf/ • Fiddler Tool (http debugging proxy): http://www.fiddlertool.com • Microsoft Visual Studio 2005 Team Suite – 180 day trial: http://msdn2.microsoft.com/en-us/evalcenter/bb188238.aspx