Skip to content

Commit 2c818d7

Browse files
Reduce sleep between reading server logs to improve performance for heavy-logging Laravel application using a stderr/stdout logging driver. (#902)
* Add configurable sleep between server output iterations * Update InteractsWithServers.php --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent 2a5028a commit 2c818d7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Commands/Concerns/InteractsWithServers.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ protected function runServer($server, $inspector, $type)
2828
$watcher = $this->startServerWatcher();
2929

3030
try {
31+
$usleepBetweenIterations = config('octane.usleep_between_writing_server_output') ??
32+
$_ENV['LARAVEL_OCTANE_USLEEP_BETWEEN_WRITING_SERVER_OUTPUT'] ??
33+
10 * 1000;
34+
3135
while ($server->isRunning()) {
3236
$this->writeServerOutput($server);
3337

@@ -45,7 +49,7 @@ protected function runServer($server, $inspector, $type)
4549
return 1;
4650
}
4751

48-
usleep(500 * 1000);
52+
usleep($usleepBetweenIterations);
4953
}
5054

5155
$this->writeServerOutput($server);

0 commit comments

Comments
 (0)