the-benchmarker / web-frameworks

Which is the fastest web framework?
MIT License
6.92k stars 644 forks source link

[Python] HappyX hidden #6676

Open waghanza opened 10 months ago

waghanza commented 10 months ago

Hi @Ethosa,

Inside the container, I have

root@1c3c1061fd6d:/usr/src/app# python server.py
Enable auto translate:       false
Enable httpbeast:            false
Enable httpx:                true
Enable MicroAsyncHttpServer: false
[2023-08-30 at 16:42:06]:INFO Server started at http://0.0.0.0:3000
Fatal glibc error: malloc assertion failure in __libc_realloc: !newp || chunk_is_mmapped (mem2chunk (newp)) || ar_ptr == arena_for_chunk (mem2chunk (newp))
Traceback (most recent call last)
/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system.nim(568) eventLoop
/home/runner/.nimble/pkgs2/httpx-0.3.7-6e0fc3133fbd20530d53ab2792e93d3151387b10/httpx.nim(478) processEvents
/home/runner/.choosenim/toolchains/nim-2.0.0/lib/core/macros.nim(736) handleRequest (Async)
/home/runner/work/happyx/happyx/src/happyx/bindings/python_types.nim(119) initHttpRequest
/home/runner/work/happyx/happyx/src/happyx/bindings/python_types.nim(94) toPPyObject
/home/runner/.nimble/pkgs2/nimpy-0.2.0-a4235a2223d85735e9e8cd875429982d7374b3af/nimpy/nim_py_marshalling.nim(94) nimValueToPy
/home/runner/.nimble/pkgs2/nimpy-0.2.0-a4235a2223d85735e9e8cd875429982d7374b3af/nimpy/nim_py_marshalling.nim(84) nimValueToPy
/home/runner/.nimble/pkgs2/nimpy-0.2.0-a4235a2223d85735e9e8cd875429982d7374b3af/nimpy/nim_py_marshalling.nim(24) nimValueToPy
SIGABRT: Abnormal termination.
realloc(): invalid next size
Aborted (core dumped)
Ethosa commented 10 months ago

Try to update happyx to 2.8. I disable -d:useMalloc for python binds.

Ethosa commented 10 months ago

https://pypi.org/project/happyx/2.8.0/

waghanza commented 10 months ago

I have the same issue that with some D frameworks

Running 15s test @ http://172.17.0.2:3000/user/0
  8 threads and 512 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     0.00us    0.00us   0.00us    -nan%
    Req/Sec     0.00      0.00     0.00      -nan%
  0 requests in 15.06s, 0.00B read
  Socket errors: connect 0, read 1441, write 38281, timeout 0
Requests/sec:      0.00
Transfer/sec:       0.00B

read socket error

waghanza commented 10 months ago
/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system.nim(568) eventLoop
/home/runner/.nimble/pkgs2/httpx-0.3.7-6e0fc3133fbd20530d53ab2792e93d3151387b10/httpx.nim(478) processEvents
/home/runner/.choosenim/toolchains/nim-2.0.0/lib/core/macros.nim(736) handleRequest (Async)
/home/runner/.nimble/pkgs2/nimpy-0.2.0-a4235a2223d85735e9e8cd875429982d7374b3af/nimpy.nim(867) getAttr
/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system.nim(98) raisePythonError
[[reraised from:
/home/runner/.nimble/pkgs2/httpx-0.3.7-6e0fc3133fbd20530d53ab2792e93d3151387b10/httpx.nim(575) eventLoop
/home/runner/.choosenim/toolchains/nim-2.0.0/lib/pure/asyncdispatch.nim(1711) poll
/home/runner/.choosenim/toolchains/nim-2.0.0/lib/pure/asyncdispatch.nim(1452) runOnce
/home/runner/.choosenim/toolchains/nim-2.0.0/lib/pure/asyncdispatch.nim(269) processPendingCallbacks
/home/runner/.choosenim/toolchains/nim-2.0.0/lib/pure/asyncfutures.nim(266) :anonymous
/home/runner/.nimble/pkgs2/httpx-0.3.7-6e0fc3133fbd20530d53ab2792e93d3151387b10/httpx.nim(483) :anonymous
/home/runner/.nimble/pkgs2/httpx-0.3.7-6e0fc3133fbd20530d53ab2792e93d3151387b10/httpx.nim(332) onRequestFutureComplete
]]
Error: unhandled exception: <class 'AttributeError'>: 'code' object has no attribute 'None' [Exception]
Ethosa commented 10 months ago

Strange, usually Python throws exception like this

'NoneType` hasn't attribute '...'

But in this situation we got

'code' object has no attribute 'None'

🤔

ccostello97 commented 9 months ago

Upvoted, would really like to see this to compare performance with Nim Happyx