My lemmy instance seems to be using a lot of storage, I am the only one using it and for like 10 minutes a day. it’s currently using about 122 gb, after about 3 months of usage

 ~/l/volumes> sudo du -d 1 -h  .
47G	./pictrs
75G	./postgres
0	./lemmy-ui
122G	.

seeing the usage of other ppl this seems really big? Am i doing someting wrong? edit: it is also using a lot of memory, i dont know exactly how much but it seems to be most of my system’s available ram (16 gb)

  • pnutzh4x0r@lemmy.ndlug.org
    link
    fedilink
    English
    arrow-up
    13
    ·
    1 year ago

    Could be what communities you are subscribed to. I run a small instance with about 3ish users, and here are my stats after about 3 months as well:

    9.5G ./pictrs
    12G	 ./postgres
    8.0K ./lemmy-ui
    

    What version of lemmy are you using? A recent update also introduced some space savings in the database (I think).

      • walden@sub.wetshaving.social
        link
        fedilink
        English
        arrow-up
        7
        ·
        edit-2
        1 year ago

        If viewing in a web browser, scroll to the bottom of the page. It’ll say something like “BE: 0.18.5”.

        Edit: If you are hosting it yourself in docker, don’t use the :latest tag. As of right now that will install 0.19 which is still in alpha. Use dessalines/lemmy:0.18.5

  • poVoq@slrpnk.net
    link
    fedilink
    English
    arrow-up
    9
    ·
    1 year ago

    You used one of these subscribe to all community scripts, no? Otherwise it is hard to reach these figures as a single user instance.

    However for the memory, I also have a hard time understanding why it eats up all ram. I am currently restarting the Lemmy backend twice a day to prevent the database from using all the memory and the system subsequently running out of memory. It definitely looks like some sort of memory leak, but not all instances seem effected. I already tried a few things to fine-tune the database and pool size etc. but it doesn’t seem to help.

    • youpie@lemmy.emphisia.nlOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      oh I used like a tool to speed up federation, maybe that caused it? it was called lcs maybe that caused it?

      • poVoq@slrpnk.net
        link
        fedilink
        English
        arrow-up
        10
        ·
        1 year ago

        yes, mostly. This tool basically instructs your lemmy instance to try and fetch the entire Lemmyverse and mirror it on your server.

  • hitagi@ani.social
    link
    fedilink
    English
    arrow-up
    6
    ·
    1 year ago

    I don’t remember which update it was but newer versions of Lemmy use significantly less database storage.

    • poVoq@slrpnk.net
      link
      fedilink
      English
      arrow-up
      8
      ·
      edit-2
      1 year ago

      It reduced it shortly, but the activity table is still (unecessarily) caching most of the lemmyverse for 3 months AFAIK.

      Our database went from 30GB or so down to 7GB with that update, but now it is back to 30GB or so. I even did a full database vaccuum lately, but it only shaved off 2-3GB or so.

      If my understanding is correct, then the activity table probably doesn’t need to store more than a week or so, instead of the current 3 months. But this is something hard-coded in Lemmy and can’t be easily configured.

  • Meldrik@lemmy.wtf
    link
    fedilink
    English
    arrow-up
    4
    arrow-down
    1
    ·
    1 year ago

    It’s all the images being cached from other servers. If you haven’t uploaded any images to your instance, you can just delete the content of the pictrs folder.

    • poVoq@slrpnk.net
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      This will also delete all the user and community avatars though, as sadly Lemmy does not distinguish these from other images.

      • Meldrik@lemmy.wtf
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        Then you would also have to delete those images. Unfortunately, there’s no easy way to delete the cache of images that pictrs stores :(