How does image uploading work on Lemmy?
How does image uploading work on Lemmy?
When you upload an image in the URL bar when creating a post, where does it go? Are they hosted on the respective Instance of the community?
How does image uploading work on Lemmy?
When you upload an image in the URL bar when creating a post, where does it go? Are they hosted on the respective Instance of the community?
yes, they are hosted on the server that is running the Lemmy instance. But every other instance that is linked to that instance will 'scrape' all posts incl images and store them on they're own server. So posts and images are served from the instance you yourself are a member of
Maybe it doesn't matter so much because image files are usually relatively small, but it seems kind of inefficient. I wonder if BitTorrent could help somehow.
lots of traffic on many small files eventually uses more disk space and bandwidth. Depends on the growth of the instance
That seems weird. So the more people are here and longer Lemmy instances (any of them) are up the more storage each instance needs? Soon you can't have small instances because you will need tons of storage for all pictures that have ever been posted in any of the instances?
only pictures and posts that the instance-member are subscribed to, and from the moment they interacted with it. But yes, I'm curious to see where this goes.
I noticed it when I was looking in the database and disk on my instance, where there are already thousands of posts and more then a thousand images - while my own instance only has a couple of posts and images
the docs don't explicitly specify but you can see in the image url that they do end up on the instance you upload to
Does that cost the instance creator anything?
i mean, it depends on how they are hosting the instance, i guess. it would certainly take up storage space wherever they host the instance. you could always try to upload images somewhere else like imgur and then link it to help not take up their instance storage
yes. running a server costs money. I have lemmyfly.org running just 2 days now on digitalocean using a cheap 1GB ram, 25GB diskspace and 1000GB bandwidth for $7,- a month. Storing images on the server will eventually take up all space and bandwidth meaning you have to upscale -> pay more.
Using a different location for storing images and/ or videos is best to offload the instance !
My understanding is that images don't federate by default and you'll load the image from whichever server it was uploaded to initially. Uploading an image here in the comment certainly does that:
I'm going to go find an example on an image post
If you run the normal Ansible setup, there's one docker container running pictrs that's going to handle the image uploads. By default, it stores it into a volume that comes from the server's filesystem. So when you upload an image, it gets stored to the server's file system with the default settings.
Pictrs supports object storage, and you can get it to store the images to any S3 compatible storage.
Probably not a bad idea to enable S3 support
Btw, if somebody here makes an instance with pictrs sending data to S3, it would be really cool if you would document it and write a guide how to enable it with a common Ansible deployment. It seems that the docker image doesn't take any environment variables, or at least there is no documented way how to turn on the object storage using the pictrs docker image. Maybe it's not implemented yet, and somebody needs to fork the docker image...
If you tend to upload images/memes etc., yes, it's a good idea. And very cheap (read: free) if you go with Cloudflare R2..