1. View System process commands
Top
After entering can press s plus time, specify how long time to refresh
2. View CPU Information
Cat/proc/cpuinfo
3. View memory Information
Cat/proc/meminfo
4. Clean up Memory: active garbage collection
http://blog.csdn.net/mafuli007/article/details/7573521
Sync
Echo 3 >/proc/sys/vm/drop_caches
Echo 1 >/proc/sys/vm/drop_caches
5. View memory consumption only
Free-m
6. View All Processes
Ps-ef
7. Forcing the end of a process
Kill-9 PID
-9 for Semaphore, detailed search process semaphore
8. View Port Usage
NETSTAT–APN or Netstat-aux
9. Check the usage of the network
Install Iftop, similar to the top command
10. Open Swap
For SSD servers, memory is a little bit better to open swap.
Prepare a swap file first: DD If=/dev/zero of=/swapfile bs=1024 count=512k (bs,block size.)
The DD command is specifically used to copy from one file and format it into another file. This command means reading from the "/dev/zero" file to the/swapfile file, the block size is 1024Byte, a total of k blocks, that is, a total of 512M.
Then set up and open the swap file:
Mkswap/swapfile
Swapon/swapfile
And then execute free-m and you'll see
swap:511 0 511
Description already started
Also configure the default open swap on boot
To edit/etc/fstab, add the following line:
/swapfile None swap defaults 0 0
/etc/fstab is where file system information is stored, and the filesystem is automatically read and loaded from the system when it is started. The first three parameters do not indicate:
The physical location of the filesystem to be mounted (that is, the swap file we created in the previous step), the mount point (OK for swap is set to none), file format (swap format)
Linux system optimization and condition monitoring