Post AXmmGh6RLwl7ARWDTM by pwm@crlf.ninja
(DIR) More posts by pwm@crlf.ninja
(DIR) Post #AXmjAEW2QVr4uEif9k by woof@fedi.aria.dog
2023-07-17T11:41:29.084268Z
0 likes, 0 repeats
Hey for the few of you self hosting akkoma, is there a radical performance difference between giving its vps 512MB be 1GB of RAM? Like does it throw fewer errors after you postI need to move vps either way, this one has a small ssd and i need a big spinning disk to post more media
(DIR) Post #AXmjAFXqbGte68ZccC by malakai@the.occultist.space
2023-07-17T12:07:30.988Z
0 likes, 0 repeats
@woof@fedi.aria.dog never got any errors when I was posting using Akkoma, though this was a 2 gb RAM server
(DIR) Post #AXmjAGBuCKwI6NJc3M by pwm@crlf.ninja
2023-07-17T12:14:16.910713Z
0 likes, 0 repeats
@malakai @woof I run the pleroma backend on a pair of 512MiB containers, and an 8GiB postgres vm. No issues, though we only have a handful of people. Average ct memory usage is around 300-400 MiB
(DIR) Post #AXmjaIknIBrDZy3GVs by i@declin.eu
2023-07-17T12:19:00.997681Z
1 likes, 0 repeats
@pwm @woof @malakai it's making sure postgresql has enough room to handle the sudden iops load, https://pgtune.leopard.in.ua/ helpsand that the vps survives every other mastodon instance pulling in media all at once as well, since the default file handle count can get overpowered
(DIR) Post #AXmji3IkcyE9yHdA5A by pwm@crlf.ninja
2023-07-17T12:20:24.803028Z
0 likes, 0 repeats
@i @woof @malakai my media lives on a dedicated minio box, which is proxied separately. It's all fairly robust, for being as jank as it is
(DIR) Post #AXmjouWxdT7anQY0jg by i@declin.eu
2023-07-17T12:21:39.453079Z
0 likes, 0 repeats
@pwm @malakai good for you but that's not really helpful to @woof
(DIR) Post #AXmjppRc21iBJLU2oS by pwm@crlf.ninja
2023-07-17T12:21:48.632345Z
0 likes, 0 repeats
@i @malakai @woof which is of course cached by ngonx out in the front of the stack so big media pulls don't tend to hit the backend a bunch
(DIR) Post #AXmkInEbKKSIr5D0sa by pwm@crlf.ninja
2023-07-17T12:27:01.444788Z
0 likes, 0 repeats
@i @woof @malakai even if they are file-backed they should still be able to throw a few GiB at an nginx cache to lighten the file handle load under bursts, without just throwing more hardware at it
(DIR) Post #AXmkUyhQWh7Zt7VC88 by matty@nicecrew.digital
2023-07-17T12:29:13.897420Z
0 likes, 0 repeats
I don't understand what the point of NGINX caching is if it pulls files from the server anyway.
(DIR) Post #AXmkb4l2ukcKPo6QFc by mint@ryona.agency
2023-07-17T12:29:49.925296Z
2 likes, 0 repeats
@pwm @i @woof @malakai Alternatively, serve media directly by nginx from upload directory. Might serve frontend via nginx as well.
(DIR) Post #AXmkh4rHSAdkSrsecC by i@declin.eu
2023-07-17T12:31:27.018553Z
1 likes, 0 repeats
@matty @pwm @woof @malakai nginx caching is how you skip pleroma code, it's also required since with a mediaproxy, since pleroma will reverse proxy the file every time without itas mint says, you can also just serve it directly as an optimization
(DIR) Post #AXmkj2Lbl9nNFy05BY by jeeves@nicecrew.digital
2023-07-17T12:31:48.852570Z
1 likes, 0 repeats
@matty @pwm @i @woof @malakai It's one of life's mysteries...
(DIR) Post #AXmklROxa20fXViMb2 by pwm@crlf.ninja
2023-07-17T12:32:14.078208Z
2 likes, 1 repeats
@matty @i @woof @malakai normal request flow if you ar ereverse proxying through nginx is nginx hands the request to pleroma, pleroma processes the request, opens the file returns it backif you cache with nginx, you cut out pleroma even knowing about the request. If there are problems with pleroma opening many many file handles then this tamps down on that, as well.Also what @mint said, when it's on the same box with an upload dir you can just send directly from the folder.
(DIR) Post #AXmlOq7jb6opVXRbQ8 by matty@nicecrew.digital
2023-07-17T12:39:21.449589Z
0 likes, 0 repeats
So if I'm already serving media directly from the folder and bypassing Phoenix, there's no need to cache the media?
(DIR) Post #AXmlX7l9uaAcWMppaq by pwm@crlf.ninja
2023-07-17T12:40:50.882299Z
0 likes, 0 repeats
@matty @i @woof @mint @malakai you could still cache it, but I imagine the gains would only be minimal since you aren't skipping code or a network transfer at that point. If you wanted to throw a few gigs of space at it you certainly could and it wouldn't hurt but I suspect you're in the territory of diminished returns at that point.
(DIR) Post #AXmlZ89DRL5mIt2nJ2 by i@declin.eu
2023-07-17T12:41:13.581836Z
0 likes, 0 repeats
@matty @pwm @woof @mint @malakai you need it because you run a mediaproxy, otherwise your server will fetch remote images every time instead of storing them in cache
(DIR) Post #AXmlcTusxbDegfwHqa by pwm@crlf.ninja
2023-07-17T12:41:49.581876Z
0 likes, 0 repeats
@i @woof @matty @mint @malakai does ncd run the mediaproxy? If so yes absolutely cache that shit
(DIR) Post #AXmldCJBuao0MneJqC by matty@nicecrew.digital
2023-07-17T12:41:56.816040Z
2 likes, 1 repeats
Last time I tried to do that, I ended up wiping my entire uploads directory. I think I goofed by setting the proxy cache path to the directory that actually contained all of the uploaded files.
(DIR) Post #AXmleja9gdp3qvJhyK by matty@nicecrew.digital
2023-07-17T12:42:13.789814Z
0 likes, 0 repeats
Yes, we do and it is indeed cached.
(DIR) Post #AXmliOKOeR635mgpQO by pwm@crlf.ninja
2023-07-17T12:42:53.650896Z
0 likes, 0 repeats
@matty @i @woof @mint @malakai LOL yes that would absolutely do that.keep your caches in /tmp like God intended
(DIR) Post #AXmlnqBYVOrGwF9XZQ by matty@nicecrew.digital
2023-07-17T12:43:51.446670Z
0 likes, 0 repeats
But then how do I go about telling Nginx where the cached files should be pulled from? With a root directive?
(DIR) Post #AXmmGh6RLwl7ARWDTM by pwm@crlf.ninja
2023-07-17T12:49:05.063958Z
0 likes, 0 repeats
@matty @i @woof @mint @malakai in the block where you are serving the media files from you put a directive that says "cache the responses from here" for reverse proxied stuff I believe the directive is "proxy_cache <cache_name>;" then there are a bunch of settings controlling cache keys etcdeclaring the cache earlier is where you specify the location of the cache, and you can reuse it wherever in subsequent `location` blocks through out the config.
(DIR) Post #AXmmMhFVip3BMIciG0 by pwm@crlf.ninja
2023-07-17T12:50:10.768420Z
0 likes, 0 repeats
@matty @i @malakai @mint @woof As always, RTFM, NO WARRANTY, etchttps://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/
(DIR) Post #AXmmXkqkfur3iAJcuG by pwm@crlf.ninja
2023-07-17T12:52:10.868548Z
0 likes, 0 repeats
@matty @i @woof @mint @malakai actually, ignore this. I don't see anything that indicates you can cache something that you are serving from on-disk.
(DIR) Post #AXmn1RJ3twnPmniDUO by matty@nicecrew.digital
2023-07-17T12:57:30.437251Z
1 likes, 0 repeats
I think that's where I was having trouble. There's no need to cache it if it doesn't go through Phoenix. Although I'm a little confused as to how Phoenix knows how to send it back to NGINX but that's why I'm not an engineer.
(DIR) Post #AXmnKVzSi92HoadlgG by pwm@crlf.ninja
2023-07-17T13:00:59.470256Z
1 likes, 0 repeats
@matty @i @woof @mint @malakai phoenix just thinks the client is nginx, that's how reverse proxies work. nginx can be configured to tell phoenix about the client it is proxying on behalf of (via some special headers), but http just sends the stuff back over the already open pipe the request came from, regardless of if it's a user or a proxy. eznginx just contains special logic to allow it to act as a proxy, or a plain ol http server (or a mix of both!), depending on how you configure it
(DIR) Post #AXmnTw4d6SAjJjY8oa by matty@nicecrew.digital
2023-07-17T13:02:41.141041Z
1 likes, 0 repeats
That is some nerd shit. Thanks for your time.