Swapping Swapping describes what happens when an entire
Swapping Swapping describes what happens when an entire runnable process is moved into swap. If the computer doesn’t have enough physical memory to store a process that isn’t being run at that particular microsecond, the system can move the entire process to swap. Then, the next time the CPU runs that process, the process’s memory is moved from swap into physical memory, and some other process is probably consigned to swap. The problem with swapping is that disk usage goes through the roof and performance drops drastically. Since requests take longer to handle, there are more requests of the system at any one time. And logging in to check the problem only makes the situation worse, because logging runs an extra system process. This performance hit is sometimes called the death spiral. Memory shortages will hurt system performance more than anything else. If you’re frequently swapping, you must get more memory or resign yourself to lousy[6] performance. Note Every system has bottlenecks, or places where performance is limited. If you eliminate one bottleneck, performance will increase until another bottleneck is hit. The system will work at the fastest speed allowed by the slowest component in the system, also called bounds. For example, a Web server is frequently network-bound because the slowest part of the system is the Internet connection. If you upgrade the Internet connection, the system will hand out Web pages as fast as either its CPU or disk allows. Are You Swapping or Paging? FreeBSD includes several programs for examining system performance. Among those are vmstat(8), iostat(8), and systat(1). We’ll discuss vmstat because I find it to be the most helpful. Iostat is similar to vmstat, and systat provides similar information in a more graphic format. Using Vmstat Vmstat(8) shows virtual memory statistics at the current time. While its output takes some getting used to, it is very good at showing large amounts of data in a very small space. Type vmstat at the command prompt, and follow along. ………………………………………………………………………………………. # vmstat procs memory page disks faults cpu r b w avm fre flt re pi po fr sr ad4 da0 in sy cs us sy id 0 0 0 7096 479140 21 0 0 0 9 0 0 0 331 102 437 0 1 99 # ………………………………………………………………………………………. The display is divided into six sections: process (procs), memory, paging (page), disks, faults, and cpu. We’ll look at each then quickly and then dive into detail on the bits that are most important for investigating your performance issues. 415
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP Web Hosting services