Linux System Administration - X


Add to my manuals
368 Pages

advertisement

Linux System Administration - X | Manualzz

memory management

18.5. solution : memory

1. Use dmesg to find the total amount of memory in your computer.

dmesg | grep Memory

2. Use free to display memory usage in kilobytes (then in megabytes).

free ; free -m

3. On a virtual machine, create a swap partition (you might need an extra virtual disk for this).

mkswap /dev/sdd1 ; swapon /dev/sdd1

4. Add a 20 megabyte swap file to the system.

dd if=/dev/zero of=/swapfile20mb bs=1024 count=20000 mkswap /swapfile20mb swapon /swapfile20mb

5. Put all swap spaces in /etc/fstab and activate them. Test with a reboot that they are mounted.

root@computer# tail -2 /etc/fstab

/dev/sdd1 swap swap defaults 0 0

/swapfile20mb swap swap defaults 0 0

6. Use free to verify usage of current swap.

free -om

7. (optional) Display the usage of swap with vmstat and free -s during a memory leak.

204

Chapter 19. monitoring

Monitoring means obtaining information about the utilization of memory, CPU power, bandwidth and storage. You should start monitoring your system as soon as possible, to be able to create a baseline. Make sure that you get to know your system. Boys, just give your

computer a girls name and get to know her. The baseline is important, it allows you to see a steady growth in CPU utilization or a steady decline in free disk space. It will allow you to plan for scaling up or scaling out.

Let us look at some tools that go beyond ps fax, df -h, lspci, fdisk -l and du -sh.

205

advertisement

Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Related manuals

advertisement

Table of contents