To monitor the state of your virtual server there is a suitable command top. After you run top you will se quite a lot of information.
We will help you make sense of them:
Top orders processes in columns, you can switch between columns with < and > symbols. By pressing Enter you will receive a current state.
Cpu(s): 3.3%us, 2.8%sy, 0.0%ni, 93.7% id, 0.0%wa, 0.0%hi, 0.0%si, 0.2%st Mem: 1110024k total, 755596k used, 354428k free, 64k buffers Swap: 996024k total, 87416k used, 908608k free, 347108k cached
Mem : displays a list of used memory.
Cpu : displays the current load of all CPU – if there are two CPUs fully burdened, the maximum load is 200%, for 4 it would be 400% etc. For cpu the load is represented as a % of time, that the processor spent from the last statistics update in the one of the two states: id – idle – no activity, us – user processes, sy – internal system request for example memory management. wa – io wait, processor waits for I/O (mostly disc).
These outputs are an easy leads in case of problems. For example if we see that value wa is high for long time, it is good thing to check if the script is using unsuitable way of writing on the disc (e.g. by searching 1bg directory with cache files). Column Mem is similar to the command free -m total used free shared buffers cached Mem: 1006708 935872 70836 0 148244 346656 Swap: 262140 130084 132056
However the free -m has an extra line where this with explanation, that server has 70 mb free memory. total used free shared buffers cached Mem: 1006708 935872 70836 0 148244 346656 -/+ buffers/cache: 440972 565736. In truth in a case of emergency there are more than 500 mb of memory available, but most of it is used for speeding up its run. If the Linux has enough of the free memory, it is not left to rot, but it is used to load used details – that represents the column cached. Therefore the amount of RAM can increase performance even on the disc operation, if all of the loaded parts are stored in cache.
Buffer is a temporary storage space for data that are written down elsewhere or send with low speed before they are ready. With that the speed of output is stable and that prevents processes to wait for other processes, when they finish (e.g. php script generates data that are straight exported to the file. Data are generated disproportionately faster, then the writing on the disc finishes, but process can finish its part before writing. For detailed information visit guide for top.