Pages - Menu

Tuesday 17 May 2016

Hardware Limitations - wordpress

Like any other web application, WordPress is only able to handle as much traffic as the hardware which runs it can support.
There are two main barriers that can prevent your site from functioning under a high volume of traffic:

  1.     Processor Limitations
  2.     Network Limitations

Processor Limitations

High traffic levels can put great demand on your server's internal resources. Ensure that your server has sufficient processor power and memory resources to meet these demands.

The default requirements for WordPress are listed below. However, individual sites may require additional resources.
MySQL/MariaDB

As with many blogging and web applications, WordPress depends on MySQL or MariaDB to store data for producing output. Every request WordPress makes to MySQL/MariaDB, including both read and write operations, creates a load on the server.

WordPress is continuously optimized to minimize the number of database requests needed for regular operation. However, developmental practices used in plugins or themes can increase the amount of database usage needed to run a given site. In high-traffic situations, many simultaneous database connections can cause excessive strain on the server. An incomplete connection to a server causes the "Connection timed out" response in the visitor's browser.

MySQL/MariaDB connection rates can be improved by either adjusting MySQL/MariaDB settings, or providing more memory and processing power to the overworked server. Additionally, using query caching and proper indexing can help to improve MySQL/MariaDB performance. There is no single solution for every case, as all sites operate differently.

Another option worth considering for high traffic sites is creating a read-only slave of your master database server. Since most requests made of the database by your WordPress site are SELECT (or read) requests, these can be separated from other UPDATE or INSERT requests by using a database management plugin such as HyperDB, written by the core WordPress team.
Web Service

WordPress is a web server neutral application, meaning that it can run on many different platforms. Apache and Linux are the most robust platforms for running WordPress, but any server that supports PHP and MySQL or MariaDB will do.

Make sure your host features the most up-to-date and stable version of these platforms in order to create a strong environment in which to run WordPress.

The method chosen to run PHP -- the language that interprets the WordPress code -- can also affect your server's performance. In CGI mode, the server creates a new instance of the PHP program for every PHP file that a visitor requests. In shared module mode (or ISAPI), each PHP request is handled by a single library instance.

There are also many misconceptions about the benefits of multi-threaded Apache 2 implementations. In general, prefork performance of Apache 2 with mod_php is the most stable. There are advantages and drawbacks to each method - when choosing the method for your server, be sure to keep in mind traffic and its demands on the server, and make sure to run your own tests before deploying.

Network Limitations

A slow Internet connection can limit the number of pages your server can serve in a given space of time.

Your server's network provider (your host or ISP) will usually connect your server to their internal network via an Ethernet adapter. Adapters typically operate at certain standard maximum speeds, usually 10Mb/s, 100Mb/s, or 1Gb/s. Your server cannot transfer files faster than the speed at which this network connection transmits. In addition, there are many other factors that can affect the actual transfer rate seen by your server.

First, it is important to note that many of these numbers (especially the speed of your server's network adapter) are theoretical. In practice, your server will never transfer files at the maximum rate specified by the adapter. This is because, in addition to the actual data being transferred, the server is also sending and receiving the routing information needed to get data to your site visitors. Because of this "network overhead", only a fraction of the server's full bandwidth is available for actually transferring files.

Second, your server is likely connected to various devices in your network provider's facilities. These devices can also place limitations on the "real world" speeds your server can attain. They are in place because your network provider has to fraction out its limited bandwidth to many servers at its location, and all of the bandwidth must be shared.

Certain network providers allow you to "burst" data -- temporarily exceed a pre-set transfer speed limit -- in cases when demand for your site content is especially high. The network provider's hardware is designed to know when this is required. Some providers charge extra for this feature, some do not, and others do not offer this feature at all. Contact your service provider to find out whether this feature is available to you.
Network Transfer Speeds in Use

To determine why the bandwidth of the connection is important to a high-traffic site, let's look at the math.

Assume your site receives 100,000 hits in a day. For the purpose of this computation, we will say that one "hit" is a single data transfer, whether that is a single file or a whole page and its supporting files. Averaged out, 100,000 hits in a day equates to 1.16 hits every second.

Let's also assume the average hit generates 160KB of transferred data; HTML, images, CSS, downloaded files, etc. This means that your site is transferring 190KB of data every second (160KB/hit * 1.16 hits/s). The total, 190KB/s, equals about 1.5Mb/s of sustained throughput. (Note that KB = Kilobytes and Mb = Megabits. Most network speeds are rated in bits per second, whereas file sizes are measured in bytes.) Many network providers cap the transfer rate of a site to about this level; some higher, some lower. However, this steady rate will only be maintained if each individual user visits the site at regular intervals.

Usually, more than one user at a time will access your site. On the other hand, there may be periods where nobody accesses your site at all. If 10 people suddenly hit the site in one second, and that hit rate is sustained over a lengthy period -- not uncommon for a high-traffic site -- then you would need a 15Mb/s connection just to keep up with the simultaneous connections.

If your network adapter's maximum theoretical speed is only 10Mb/s, demand has already exceeded capacity. In this instance the network is the source of your traffic problems, rather than WordPress.

It is not necessary to receive hundreds of thousands of hits to experience this problem. Sustaining this rate of connectivity for a mere hour generates only 36,000 hits. If your site visitors tend to favor a certain time of day (or an automated comment spam script attempts to access your system multiple concurrent times while posting comments) then you could be left with many dropped requests.

A 100Mb/s connection could handle up to 70 simultaneous connections at the same rate of download, but most network providers would not offer the bandwidth needed to fully use this speed on their shared hosting plans. You would likely need to pay a premium in order to get this kind of bandwidth from your connection

Read More

No comments:

Post a Comment