Skip to content

Piero Bosio Social Web Site Personale Logo Fediverso

Social Forum federato con il resto del mondo. Non contano le istanze, contano le persone

skavish:Unfortunately it will not solve this problem if the link to the image preview still leads to the origin server (server the link points to) because requesting this image is loading the server, not requesting the link itself

Uncategorized
3 3 0
  • skavish:

    Unfortunately it will not solve this problem if the link to the image preview still leads to the origin server (server the link points to) because requesting this image is loading the server, not requesting the link itself.

    Sure it will somewhat reduce the load, but not enough to deal with the problem.

    the link target and its image preview don't have to be on the same server.

    as for the load itself, the image probably requires more bandwidth but otherwise a request is a request. the thundering herd problem isn't caused by images vs text, it's caused by up to 30,000 requests being made within the same 60-second window, and mostly concurrent at the beginning of that window (because not every software adds a random delay). as an example, the default nginx configuration uses 1 worker process that allows 512 worker connections per process. common advice is to use 1 process per CPU core, and maybe raise the connection limit to 1024 per process. so for a typical low-spec web server or VPS, you're looking at maybe 500 - 4000 connections before nginx starts dropping them. not a problem for static assets, because even for relatively large image previews, not much work has to be done, and requests can be fulfilled quite quickly. it's more of a problem for resources that have to be dynamically generated, because that's work that the server has to repeat for each request. a cache can greatly reduce this workload for the server.

    skavish:

    we need to use some semi-centralized server which caches the link meta info and the image. This server may be implemented using custom fasp protocol, in fact we are running such server internally now and plan to open it soon.

    the "semi-centralized server" can be the origin server. you don't strictly need an intermediary, but if you trust an intermediary, it can reduce load on the origin server by effectively using the intermediary as a proxy.

    also, instead of using a custom protocol, you can use a standard one.

    thisismissem:

    I would expect the preview image to be the URL of the one cached by the Mastodon server, not the original image URL. That’s also how AT Proto / Bluesky handles the link preview images — they’re stored as blobs in your PDS and distributed via Bluesky’s CDN.

    the publisher of the AS2 resource gets to decide, so yes they can do this if they wish.

  • skavish:

    Unfortunately it will not solve this problem if the link to the image preview still leads to the origin server (server the link points to) because requesting this image is loading the server, not requesting the link itself.

    Sure it will somewhat reduce the load, but not enough to deal with the problem.

    the link target and its image preview don't have to be on the same server.

    as for the load itself, the image probably requires more bandwidth but otherwise a request is a request. the thundering herd problem isn't caused by images vs text, it's caused by up to 30,000 requests being made within the same 60-second window, and mostly concurrent at the beginning of that window (because not every software adds a random delay). as an example, the default nginx configuration uses 1 worker process that allows 512 worker connections per process. common advice is to use 1 process per CPU core, and maybe raise the connection limit to 1024 per process. so for a typical low-spec web server or VPS, you're looking at maybe 500 - 4000 connections before nginx starts dropping them. not a problem for static assets, because even for relatively large image previews, not much work has to be done, and requests can be fulfilled quite quickly. it's more of a problem for resources that have to be dynamically generated, because that's work that the server has to repeat for each request. a cache can greatly reduce this workload for the server.

    skavish:

    we need to use some semi-centralized server which caches the link meta info and the image. This server may be implemented using custom fasp protocol, in fact we are running such server internally now and plan to open it soon.

    the "semi-centralized server" can be the origin server. you don't strictly need an intermediary, but if you trust an intermediary, it can reduce load on the origin server by effectively using the intermediary as a proxy.

    also, instead of using a custom protocol, you can use a standard one.

    thisismissem:

    I would expect the preview image to be the URL of the one cached by the Mastodon server, not the original image URL. That’s also how AT Proto / Bluesky handles the link preview images — they’re stored as blobs in your PDS and distributed via Bluesky’s CDN.

    the publisher of the AS2 resource gets to decide, so yes they can do this if they wish.

    I think the best option is to include an Object derived type, like Page or Article, at the top level. Link has limited metadata. I don't think attachment -> Link -> preview -> Article is the shortest path to getting metadata shared to the client.

  • I think the best option is to include an Object derived type, like Page or Article, at the top level. Link has limited metadata. I don't think attachment -> Link -> preview -> Article is the shortest path to getting metadata shared to the client.

    evan@cosocial.ca if we're putting Page or Article at the top level (of attachment, I think you mean?), that would suggest that every link preview be given an id and managed by the publisher. That suggests some level of responsibility over the link, and all I really want to do is just fire off a hyperlink.

    So in the vast majority of cases, { attachment: [{ href: "..." }] } will do just fine, no?


