Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Offical apps | Community apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Support
  3. Services memory percentage counts page cache, so database services always sit at 99%

Services memory percentage counts page cache, so database services always sit at 99%

Scheduled Pinned Locked Moved Solved Support
postgresqlmemory
3 Posts 2 Posters 64 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • imc67I Offline
    imc67I Offline
    imc67
    translator
    wrote last edited by
    #1

    The memory percentage on the Services page counts page cache, so a database service settles at 99% whatever limit you give it. Raise the limit and a few days later it reads 99% again, which makes the number hard to act on.

    Here is the postgresql service on a 4 GB limit, straight from its cgroup:

    anon              112 MB
    file             3915 MB   (inactive_file 2974 MB, reclaimable)
    oom_kill            0
    

    docker stats reports 27% for that same container at that same moment, because it subtracts inactive page cache.

    The tricky part is that 99% looks identical whether the cache is comfortably full or the container is thrashing. Here it happened to be the latter: the cgroup hit its ceiling 154 times per minute and the container read 117 MB/min from disk. After raising the limit those dropped to 0 and 44 kB/min. Nothing in the percentage told us which of the two situations we were in.

    Would it make sense to base the figure on memory.current minus inactive_file, or to show the reclaim and oom counters from memory.events next to it?

    1 Reply Last reply
    2
    • girishG Offline
      girishG Offline
      girish
      Staff
      wrote last edited by girish
      #2

      I think it would make sense not to count the cache. Checking the code...

      edit: ok, i see now. We actually explicitly do not count cache for system memory but this check is not done for the containers.

      1 Reply Last reply
      2
      • girishG Offline
        girishG Offline
        girish
        Staff
        wrote last edited by
        #3

        Fixed - https://git.cloudron.io/platform/box/-/commit/a3ee1c354cbf6789724d3fda0ad64c87e3c72ba0 . Thanks for reporting.

        1 Reply Last reply
        1
        • girishG girish has marked this topic as solved

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Bookmarks
        • Search