Time The TIME column gives the total length
Time The TIME column gives the total length of time that the process has been running. CPU Usage The WCPU column gives a weighted CPU usage that shows the percentage of CPU time that the process is using, as adjusted for the process’s priority and niceness. The CPU column shows what percentage of CPU time the program is actually using. Command Name Finally, in the COMMAND column, we have the program name. Memory Usage If your system is running slowly, check its memory and CPU usage first. While they’re no more likely to be running amok than any other part of the system, they’re the easiest to measure. Let’s discuss memory first. FreeBSD errs on the side of caching recently accessed data because a surprising amount of information is read from disk time and time again. If this information can be cached in physical memory, it can be accessed very quickly. If the system needs more memory, it dumps the oldest cached chunks in favor of new data. For example, the example top output we’re discussing is from my laptop, which is using a lot of buffer and inactive memory. Part of that is due to my Web browser. I started Mozilla when I booted the system yesterday morning so I could check my morning comics.[3] For a couple of moments, the disk light stayed solidly lit while the system read the program off the disk. I then shut the browser down so I could do some work. Since this Web browser was accessed, it sat in the system buffer cache. When I started the browser again this morning, it only had to be called out of cache rather than from disk, so it started much more quickly. Had I started some other large process, it would have dumped that Web browser from the cache to read in more data. If your system is operating well, you will have at least a few megs of free memory. If you have more than a few megs free, your system is not being used to nearly its full potential. In the example earlier, I could get rid of 128MB of RAM and not affect system performance much at all. If you have a good chunk of memory in cache or buffer, you don’t have a memory shortage. You might make good use of more memory, but it isn’t strictly necessary. Similarly, if you have a lot of free memory, you probably don’t have a memory shortage. If active and wired memory is consuming most of your available memory, more RAM wouldn’t hurt. When you’re out of free space, and have little or no memory in cache or buffer, you should investigate your memory use further. You may well have a memory shortage. Take a look at the Using Vmstat section later in the chapter to check. Swap Space Usage Virtual memory, or swap helps cover brief RAM shortages. For example, if you’re untarring a huge file, you might easily fill up all your physical memory and have to start using virtual memory. It’s not worth buying more RAM for this occasional use when swap suffices. Like memory cache, swap caches data that it has handled recently, and once you’ve touched swap, it never returns to being free. For example, I have a server that has been up for 772 days at this writing. At one point, I used about a hundred megs of swap to handle a massive compile. My top 411
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP Web Hosting services