Home > Articles > Programming > Java

This chapter is from the book

The Servers

The network connects all the components of your web site. Let's next go up a level and consider the server components you need in the test environment.

Application Server Machines

In terms of configuring the web application servers, strive to make the test configuration as close to the deployment configuration as possible. If you're deploying to a farm of four-way Sun machines with 8GB of RAM, you should use the same equipment during your testing, if at all possible.

Even though the Java web application server might port to different platforms, web applications do not perform and scale the same on a one-way NT box as on a four-way Sun box. If you must choose between fewer servers for your test or smaller servers, pick fewer servers. When you use fewer servers, scale the other components of the test (databases, HTTP servers, and so on) proportionally as well.

If you deploy the web application on multiple machines in a cluster, then test on multiple machines in a cluster as well. Get a representative number: If you plan to deploy on more than four machines, test on more than two. If your target environment contains eight application server machines or more, then four application servers in your test environment should suffice, as long as you scale the rest of the test web site proportionally to match.

We often encounter test teams trying to test and tune all the software used in their web site (application servers, databases, HTTP servers, etc.) on a single machine. However, this technique doesn't work if the production web site actually uses multiple machines. For example, many production web sites separate their HTTP servers from their application servers. Often the production team places the HTTP servers in a DMZ with firewalls in front and behind, as shown in Figure 9.3. It is impossible to successfully performance test for this configuration with a single server machine. If the web site uses SSL, for example, the HTTP server needs so much CPU for encryption/decryption that it chokes the performance of the application server.

Figure 9.3 Figure 9.3 Typical DMZ configuration for application servers


Database Servers

Most production web sites use mid-tier database servers to hold application data or data specific to the web site (such as an HTTP session database). Often the web applications access these databases on every user request. Despite their central role in the operation of the web site, the mid-tier databases sometimes receive little or no tuning before the site enters production deployment. Often the test team lacks the database administrator (DBA) skills required to tune the database properly. Thus the team ignores the database unless they stumble across a specific problem in production. The problems we see frequently with databases usually fall into one of two broad categories: Poor software configuration or poor hardware configuration.

Poor Database Software Configuration: Indexing

By far the biggest database tuning problem we encounter is poor table indexing. Usually the problem starts this way: The test team receives a database backup from the production database staff. They dutifully load the database definition and the data itself, but never bother to build indexes for the tables they've just loaded. In fact, they may not even know what an index is, much less how to build one. Chapter 6 discusses how to put together the performance test team, including DBA skills needed to tune environments using databases.

The index allows the database software to find elements in a table without scanning the table repeatedly. This saves tremendous amounts of resource, particularly CPU. Also worth noting, the DBA may build new indexes and remove old ones as usage patterns change over time. New indexes apply even when web applications use existing databases. Often these databases contain indexes tailored for existing applications, but they might require new ones to better support the web application. By monitoring database reports, the DBA determines the web application's usage patterns and makes appropriate adjustments. The DBA may also review the SQL used in the web application to find out where indexes might be most beneficial.

Poor Database Software Configuration: Internal Resources

Web applications receive many simultaneous requests. In turn, they make a proportionally large number of simultaneous requests to the database servers supporting them. These database servers need enough resources to support large volumes of simultaneous requests. These resources include things such as buffer pools, cursors, and sockets to support high-bandwidth operation.

Regrettably, we often see high-concurrency web sites struggling to pull data from databases tuned for small, fat client applications. New applications and usage patterns require a fresh look at the tuning parameters for the database. Do not assume the database is tuned properly because the DBA made a few tweaks some years ago for the usage patterns of a fat client application.

Poor Database Software Configuration: Caching

Particularly for sites with enormous application databases, the database cache becomes very important for optimal site performance. The cache holds the results of the most common queries and makes an impact on sites with large catalogs of items but a few frequently accessed "best sellers." These items return from the cache quickly without an expensive retrieval from the hard disk.