Gli ultimi otto messaggi ricevuti dalla Federazione
Post suggeriti
  • My favorite recent snarky slogan.

    Uncategorized
    1
    1
    0 Votes
    1 Posts
    0 Views
    My favorite recent snarky slogan.
  • Venerdì sciopero internazionale dei porti.

    Uncategorized
    1
    0 Votes
    1 Posts
    0 Views
    Venerdì sciopero internazionale dei porti. è la prima mobilitazione unitaria di portuali europei e mediterranei nella storia@anarchia “I portuali non lavorano per la guerra“. E’ con queste parole che i sindacati di Enedep di Grecia, Lab dei Paesi Baschi, Liman-Is di Turchia, ODT del Marocco e USB in Italia hanno
  • 0 Votes
    1 Posts
    1 Views
    When Clever Hardware Hacks Bite Back: A Password Keeper Device AutopsySometimes you have this project idea in your mind that seems so simple and straightforward, and which feels just so right that you have to roll with it. Then, years later you stumble across the sad remnants of the tearful saga and the dismal failure that it portrays. Do you put it away again, like an unpleasant memory, or write it up in an article, as a tearful confession of past sins? After some coaxing by a friend, [Alessandro] worked up the courage to detail how he set about making a hardware-only password keeper, and why it failed.The idea was so simple: the device would pretend to be a keyboard and type the passwords for you. This is not that unusual, as hardware devices like the Mooltipass do something similar. Even better, it’d be constructed only out of parts lying around, including an ATtiny85 and an HD44780 display, with bit-banged USB connectivity.Prototyping the hardware on a breadboard.Overcoming the challenge of driving the LC display with one pin on the MCU required adding a 74HC595 demultiplexer and careful timing, which sort of worked when the stars aligned just right. Good enough, but what about adding new passwords?This is where things quickly skidded off the tracks in the most slapstick way possible, as [Alessandro] solved the problem of USB keyboard HID devices being technically ‘output-only’, by abusing the indicator statuses for Caps Lock, Num Lock, and Scroll Lock. By driving these from the host PC in just the right way you can use them as a sort of serial protocol. This incidentally turned out to be the most reliable part of the project.Where the project finally tripped and fell down the proverbial flight of stairs was when it came to making the bit-banged USB work reliably. As it turns out, USB is very unforgiving with its timing unlike PS/2, making for an infuriating user experience. After tossing the prototype hardware into a box, this is where the project gathered dust for the past years.If you want to give it a try yourself, maybe using an MCU that has more GPIO and perhaps even a USB hardware peripheral like the STM32F103, ESP32-S3 or something fruit-flavored, you can take a gander at the project files in the GitHub repository.We’re always happy to see projects that (ab)use the Lock status indicators, it’s always been one of our favorite keyboard hacks.hackaday.com/2026/02/07/when-c…
  • Donate, donate, donate

    Uncategorized
    30
    1
    0 Votes
    30 Posts
    4 Views
    @francina1909 donate che fa bene a voi...e a chi riceve... Perché: 1 dopo la donazione a noi danno i gettoni per il distributore automatico per prendere: una bevanda cada, un succo, una brioche, un panino e una bottiglietta d'acqua... 2 si è controllati (una volta l'anno esami completi)... 3 chi lo riceve ne ha veramente bisogno. Io ora dono 3 volte l'anno ed un piccolo calo di ferro, ma prima donavo 4 volte l'anno.