I see some interaction at the dispatcher:
[DEBUG] [08/04/2019 07:19:47.530] [spray-server-akka.actor.default-dispatcher-4] [Http2ServerDemux(akka://spray-server)] [563] sending 10 bytes, endStream = false, remaining buffer [0], remaining stream-level WINDOW [1048502]
[DEBUG] [08/04/2019 07:19:47.530] [spray-server-akka.actor.default-dispatcher-4] [Http2ServerDemux(akka://spray-server)] Changing state from WaitingForData to Idle
[DEBUG] [08/04/2019 07:19:47.530] [spray-server-akka.actor.default-dispatcher-4] [Http2ServerDemux(akka://spray-server)] Changing state from Idle to WaitingForData
I print the time my API took using logAfter and it should 50+ msec. (it was 58 here)
And then I see the send of size as noted by the browser.
[DEBUG] [08/04/2019 07:19:47.647] [spray-server-akka.actor.default-dispatcher-4] [Http2ServerDemux(akka://spray-server)] Changing state from Idle to WaitingForData
[DEBUG] [08/04/2019 07:19:47.647] [spray-server-akka.actor.default-dispatcher-4] [Http2ServerDemux(akka://spray-server)] [569] buffered 10 bytes
[DEBUG] [08/04/2019 07:19:47.647] [spray-server-akka.actor.default-dispatcher-4] [Http2ServerDemux(akka://spray-server)] [569] sending 10 bytes, endStream = false, remaining buffer [0], remaining stream-level WINDOW [1048513]
And the browser will report a time of 500+msec. I tried Safari/Chrome/Edge all on the Mac. How do I debug where else those time was spent? It is using gzip, does gzip happen after the logs for send? Tried removing gzip and that didn’t make a different either. Tried changing the default dispatcher from fork-join to affinity-pool-executor and that didn’t make any difference. I am within the data center and so network is good. Thanks much