Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

worgor's avatar

Laravel API calls slow

Hello,

i'm currently trying to figure out why my Laravel REST API which is running on a windows machine and WAMP Stack ist taking at least 150 ms to respond - i tried it with a simple "ping" which is responding a "pong"

public function pingServer() {
    return "pong";
}

The controller has no auth, so pretty plain, and when trying this via postman sometimes it really takes over a second than 150 ms, then 200 ms, 300 ms, 200ms, 100ms, 400ms ... and so on ... after 30 times of calling this simple service i nerver got under 150 ms and it was more like 200-300 ms ... and sometimes just 1.21 secs or so,

I tried to optimize the Apache 2.4.39 inside the Wamp installation, changed to PHP 8.x but nothing really helped a lot - where could or should i start to optimize these calls since there are timecritical calls there.

The System is a Windows 10 with 32 GB RAM and there is not really much going on so i doubt it is a memory problem.

Kind regards Andy

0 likes
11 replies
vincent15000's avatar

Are you sure that it's only due to the API and not perhaps to the database ?

Sinnbeck's avatar

How about using a Linux server instead? Php was built to run on Linux so I would imagine that might help a bit :)

2 likes
worgor's avatar

@Sinnbeck definitly - i would rater use linux but our client mostly uses windows machines ...

Sinnbeck's avatar

@worgor then maybe look into iis. It's not made for php but at least it's made for production. Might be rather expensive though

worgor's avatar

@Tray2 So a single Apache + PHP + MySQL should be faster on Windows? I've not tried it out since normally we deploy this Stuff on Linux ... Thank you very much!

1 like
Tray2's avatar

@worgor It should be yes, since all the bundles have some stuff that isn't used in prod, The best would be to deploy to a linux host though.

1 like

Please or to participate in this conversation.