The graph is on a logarithmic scale btw

Configuration Before series (ms) With series (ms)
1 vCPU 22.3 (21.6-22.6) 0.97 (0.72-1.4)
8 vCPUs 314 (97-2542) 7.0 (5.0-98)
you are viewing a single comment's thread
view the rest of the comments
[–] 2 points 1 month ago (7 children)

That's not how it works but yes, if you don't need to swap, then that is better. Avoiding swapping though is also the wrong angle as depending on amount of ram, swapping can be beneficial, it just depends.

  • source
  • parent
  • hideshow 7 child comments
  • [–] 1 point 1 month ago (6 children)

    That's not how it works, but I'm right? I guess I just don't get it at all. 😅 Which just makes it all the more interesting I suppose. 😃

  • source
  • parent
  • hideshow 6 child comments
  • [–] 3 points 1 month ago (5 children)

    Yeah, there is a lot to it. Firstly, if you have loads of ram, and don't really use it, then discussing swap is pointless, just don't have a swap device. If ram on your system is marginal for your workload, then swap is a must have as your system will gain performance by being able to swap, even if it is to an SSD. In that case your system will start swapping to ssd as it gets closer to being full. Zswap improves this by using the margin the system has in ram at which it would swap, to compress the pages in ram instead. So you don't lose any usable ram with zswap. But you gain performance as compressing the pages in ram is faster than writing them to SSD. But it does eat some CPU load in doing this.

  • source
  • parent
  • hideshow 5 child comments
  • [–] 1 point 1 month ago (4 children)

    Ah, okay. I get it, I think. You're still using the same amount of RAM but you're spending some CPU cycles compressing its contents to make more room.

    Can you combine zswap with regular swap, like a swap device or swap file?

  • source
  • parent
  • hideshow 4 child comments
  • [–] [S] 2 points 1 month ago* (3 children)

    Zswap always(?) uses a swap file or disk partition. It does a smart job using both compressed memory and disk space as swap

    zRam does not use disk. Do not attempt combining zRam with any kind of swap on disk, it's a horrible combination

  • source
  • parent
  • hideshow 3 child comments
  • [–] 1 point 1 month ago (2 children)

    Oh okay, so zswap actually requires a swap file or device? Or just uses it if available?

  • source
  • parent
  • hideshow 2 child comments