Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save starfunkel/b5f36522b2bc26cb545cd2226b431b12 to your computer and use it in GitHub Desktop.

Select an option

Save starfunkel/b5f36522b2bc26cb545cd2226b431b12 to your computer and use it in GitHub Desktop.

Revisions

  1. @2E0PGS 2E0PGS renamed this gist Feb 10, 2018. 1 changed file with 0 additions and 0 deletions.
  2. @2E0PGS 2E0PGS revised this gist Jan 27, 2018. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions VMwareWorkstationKhugepagedFix.md
    Original file line number Diff line number Diff line change
    @@ -36,6 +36,5 @@ exit 0

    More info and references:

    https://communities.vmware.com/thread/505923

    https://docs.mongodb.com/manual/tutorial/transparent-huge-pages/
    * https://communities.vmware.com/thread/505923
    * https://docs.mongodb.com/manual/tutorial/transparent-huge-pages/
  3. @2E0PGS 2E0PGS revised this gist Jan 27, 2018. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion VMwareWorkstationKhugepagedFix.md
    Original file line number Diff line number Diff line change
    @@ -32,4 +32,10 @@ echo never > /sys/kernel/mm/transparent_hugepage/defrag
    Ensure this goes above the line:
    ```sh
    exit 0
    ```
    ```

    More info and references:

    https://communities.vmware.com/thread/505923

    https://docs.mongodb.com/manual/tutorial/transparent-huge-pages/
  4. @2E0PGS 2E0PGS created this gist Jan 23, 2018.
    35 changes: 35 additions & 0 deletions VMwareWorkstationKhugepagedFix.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    **If you run VMware Workstation 11 or above you may encounter high CPU usage from process khugepaged on Ubuntu 15.04+**

    The fix is to disable transparent hugepages. It seems Ubuntu has it enabled by default.

    **You can check the current status on your system by running:**

    `cat /sys/kernel/mm/transparent_hugepage/enabled`

    `cat /sys/kernel/mm/transparent_hugepage/defrag`

    Fedora outputs: `always [madvise] never` but Ubuntu outputs: `[always] madvise never`

    Fedora seems to not be effected but I havn't tested it myself.

    So I suggest not using madvise and just disable it totally.

    **To disable it run the following commands as root:**

    `echo never > /sys/kernel/mm/transparent_hugepage/enabled`

    `echo never > /sys/kernel/mm/transparent_hugepage/defrag`

    That will only disable it for the current session.

    **To have it persistant across reboots I suggest adding this to your rc.local:**

    ```sh
    # Fix for VMware Workstation 11+ khugepaged.
    echo never > /sys/kernel/mm/transparent_hugepage/enabled
    echo never > /sys/kernel/mm/transparent_hugepage/defrag
    ```
    Ensure this goes above the line:
    ```sh
    exit 0
    ```