akka / akka-http

The Streaming-first HTTP server/module of Akka
https://doc.akka.io/docs/akka-http
Other
1.34k stars 595 forks source link

http server stops responding requests #3322

Closed javierpajaro closed 4 years ago

javierpajaro commented 4 years ago

I am using:

akka-http_2.12 10.1.5 akka-stream_2.12 2.5.26 openjdk version "1.8.0_252"

akka-http is configured with:

http.server.max-connections = 100     
http.server.backlog = 100  
http.server.pipelining-limit = 1
http.caching.lfu-cache.max-capacity = 100

After a while, the http simply stops processing requests. CPU load, GC activity, memory, etc. is ok.

In Main the http server is created in the following way:

        final ActorMaterializer lMaterializer = ActorMaterializer.create(lSystem);
        final ConnectHttp lConnection = ConnectHttp.toHost(AppContext.getConfig().getHttpHost()
                                                         , AppContext.getConfig().getHttpPort());
        final Flow<HttpRequest, HttpResponse, NotUsed> lRouteFlow = new HttpConsumer(lSystem.startTime())
                                                                                    .routes()
                                                                                    .flow(lSystem, lMaterializer);

        Http.get(lSystem).bindAndHandle(lRouteFlow, lConnection, lMaterializer);
        AkkaManagement.get(lSystem).start();`

Requests are handled in

HttpConsumer.txt

Please help, I am getting crazy :) trying to find a solution.

jrudolph commented 4 years ago

Hi @javierpajaro,

that seems more like a question suitable for the forums at https://discuss.akka.io.

I'd first try updating to the latest versions of Akka and Akka-Http, e.g. 10.1.12 and 2.5.31 and see if the same happens there as well. Next step would be to use jstack <pid> to see if any threads are doing anything unexpected when the issue occurs. Then you could also check how many connections already are established to the server (e.g. with netstat or ss).