|
Performance Tuning for Speed and ScalabilityHere is my concise reference on the business of tuning (tweaking) servers and applications as part of performance monitoring and performance testing |
|
Aspects of Tuning
There are several
factors (variables) that affect the performance and scalability of a system.
The optimal
“Horizontal scaling” (out) adds additional server boxes to a cluster of servers obtaining work from a load balancer.
An appliance (firewall and SSL processor) replaces a general purpose computer.
II. Individual machine Configuration
III. Network Settings IV. Operating System Settings for Windows Linux Solaris V. Database and Application Software Settings
VI. Source Code Configuration Tweaks VII. Source Code Programming Tweaks
|
Scaling OutRoger Wolter uses these illustrations in his Scaling Out SQL Server 2005:
Table partitioning:
Planning, Implementing, and Administering Scaleout Solutions with SQL Server 2005 by Bob Beauchemin David Campbell's Service-Oriented Data Architecture: App-Server:Lite? |
The Approach To Tuning
This flowchart covers the bases of tuning efforts. It is from Darren Broemmer's
Although the code examples in the book are dated (using the version 1.0 perform method rather than Struts 1.1), the summary is valid. The flowchart in table form:
My plan is based on the
"Premature optimization is the root of all evil." — Donald Knuth, pioneering computer scientist |
Tuning WorkflowAs with other LoadRunner modules, Mercury Tuning uses a separate VuGen program to create scripts. Those scripts are run by another program as part of a workflow of steps within Tuning Sessions. A third "analysis" program analyzes results from tuning sessions.
New Tuning Session step files (file extension .prs) are
created from a template of steps called "cartridges" (file extension .__).
My session steps include tasks for capacity modeling
"Progress Dashboard" The Tuning Console tracks Each time you run this step, an entry is added to the progress dashboard to help you achieve your goals. The Tuning Console lists all the logs and their properties for each host and service. You can also scan the logs for errors according to predefined rules. You can also define your own rules and export them as part of a cartridge (please refer to the product documentation). Note: 1. Before you can scan logs, you need to install and run tuning agents on the servers where the log files are situated. 2. The log scan step is available only for the services that are handled by the tuning agents. In other words, if the tuning agent cannot handle a particular service, the service's log file cannot be scanned, even if the server itself is running a tuning agent. 3. It is not recommended to scan large logs (>1MB), as this is time- and resource-consuming. Server configuration tab. After you define the environment in the Topology window, the Console attempts to connect to the tuning agent running on each host in the topology. If a tuning agent has not been installed, or has been installed but not started, the attempt will fail. Make sure that the Console can connect to the tuning agents on the host machines. For details, see the section on tuning in the documentation. Mercury's Performance Tuning Network at tuning.merc-int.com is not operational. I filed a bug report on this July 06. lr8.lrtun81.notconcurrent.bmp
|
OS Configuration Speed Tweaks
To reduce Internet traffice and latency time between clients and servers, reduce the need for all traffic to travel to one origin server by deploying global forward cache engines to mirror (duplicate) Web site content forward -- out geographically closer to clients. Note, however, that content freshness checks may add up. Different ways to architect a transparent to intercept (filter) traffic and redirect it to a cache:
|
Windows Client Machines TCP/IP Settings Are Tuned
HKEY_CURRENT_USER\Microsoft\Windows\CurrentVersion\Internet Settings
Historically, Windows 98 by default is set to handle a small number of connections. This can be increased by changing system registry key
"MaxConnectionsPerServer"=dword:00000010 "MaxConnectionsPer1_0Server"=dword:00000010 Increase this to 100. More than that, machines get overloaded.
|
|
Tweaking Windows Server Settings[_] Page File LocationCreate an additional pagefile on its own partition so that Windows can make multiple I/O requests quicker. The pagefile will not be fragmented. Choose "Create" and not "Move".Set Windows Page File SizeRather than letting Microsoft Windows dynamically obtain more space for its Windows Page File set from the Windows Start menu choose Settings Control Panel, Advanced tab, Performance options.[_] In the Performance dialog box, change the page file setting for the amount of memory, plus 24MB. For example, a machine with 2GB RAM should have a page file size of 2024GB. There should be at least a 127MB pagefile on the boot partition to accomodate memory dumps in case of Kernel mode STOP error, after which the page file is written only on the boot partition.
|
Tweaking LinuxPerformance Tuning for Linux Servers (IBM Press, 2005, 574 pages) by IBMers Sandra K. Johnson, Gerrit Huizenga, and Badari Pulavarty Optimizing Linux Performance : A Hands-OnGuide to Linux Performance Tools (Prentice Hall PTR, March 14, 2005) by Phillip G. Ezolt, of Compaq's Alpha performance group and HP's representative to the SPEC CPU subcommittee. Performance Assurance for IT Systems (Auerbach Publications, 2005, 376 pages) by Brian King Introscope from Wily Technology pinpoints component-level bottlenecks in J2EE applications. JProbe from Sitraka |
Tweaking Solaris
| Solaris Performance Administration (McGraw-Hill © 1998) by H. Frank Cervone |
Application Settings Tweaks
Java App Server Application Tweaks
|
|
Architecture Tweaks
Before doing "open heart surgery" on source code, consider these strategies:
|
Source Code Configuration
7.1 Whitespace and comments are removed from Javascript and CSS codeWhitespace (space characters, extra line breaks, and tab indents) make javascript code more human readable. Generally, the more whitespace, the easier it is to read a source code (which is a good thing). However, whitespace can take up as much as half the total number of bytes in a source code file. Since whitespace characters are not needed for programs, whitespace make files take longer to download, which slows performance. Removing whitespace and comments make it more difficult for others to reverse engineer ("steal") the intellectual property in code. Make text compression an easy and automatic by using shell/command scripts that also checks code into the source repository. This way, developers continue to work on commented source files while compressed files are in a separate folder referenced by users. Whitespace in Javascript files can be removed quickly by compression utilities:
Static CSS code compression utilities include:
|
Including comments make it more difficult for competitors to reverse engineer ("steal") code. |
Source Code Programming Tweaks
Before doing "open heart surgery" on source code, consider these strategies:
Java compilers, as with most other programming languages, use several optimization techniques:
Within applications code:
|
RootCause from OCSystems runs on top of the Aprobe technology, providing a user interface that makes Aprobe simpler and easier to use. However, the full power of Aprobe is available under the hood. You can write application-specific probes to monitor anything, collect any data, and perform virtually any task you need. |
JVM EnhancementsMajor middleware vendors provide their own JVM Rob Levy, chief technology officer, BEA Systems, claims that BEA's JRockit 5.0 JVM for BEA WebLogic Server 9.0 "continues to impress and set the industry benchmark as the world's fastest JVM for large-scale, mission-critical, server side applications."
On December 09, 2005, BEA and Mercury announced their "strategic alliance":
JRocket captures and presents garbage collection pauses, memory utilization and CPU usage, as well as information from any JMX MBean deployed in the JVM internal MBean server. This gives developers and system administrators real-time visibility and control over the inner workings and behaviors of multiple JVM instances in a network. Since capture is real-time, unlike Sun's JVM, initiating a troubleshooting session does not require a server restart. BEA claims that the tracing is provided "without introducing the performance overhead normally associated with tools of this type." That's because they count performance "overhead" as part of the standard overhead of the server. And that's as it should be. So maybe now it won't require an "act of congress" to obtain JVM stats from production machines. |
Code Execution Profiling
A 20% improvement to a section of code that executes 50% of the time
will yield a 10% improvement.
|
Common Language Runtime (CLR) Profiler (v2) for .NET applications Writing Faster Managed Code: Know What Things Cost (June 2003) by Jan Gray, Microsoft CLR Performance Team describes a low-level cost model for managed code execution time using the Download a zip file containing the million-plus lines of source code of Microsoft's Shared Source, (Microsoft internal codenamed "Rotor") standardized implementation of the ECMA-335 CLI and ECMA-334 C# language specification.
Shared Source Newsgroups at Microsoft, the University of Pisa, and Developmentor Writing High-Performance Managed Applications: A Primer by Gregor Noriskin Garbage Collector Basics and Performance Hints by Rico Mariani Performance Tips and Tricks in .NET Applications by Emmanuel Schanzer
[Managed] Code Optimization, Sept. 10, 2002
.NET Show "Enter the Programmer" interview of Ivan Mladenov, Patrick Dussud, and Gregor Noriskin about their
Shared Source CLI Essentials (O'Reilly and Assoc., 2003) by David Stutz, Ted Neward, Geoff Shilling The Common Language Infrastructure Annotated Standard by James S. Miller (Microsoft architect), Susann Ragsdale, Jim Miller Invoke Virtual Address Dump (VaDump.exe) Platform SDK Tool with
This lists information about the memory usage of the process associated with the specific process id:
|
Real-time Application AnalyticsLoadRunner Diagnostics with Probes Panorama — which OPNET (NASDAQ: OPNT) bought in Aug. 2004 from Altaworks.com — identifies potential sources of poor performance by providing dashboards for ongoing monitoring and drill downs into specific application components. Most impressive is its Analysis Engines which automatically determines which events and metrics are statistically related, and alerts people when deviations exceed norms. BEA's JRockit Management Console ... |
Log Replay
AppSight from Identify corporation (formed in Petach-Tikva, Israel by ex-Mercury founder Yochi Slonim) has "black boxes" that spew out logs from Windows, .NET, and J2EE servers. Performant's US$50-80,000 OptiBench 2 product (acquired for $22.5 million by Mercury in 2000) extracts performance data from live, running production J2EE apps by inserting instrumentation byte-code into jar files at each tier:
They say their instrumentation creates an overhead of 1-5% in HTTP web servers and 1-7% in the JVM, depending on the threashold set for when workload is captured to files in a repository. Workload files are used to "playback" workloads within a test environment for diagnosis and for validating fixes/changes. Note: "Performant" ( kinda like "compliant") is a French word that means "efficient" in English. Application-Oriented IT Modeling Using Mercury Capacity Planning and Mercury LoadRunner Archive by Rajesh Radhakrishnan, Sr. Director Product Marketing, recorded December 6, 2004 |
Java 5.0 JMX Java Management (MBean) Extensions
Java 5.0 ushered in a new era for application monitoring and management with its Java Management Extensions (JMX) API implemented as the javax.management package that manipulates MBeans representing a device, an application, or other manageable unit
These names are used by the
Sun Reference Implementation (RI) that need to be added to the CLASSPATH.
In its zip lib are jmxri.jar (containing implementations of JMX APIs and the agent),
and jmxtools.jar (containing adaptor classes such as the HTTP protocol adaptor,
class com.sun.jdmk.comm.HtmlAdaptorServer in Sun’s Java Dynamic Management Kit (JDMK)).
Because JMX is a generic, unified, and standardized framework (and protocol), it has enabled a new industry of JMX management clients (managers) in tools for J2EE tuning, testing, tracing, and monitoring. The services JMX provides for application management are: Images from http://skillport.books24x7.com/book/id_5115/toc.asp Managing Java Applications Using JMX API SkillSoft Press © 2003 There are 3 levels to the JMX architecture: The m-let service enables the dynamic loading of MBeans in the JMX agent at run time, and the relation service creates and maintains relationships between MBeans. Different MBean interfaces differ in how they expose the management interface of the application resource to the agent: public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException; To create and register a standard MBean: http://www-128.ibm.com/developerworks/websphere/downloads/ |
Services for Runtime Settings
Microsoft's runtime for services manages the execution of services according to attributes or configuration settings you set:
|
Portions ©Copyright 1996-2014 Wilson Mar. All rights reserved. | Privacy Policy | Last updated
| Related Topics:
|
| Your first name: Your family name: Your location (city, country): Your Email address: |
Top of Page
Thank you! |