hhmx.de
menel@snikket.de
menel@snikket.de

Menel

(@menel@snikket.de)

Sa 28.12.2024

Beiträge: 15Folgt: 0Folgende: 0

Arzt in Hannover, Pneumologie. Hobbyadmin, für Schule und Familie. fan. Privates Profil ohne Ausrichtung. In letzter Zeit beschäftigt mich die politische Lage der Welt zunehmend, und viel von dem was ich booste ist nicht grade positiv...
Bitte ggf. meine boosts stummschalten...
Achso: Und deutsch und english wird wild gemischt.
I mainly boost stuff, so consider disabling my boosts if it becomes to much.
Not affiliated with @snikket_im@fosstodon.org
Old Accounts :
@Menel@nerdculture.de 19.07.2021 - 25.08.2024 (active as backup)
@Menel@troet.cafe 25.08 - 30.12.2024
...

XMPP

Yes

Debian

Yes

Selfhosting

Yes

#tinyweb

Yes

AI

https://io.snikket.de/ai


Menel

Föderation · Sa 22.02.2025 13:48:06

Updated Version of the apache http caching setup for snac, including proxy media

I already wrote about caching here
Now I extended what I cache a bit.
This was because after enabling Option to proxy media I've seen access to the file paths /x/ and /y/ in addition to the path were snac stores the media that I include in my own posts ( /s/ ).
There are two locations to proxy media, depending if you requests the media via the mastodonapi or via the web. (/x/ and /y/), oh and I added the nodeinfo2 path too, because I've noticed it was queried all the time by a lot of instances and it gives me pleasure to see something cached handed out in the access logs 🙂 (I guess it is actaully irrelevant for the system resources).
This is the updated setup:
Enable the relevant modules:

a2enmod expires cache cache_disk

Be sure "htcacheclean" is running to clean up old disk cache. (under debian see /etc/default/apache-htcacheclean or else the relevant systemd service or whatever)
Then add to the snac Virtualhost config:

<LocationMatch "^/social/[^/]+/[xys]/|^/social/nodeinfo_2_0">
CacheEnable disk
Header set Cache-Control "max-age=86400, public" "expr=%{REQUEST_STATUS} == 200"
ExpiresActive On
ExpiresDefault "access plus 86400 seconds"
</LocationMatch>
This will use the disk cache to cache everything under the /s/, /x/ and /y/ Path, as well as for /$username/nodeinfo20, utilizing the mod_expires to generate the appropriate cache headers (for lazy ones like me), In this case caching it for 1 day.
Further reading and all options explained under https://httpd.apache.org/docs/2.4/caching.html (and ff)

The Header that I set here, on the condition of Status code 200, is needed for the path /y/, because snac defaults to set no-cache on that location and the modexpires will honor that if we don't override it. I set it to the same Cache-Control value as modexpores woud. (mod_expires will additionally calculate the date and put that in the expiresheader. (hence the name I guess 😀 )


:xmpp:

Menel

Föderation · Fr 21.02.2025 13:04:27

/ activitypub noob :

job fifo size (cur): 655
job fifo size (peak): 1291
thread state: waiting
thread state: output
thread state: output
thread state: output
This number is decreasing over some minutes after I made a post,
I assume it is my instance delivering this to all subscribers, is that correct?
And the last thread will stay idle to maybe wait for incoming requests, so that they can be answered too?
I've never seen another status then waiting or output so far.

I guess if I post a picture that might then happen and all workers will be busy? Maybe even too busy to keep up?

Is that assumption about how the waiting worker and what it is for correct?

If yes I guess I'll increase the threads, if they are intentional low for low ram systems, that's not my issue with snac. (I've not much ram, but I assume snac is by default tuned to be very very very conservative?)

(adding Pic to simultaneously test my theory)



Two Monsters made out of wood and grass, standing on long legs in a lake.

(Medien: 1)

Menel

Föderation · So 09.02.2025 22:11:18

I'm using snac with and am following Hashtags now, and am getting a lot of nice content from specialized Hashtag-Relays. I have now a Problem with unwanted Posts that happen to use Hashtags I want to keep too. But I could Filter them my unwanted Hashtags they use.

Snac supports regex, but now The Question:
how do I know in what form the Regex is expected in my filter_reject.txt?
I want to block a Hashtag case insenitive
//i
or (?i)
or maybe something else? It Seems the web is full of different ways to specify regex.


Menel

Föderation · Mi 05.02.2025 22:18:38

After seeing
Improving snac Performance with Nginx Proxy Cache from @itnotes@snac.it-notes.dragas.net via
https://snac.it-notes.dragas.net/itnotes/p/1738139676.258050
https://it-notes.dragas.net/2025/01/29/improving-snac-performance-with-nginx-proxy-cache/
I decided to prematurely optimize and adjust this for my apache2 httpd server in debian where I run snac.

I've never done any caching etc before so it was a nice adventure to learn something new. The documentation helped and in the end it wasn't very hard. I learned a bit about some http headers and regex on the way too.

Basically it works like this:
Enable the relevant modules:

a2enmod expires cache cache_disk

Be sure "htcacheclean" is running to clean up old disk cache. (under debian see /etc/default/apache-htcacheclean or else the relevant systemd service)
Then add to the snac virtualhost config:

    CacheRoot /var/cache/apache2/mod_cache_disk
CacheQuickHandler off
CacheLock on
while testing stuff;
CacheDetailHeader on

Instance ist not at the root, but under "/social"; so this needs to be adapted:
<LocationMatch "^/social/[^/]+/s">
CacheEnable disk
ExpiresActive On
ExpiresDefault "access plus 30 days"
</LocationMatch>
This will use the disk cache to cache everything under the /s/ Path, same as the original ngnix tutorial, Utilizing the mod_expires to generate the appropriate cache headers (for lazy ones like me), In this case caching it for 30 days.
Further reading and all options explained under https://httpd.apache.org/docs/2.4/caching.html ff

Thanks for the initial tutorial @itnotes@snac.it-notes.dragas.net

Edit:
Oh and don't hesitate to tell me what I did stupid while setting this up, maybe in nicer words, if it is. And also I can't get the markdown Code formatting working apparently. Well. Sorry for all the edits.