Caching helps some web sites, but a few cannot take advantage of this feature. For example, if every query submitted by the web site is unique (if, say, every query contained the user's account number), the cache may not return a hit even though the query may return items retrieved many times before. The web site team might want to work with the DBA to build queries better able to use the caching mechanisms available.

Poor Database Hardware Configuration: I/O Management

Eventually, all databases interact with the hard disks to read or write data. Database tuning often focuses on the CPU required by the database server without focusing on how to manage the storage required by the same database. We sometimes see very large multiple-processor database machines spending most of their time waiting to access one tiny hard disk. Adding CPU does not solve disk I/O problems.

If the database server spends most of its time waiting to read or write from the disk, tune the I/O resources. If the database supports it, try adding a multiplatter disk array to the database server. By using multiple disks, the database spreads out the read and write operations for better simultaneous access. The database reads and writes spread out across multiple points rather than queuing up on a single disk. Figure 9.4 shows an example using multiple disk platters.

Figure 9.4 Figure 9.4 Single-disk versus multidisk database I/O


Likewise, the hard disks themselves often contain tunable features. Some disks allow the system administrator to specify buffering to the disk, which may also improve performance. Some databases write more efficiently to disk than even the native file system itself. For example, IBM's DB2 database product provides mechanisms for "raw" I/O management (DB2 bypasses the file system to write directly to the disk) and for multidisk data writing.

Finally, when spreading the data to multiple hard disks, don't forget about the database logs. Databases keep detailed logs for rollback and recovery purposes. Every action taken by the database must be logged, and this requires a write to the hard disk. "Striping" these logs across multiple hard disks, if supported by the database, often improves disk I/O wait times.

Legacy Servers

Legacy servers and their applications present daunting challenges to web site test teams. First, the legacy system usually resides beyond the control of your test team, on a host machine somewhere. (The system may not even reside in the same state as the test team!) Secondly, customers and internal user applications run against the legacy systems during the day and sometimes even during nighttime hours. Finally, these systems require tuning, just like the web application and web site, particularly if the system doesn't currently support a high-volume, multi-threaded application.

The first issue, access, requires teamwork to resolve. You need help from the teams supporting the legacy systems to collect performance statistics during the test runs. Also, since the test team usually does not have the skills necessary to tune the legacy systems, you need the legacy support team available to make any tuning adjustments on these systems. We frequently encounter teams attempting a test using legacy systems without assistance from the legacy support team. Invariably, these tests fail because the test team cannot on their own find and resolve bottlenecks on these systems.

The support teams also come in handy to resolve the next issue: scheduling. Do not run performance tests against a legacy system in use by customers or in-house applications. Performance tests, by their nature, attempt to drive resources involved in the test to their full utilization. For example, if the web site makes use of a host database shared by multiple applications, the performance test might drive the database to 100% utilization, effectively locking the other applications out of the database. Figure 9.5 illustrates this point.

Figure 9.5 Figure 9.5 Testing live legacy systems


The legacy system, however, might be available in the evenings or late at night. Many test teams use these off-shift hours to run performance tests against web sites using these systems. This solution works well if you keep a couple of points in mind.

  • The tests cannot run unattended. Despite the impact on your social life, performance testing requires many, small iterations to obtain measurements and make tuning adjustments. You also need assistance during these runs from the legacy support team to monitor their systems and make necessary performance adjustments. Later, after finalizing the key performance adjustments, the subsequent long run and stability tests, happily, run overnight with little human intervention.

  • Know your legacy system backup and maintenance schedules. Again, the support teams for the legacy system play a big role in obtaining this information. The legacy systems frequently use the nighttime hours for system maintenance and backups. The performance test cannot run during these operations: Backups and maintenance take lots of system resource and result in abnormal readings for the performance test.

Before scheduling an off-shift test, discuss the maintenance schedule with the legacy support team to either fit the test into an existing schedule or to modify the schedule to fit the test. Also, be aware of maintenance on other systems with the potential to impact the test environment. For example, a system backup crossing the network might disrupt your testing.

  • Sometimes you cannot run tests against the production legacy system at any time. If this is the case, consider rebuilding the legacy system inside a test system.

Finally, tuning the web application requires tuning the legacy system to which it connects. When visiting web site teams testing web applications using legacy systems, we commonly encounter the following problems:

  • The web site generates more traffic than ever seen before at the legacy system. Remember, a lot of legacy systems exist to support fat client applications. These applications generate less traffic than a popular public web site. The legacy system needs tuning to support such a site, and a good performance test normally brings this issue to light. Legacy application tuning tasks fall into the following general areas:

  • Adding connections to handle the large number of simultaneous requests from the web applications.

  • Providing a larger region for the legacy application to execute.

  • Increasing memory buffers for the internals of the applications (particularly important for database applications).

  • Adding processing capacity. Sometimes the increased burden on the host system warrants additional processing capacity.

  • The connection software used by the web application also frequently requires tuning. Here's a list of some of the problems we run into regularly with connection software:

  • The connection software needs more bandwidth. The software often requires adjustment to support the large number of simultaneous connections the web application requires.

  • Home-grown connection software designed for a fat client application does not usually work for a web application. Most web applications run as multi-threaded applications. They need the ability to send multiple, simultaneous requests to the back-end legacy host system, something most fat client applications don't require. Often the web site team discovers too late that their custom connection software isn't thread safe for multi-threaded access. Whenever possible, we recommend using commercially available connection software. Otherwise, check the connection software early on for thread safeness.

Production web sites often use back-end legacy systems. Most of the problems we encounter with these systems during performance tests find their roots in a lack of communication between the web site team and the legacy support teams. The legacy support team belongs in the planning and tuning effort for every web site using the resources under their care.

Host Database

Host databases share all the problems of other common legacy systems, as well as a few unique issues. Many host databases contain huge amounts of data and support multiple applications. The company cannot afford to use these production databases to support a performance test. This leaves you with the problem of replicating a massive database for performance testing. Of course, the performance test works best when it runs against the full database. Some databases, however, contain terabytes of data and use many, massive disk farms to contain everything. You cannot afford to move the full contents of these databases to the test environment.

For extremely large databases, you require a working subset of the data in the test environment. Taking a meaningful subset of a monster database requires skill, as the data tends to be intertwined with cross-references. Taking a sample indiscriminately often results in data the web application cannot use: The cross-references the web application seeks in the data do not exist in the sample. The sample must also be large enough to generate the proper behavior from the database. An undersized sample, for instance, might be largely held in the database's cache, resulting in overly optimistic database response times.

Also, coordinate your test scripts with the sample data. If you create the scripts using the full database, make sure the data referenced by these scripts exists in the sample as well. For example, if the script tries to purchase a toaster not available in the test database, the script fails.

Finally, apply the key tuning parameters of the production database to your test database, as appropriate. These include things like buffer sizes, indexes, and connection settings. Since your sample database represents a scaled-down model of the production database, scale the tuning parameters as appropriate for the sample.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020