57

I'm self-hosting the docker containers and I noticed the pictrs directory is steadily growing because of the cached images. Does anyone know if it gets cleaned up automatically or are hosters running scripts to clean it up after a certain amount of time? The install guides make no mention of it from what I can find.

top 28 comments
sorted by: hot top controversial new old
[-] a253040@midwest.social 12 points 1 year ago

IIRC, I've read comments elsewhere that pictrs caches for 6 months, but I can't independently verify. I hope this gets a broader answer because I'm still on the fence about getting an instance set up for myself and some small communities.

[-] rs5th@lemmy.scottlabs.io 11 points 1 year ago

I believe the activity table in Postgres is retained for 6 months (although I’m purging mine daily) and the pict-rs cache is 168 hours (1 week).

[-] a253040@midwest.social 12 points 1 year ago

I knew I read something was kept for 6 months ;)

Glad to see that even here, the best way to get the right answer on the internet is to provide a wrong one.

[-] idle@158436977.xyz 10 points 1 year ago

Only 1 week? That should be fine. Thanks!

[-] Jamie@jamie.moe 9 points 1 year ago

I was starting to sweat a little because my instance, that only I use, already has 600MB of pictures after less than 24 hours. The server has more than enough space, but I still wouldn't like it. A week is far more swallow-able.

[-] Quindius@lemmy.world 1 points 1 year ago

How do you purge daily? Also, does that delete any post history or anything in a similar vein?

[-] rs5th@lemmy.scottlabs.io 1 points 1 year ago

I’m running the following SQL, although I’m not actually sure it’s as necessary since 0.18.3. It doesn’t delete any post history or anything.

DELETE FROM activity WHERE published < NOW() - INTERVAL '1 day';
[-] nii236@lemmy.jtmn.dev 7 points 1 year ago

Related note, pictrs is super cool. Its like an OSS imgur backend, but no one really talks much about it or its potential.

[-] nephs@lemmygrad.ml 3 points 1 year ago

It would probably be worth it to have that period be configurable by instance admins...

[-] rs5th@lemmy.scottlabs.io 3 points 1 year ago

I think it’s configurable inside pict-rs’s configuration file. I haven’t messed with it though. I’m also not sure if pict-rs has an API that lemmy can use to configure that.

[-] xtremeownage@lemmyonline.com 11 points 1 year ago

Honestly, If I can get posts to stay synced up, that will be a good day for me.....

Seriously, federation/sync issues, are not fun.

[-] leopardboy@netmonkey.tech 4 points 1 year ago

I've had lot of issues with lemmy.ml. I just unsubscribed from everything over there since zero comments were federating over to my instance.

I noticed that they'll show up eventually where "eventually" could be like, 10-12 hours.

I suspect that they're just absolutely slammed to the point they can't actually push the federated content out to subscribers because EVERYONE is subscribing.

Might be an architectural thing due to not having a sufficiently scalable job queue/worker thread infrastructure, or just like, not enough CPU cycles to do it.

[-] leopardboy@netmonkey.tech 2 points 1 year ago

It's hard to say. I don't know if the admins of Lemmy.ml have been public about their issues or not. I know that Lemmy.world hasn't been having the same issues, at least from my perspective. Makes me think it's less an architectural or design problem, but rather a lack of server resources like CPU, as you suggested.

[-] StrayPizza@lemmy.world 4 points 1 year ago

I read somewhere that Lemmy.ml has basically maxed out its VPS with its provider, so they’re stuck for the time being, whereas Lemmy.world actually just upgraded its server hardware. Hoping they’ll migrate to a beefier server soon.

[-] leopardboy@netmonkey.tech 3 points 1 year ago

Yup, I've read something similar. Hopefully they're able to get things sorted out soon!

[-] xtremeownage@lemmyonline.com 2 points 1 year ago

Beehaw has been my bigger problem child.

However, tonight it's smooth as butter. Things are syncing, I'm getting alerts.

Could be due to some of the maintenance I did earlier too.

[-] leopardboy@netmonkey.tech 3 points 1 year ago

I've not personally noticed any federation issues with Beehaw on my instance. Glad to hear things are better tonight.

[-] jon@lemmy.tf 4 points 1 year ago

I'm just letting mine do whatever it wants, got plenty of local storage. If/when I have storage issues I'll add an s3 bucket, pretty easy to modify the entrypoint for pictrs to pass s3 connection info in the docker-compose deployment.

[-] fox@lemmy.fakecake.org 2 points 1 year ago

S3 support is a good thing, thanks for mentioning it.

[-] poVoq@slrpnk.net 3 points 1 year ago* (last edited 1 year ago)

Remote images are not cached or proxied right now as far as I know. Edit: seems I was wrong and there is some image caching happening. For sure for the small image thumbnails, but also sometimes for other pictures, but it seems very inconsistent.

Your growning pictrs directory might be also due to the extremely verbose default logging that Pictrs (and the Lemmy backend too btw) uses.

[-] idle@158436977.xyz 2 points 1 year ago

When I look in the directories, it's 100s of images that are definitely from posts. Maybe it only caches the images I clicked on?

[-] poVoq@slrpnk.net 3 points 1 year ago

No, I was wrong and caching is happeing somehow, but not always. I think there might be a strict time-out or something like that for pict-rs trying to cache the images, which is why most images do not get cached in my experience.

[-] idle@158436977.xyz 2 points 1 year ago

In any case, a weeks retention is fine by me. I have a couple hundred gigs available, so long as it's getting cleaned up at some point it's not a problem for me.

[-] arkcom@kbin.social 1 points 1 year ago

I though instances only cached the text of submissions? I could see that ballooning to be insane pretty quick if the fediverse really takes off.

this post was submitted on 17 Jun 2023
57 points (100.0% liked)

Selfhosted

39154 readers
265 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS