Solve other issues like large response payload, number of queries, number of hydrated models and TTFB will come down.
Slow Response with Lumen (High TTFB)
Hello :)
I've been looking for days for a solution, but I'm getting nowhere. Maybe somebody can help me or give me tips where to find the error.
I have a lumen backend with which I get the data from the database and send it to my angular frontend. My problem is that the response time is already very large, although I sometimes only fetch a few data. Following example:
$query = \DB::table('ip_netztyp')
->orderBy('netztyp')
->get();
return $query;
This is my db query. It returns 16 values from the table like this:
{ "id": 10, "netztyp": "DMZ", "active": 1 }, { "id": 13, "netztyp": "LAN", "active": 1 }, ...
But the response times in Chrome Dev Tab are between 200ms - 300ms. My Postman test says, that 90 % of the time is "transfer start".. The DB request are about 0.0013 sec.
So I don't think the db is to slow but why is the lumen response so slow? I don't think that's normal.
When I runnig my setup in a docker container the TTFB is > 1,5 sec...
How can I troubleshoot the issue?
Please or to participate in this conversation.