Server Performance and Scalability Killer (ext. 1)

Source: Internet
Author: User
Tags iis object model require requires thread
Servers | scaling | Performance Now, server performance issues are a problem for many people who write desktop applications. The success of the Component Object Model (Component object model,com) and Component Ware produces an unexpected result, which is that if you use an application server such as an ASP (an extension of IIS), you don't have to write host code. In fact, the previous host code is not in the real server environment to write. There are many important differences between the desktop environment and the server environment, and these differences can have unpredictable effects on performance.

Desktop Application Server

The factors that affect desktop application performance are well known. Long instruction paths mean slower code, which is a major flaw in performance. Using large amounts of resources makes your application even more bloated, so that other applications in the system will have fewer resources available. Slowing startup times can irritate users. Too many run settings increase the machine's page error rate, slowing them down and reflecting dullness. Server applications are also often affected by these factors, and other factors are described below:

Typically, there are no hundreds of or dozens of clients that the server application handles at the same time. For desktop applications, it's very quick to respond to users in 1/10 seconds. Assuming that an operation requires a full 100ms, the application can do only 10 operations in a second. Most server applications require a much larger amount of flux than 10 requests per second. High latency Network (latency = message transmission time) increases the response time, which requires the server to respond faster to meet the requirements.

Server applications often handle a large number of data settings. Inefficiencies, especially those that waste running time, cannot be used to process millions data.

Server machines are more powerful than desktop machines. The server machine has more memory, larger disks, faster CPUs, and usually has multiple processors. But these are still not enough. Desktop machines deal with sporadic bursts of business, most of the time is idle, and the server's load is continuous. Server machines are expensive and must run well.

The server application needs to have a normal running time of months. After a while, the performance of the server must not be reduced by the accumulation of resource leaks or cruft (a data structure and statistical results that require periodic cleanup).

Most server applications need to adopt a multithreaded architecture. Consider processing only one request at a time. The performance of a single-threaded server, which spends most of its time on I/O, is difficult to accept. The thread pool can process several requests at the same time using other idle processor clock cycles. To take full advantage of multiprocessor systems, server applications must be multi-threaded. Unfortunately, multithreaded applications are difficult to write, are difficult to debug, and are hard to run, especially in multiprocessor systems. But once you get it right, the performance goes far beyond the same single-threaded application, and from that point of view, it's worthwhile to use multithreaded applications.

Single-threaded applications are relatively simple and easy to understand: Only one event occurs at a time in a program. In many
Threaded applications, and issued as a result of complex interactions, whose effects are difficult to predict. In addition, these phases
Interactions, whether catastrophic or not, are hard to regenerate. Desktop applications rarely have more than one thread
, even if they are, these threads are only used for discrete background business, such as printing.


The flexibility and performance of IIS

Internet Information Server (IIS) is an application server. In many ways, it is like a virtual operating system, because there are many ASP and ISAPI applications running in the processing interval.

IIS uses an I/O thread pool to handle all incoming requests. Requests for static files (. htm,.jpg files) are immediately satisfied, and requests for dynamic content are assigned to the appropriate ISAPI extension dynamic Connection library. ASP extensions run ASP pages using a worker thread pool. Because the ASP is COM based, all components are executed during our process. This is a good and bad thing. It's great for developers because it allows for simple reuse of components, makes ASPs very flexible, and therefore makes ASP and IIS very successful. However, this flexibility results in performance problems. Because many components are written for desktop systems, many of the components that are created specifically for ASP are written by people who are not very able to write High-performance server components.

The same is true for ISAPI extensions and filters. There are serious interactions between different components and different instances of the same component.

All of the following instructions apply to IIS, most of which are also applicable to other server applications.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.