# Debugging Julia HTTP Package Performance bottleneck

**URL:** <https://discourse.julialang.org/t/debugging-julia-http-package-performance-bottleneck/42739>\
**Category:** Performance\
**Created:** [July 8, 2020, 3:34pm UTC](https://discourse.julialang.org/t/debugging-julia-http-package-performance-bottleneck/42739 "2020-07-08T15:34:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dilipjain](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilipjain/32/8527_2.png) [@dilipjain](https://discourse.julialang.org/u/dilipjain)\
**Post date:** [July 8, 2020, 3:34pm UTC](https://discourse.julialang.org/t/debugging-julia-http-package-performance-bottleneck/42739/1 "2020-07-08T15:34:51Z")

</div>

I was doing performance analysis of [Julia HTTP server](https://github.com/JuliaWeb/HTTP.jl). A simple HelloWorld API gives around 4K Request/second(1 Core, Max CPU Utilization = 50%). Since the CPU utilisation of Julia process is not 100% I suspect there is some other bottleneck in the HTTP library code. Any pointers on how to go about debugging this?

Code

```julia
using HTTP

HTTP.serve() do request::HTTP.Request
    return HTTP.Response("Hello")
end

```

wrk load test

 ![Screenshot 2020-07-08 at 8.20.53 PM](https://global.discourse-cdn.com/julialang/original/3X/c/8/c8771fff77cc18508d599f76c312c0be0064f03e.png)

---

<div class="post-metadata">

**Author:** ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Post date:** [July 8, 2020, 5:49pm UTC](https://discourse.julialang.org/t/debugging-julia-http-package-performance-bottleneck/42739/2 "2020-07-08T17:49:53Z")

</div>

You might want to take a look at:

> [@HTTP.jl doesn't seem to be good at handling over 1k concurrent requests, in comparison to an alternative in Python?](https://discourse.julialang.org/t/http-jl-doesnt-seem-to-be-good-at-handling-over-1k-concurrent-requests-in-comparison-to-an-alternative-in-python/38281):
>
> I’m implementing an simple API server that is supposed to handle over concurrent 1k requests at a time. I have a code like below: using HTTP: @register, Response, handle const HEADERS = ["Content-Type" =\> "application/json"] bench\_start\_handler(req) = nothing hoge\_handler(req, body) = ... # return JSON string ... # another handler body bench\_end\_handler(req) = nothing const router = HTTP.Router() @register(router, "GET", "/bench\_start", bench\_start\_handler) @register(router, "POST", "/hoge"…

That goes with threading, not sure if want to go there, but some of the concepts might work well for the single thread case.
