A web server is an information technology that usually process HTTP request. HTTP is the basic network protocol used to distribute information on the World Wide Web. The term web server can refer either to the entire computer system, or the application software that accepts and responds to the HTTP requests.
Kernel-mode and user-mode web servers
A web server can be either incorported into the OS kernel or in user space (like other regular applications).
Web servers that run in user-mode have to ask the system for permission to use more memory or more CPU resources. Not only do these requests to the kernel take time, but they are not always satisfied because the system reserves resources for its own usage and has the responsibility to share hardware resources with all the other running applications. Executing in user-mode can also mean useless buffer copies which are another handicap for user-mode web servers.
A web server has defined load limits, because it can only handle a limited number of concurrent client connections (usually 2 to 80,000, by default is between 500 and 1,000) per IP address. It can serve only a certain maximum number of requests per second depending on:
- Its own settings.
- The HTTP request type.
- The content type: static or dynamic.
- The content is cached or not.
- The hardware and software limitations of the OS of the computer on which the web server runs.
When a web server is near to or over its limit, it becomes unresponsive.
Causes of overload
At any time web servers can be overloaded due to:
- Excess legitimate web traffic. Thousands or even millions of clients connecting to the web site in a short interval;
- Distributed Denial of Service attacks. A DoS or DDoS attack is an attempt to make a computer or network resource unavailable to its intended users;
- Computer worms that sometimes cause abnormal traffic because of millions of infected coomputers;
- XSS viruses can cause high traffic because of millions of infected browsers or web servers.;
- Internet bots traffic not filtered/limited on large web sites with very few resources;
- Internet or network slowdown, so that client requests are served more slowly and the number of connections increases so much that server limits are reached;
- Web servers (computers) partial unavailability. This can happen because of required or urgent maintenance or upgrade, hardware or software failures;
Symptoms of overload
The symptoms of an overloaded web server are:
- Requests are served with long delay.
- The web server return HTTP error code.
- The web server refuses or reset TCP connections before it return any content.
- In very rare cases, the web server returns only a part of the requested content. This behavior can be considered a bug, even if it usually arises as a symptom of overload.
To partially overcome above average load limits and to prevent overload, most popular website use common techniques like:
- Managing network traffic by using:
- Firewalls to block unwanted traffic coming from bad IP sources or having bad patterns.
- HTTP traffic managers to drop, redirect or rewrite requests having bad HTTP patterns.
- Bandwidth management and traffic shaping, in order to smooth down peaks in network usage.
- Deploying web cache techniques
- Using different domain names to server different content, e.g. http://images.example.com for images content.
- Using different domain names and/or computers to separate big files from small and medium-sized files; the idea is to be able to fully cache small and medium-sized files and to efficiently serve big or huge (over 10 - 1000 MB) files by using different settings
- Using many internet servers (programs) per computer, each one bound to its own network card and IP address
- Using many internet servers (computers) that are grouped together behind a load balancer so that they act or are seen as one big web server
- Adding more hardware resources (i.e. RAM, disks) to each computer
- Tuning OS parameters for hardware capabilities and usage
- Using more efficient computer programs for web servers, etc.
- Using other workarounds, especially if dynamic content is involved
Below are the statistics of the market share of the top web servers on the Internet by Netcraft Survey in May 2015.
- Dependency injection
- Directives and Pipes
- Data binding
- HTTP Get vs. Post
- Node.js is everywhere
- MongoDB root user
- Prefer Async Script Loading
- Components, Bootstrap and DOM
- What is HEAD in git?
- Show the changes in Git.
- What is AngularJS 2?
- Confidence Interval for a Population Mean
- Accuracy vs. Precision
- Sampling Distribution
- Working with the Normal Distribution
- Standardized score - Z score
- Evaluating the Normal Distribution
- What is Nodejs? Advantages and disadvantage?
- How do I debug Nodejs applications?
- Sync directory search using fs.readdirSync