I’ve been playing with the tech to rewrite the backend here. I’ll start getting to work on doing that probably next week. And I want to move away from web sockets, combine the front end service with the backend service. will take a while but I think it will be fun to do.

  • Masterofballs@wolfballs.comOPM
    link
    fedilink
    arrow-up
    3
    ·
    2 years ago

    Its not much for a company who can afford to spin up ten containers but we are running everything in a 40 dollar compute unit. If I can reduce the trips for each request by three I would think it would be nearly three times as fast.

    I think I’m just running out of compute power.

    There are other things I could try.

    Having a really good back end rendered site is super efficient though.

    Right now a request comes in to nginx. Nginx points it to the UI nodejs service which then makes a request to the main back end service. Which speaks to postgres, returns to nodejs which renders the HTML, returns to nginx and finally sends it back to you.

    We could do all that in a single request to a rust backend and skip nginx and nodejs.

    • nutomic@wolfballs.com
      link
      fedilink
      arrow-up
      2
      ·
      2 years ago

      I find it surprising that you actually have performance problems. We used to run lemmy.ml on a 2 cpu vps for 10€ a month, without any problems. Recently we upgraded to 4 cpu due to some kind of ddos, but now resource usage is quite low (load average under 1). Maybe you can share some screenshots of htop or similar (via pm if you want).

      Its true that lemmy-ui (nodejs) is not very efficient, but in practice it seems barely noticable. And nginx is very fast, written in C.

    • iamtanmay@wolfballs.com
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      I am naive in the ways of small website development… 40$ a month is 480$ a year. Wouldn’t it be cheaper/more powerful to run on a desktop at home ? As I understand, you would have to pay for a public IP forwarding, but power would then be plenty no ?

      Is it like Wordpress, where the SQL stores path for retrieving content ? I assumed it was some document store like Mongo

      Yes, if you don’t need load balancing, nginx is in the way. I still had no idea that with <100 daily users make such a big load. I would have thought a Raspberry Pi could handle that much

      • Masterofballs@wolfballs.comOPM
        link
        fedilink
        arrow-up
        2
        ·
        2 years ago

        I only get like 20 mb up. I have all the hardware but not the bandwidth. We can handle like 10 users on that but we get a lot more traffic than that.

        • iamtanmay@wolfballs.com
          link
          fedilink
          arrow-up
          1
          ·
          2 years ago

          Assuming images are 99% of bandwidth, maybe offload it to a free image host instead of pulling it through your nginx ? No idea if its possible from a dev standpoint

          You could do daily backups of the images locally in case host is gone