Code Monkey home page Code Monkey logo

Comments (3)

PhilippMDoerner avatar PhilippMDoerner commented on June 8, 2024

Currently its failing with nginx reverse proxy in the docker image with:

2022/06/17 08:23:35 [error] 201#201: *4 sendfile() failed (32: Broken pipe) while sending request to upstream, client: 172.17.0.1, server: aldrune.com, request: "POST /wiki1/api/sessionaudio/ HTTP/1.1", upstream: "http://127.0.0.1:8080/sessionaudio/", host: "localhost", referrer: "http://localhost/wiki2/sessionaudio/Aldrune/create"

No idea where that issue comes from.
In other frameworks it's an issue with buffer size.
See:
https://stackoverflow.com/questions/57522982/nginx-502-errors-consistently-with-no-application-errors
https://stackoverflow.com/questions/35725438/sendfile-failed-32-broken-pipe-while-sending-request-to-upstream-nginx-502

I did set client_body_buffer_size to 1 Mb and client_max_body_size to 2 Gb, to no avail.

There is also a source that suggests this might be a https issue:
https://www.bigbinary.com/blog/not-using-https-might-be-breaking-file-uploads
However, I do not (yet) use HTTPS and my server isn't enforcing it, so that can't be the problem

from nimstoryfont.

PhilippMDoerner avatar PhilippMDoerner commented on June 8, 2024

As of commit e21f5cf this should be fixed.
However, locally the upload takes around 4 minutes now, with upload progress events claiming the upload finishes within seconds.
The current method also starts sucking up immense amounts of memory (> 500 Mb) during this process and eats a lot of CPU power.

This appears to be a general issue according to xflywind on discord:

It seems to be a common problem for frameworks based asynchttpserver and httpbeast: https://forum.nim-lang.org/t/5829 I'm going to wrap/rewrite h2o after fixing the vm bugs (nim-lang/Nim#19902)

What's left is waiting for xflywind to fix this issue so that the file upload works fine and fast

from nimstoryfont.

PhilippMDoerner avatar PhilippMDoerner commented on June 8, 2024

Surprisingly, it's working alright as long as you compile with httpx.
This is good enough for now

Tasks

task release, "Build a production release":
--verbose
--forceBuild:on
--opt:speed
--define:release
--threads:on
--mm:orc
--deepcopy:on
--define:lto
--define:ssl
#--define:usestd # stdlib asynchttpserver
--hints:off
--outdir:"."
setCommand "c", "src/nimstoryfont.nim"

from nimstoryfont.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.