Joyent

Reducing your memory usage

Preflight

  1. To see your current memory usage:
    prstat -Z -s cpu
  2. For more ways to check memory usage, see checking memory usage.
  3. For more useful commands, see the shell cheat-sheet.

Apache & MySQL

This information needs to be cleaned up and pulled into the wiki ... for now here are some articles to look through:

Common problems

Wild card used in Virtualhost entries

  1. Listen on the specific IP
    1. Good:
      Listen 1.2.3.4:80
      Listen 1.2.3.4:443
    2. Bad:
      Listen *
      Listen *:80
      Listen *:443
  2. Virtualhost entries
    1. Good:
      <VirtualHost 1.2.3.4:80>
      <VirtualHost 1.2.3.4:443>
    2. Bad:
      <VirtualHost *:80>
      <VirtualHost *:443>

Rails Applications

Webmin

Webmin can optionally be configured to use much less memory (~10MB continuously, and ~50MB peak during complex operations). Edit /etc/webmin/miniserv.conf and comment out the preload= line. This makes Webmin slower on systems that have plenty of memory, but it makes it use a lot less memory most of the time (with all of the normal preload stuff in a complete Virtualmin system it is about 80-90MB continuous with peaks of 110-120MB during complex operations).

preload is a precaching mechanism for some commonly used libraries, primarily used for Virtualmin related modules.

Remove unused applications

This is a hard one to really give a step by step on. Only you know what you are using in your stack. The best way to see is to use

svcs -a

and see what is what on your machine and start picking through the items. To remove one thing you use

 svcadm disable <SOMETHING>

so for example if you are using PostgreSQL and not MySQL then to remove MySQL from memory you would do this:

svcsadm disable cswmysql5
 
accelerators/kb/reducing-memory-usage.txt · Last modified: 2008/01/26 22:54 by alexbcoles
 
Recent changes RSS feed Creative Commons License Driven by DokuWiki