Comments (10)
Coroutines are currently disabled when using Octane. We're planning to work on adapting the framework and first party packages for it first.
from octane.
Hi @z-golly ,
I think it's related to number limit of file descriptors
on your system kernel.
Try to run ulimit -n
to see the number. You can run sudo ulimit -n 10240
to change the config temporarily to see if it works.
from octane.
@albertcht
I have tried to set it, but the error still occurs
from octane.
@z-golly may be give this a try
Increase the limit by editing /etc/sysctl.conf
and add this line to the end of the file:
fs.inotify.max_user_watches=524288
And then run sudo sysctl -p
from octane.
@taylorotwell @aftabnaveed @albertcht I didn't find this problem when I used it in the Windows Docker environment.
from octane.
When there is a database query, there is no performance improvement. This makes me feel very puzzled.
laravel version
code
/**
* @return JsonResponse
*/
public function version()
{
return response()->json(['version' => app()->version()]);
}
nginx+fpm
octane
query
code
/**
* @param Request $request
* @param $id
* @return JsonResponse
*/
public function show(Request $request, $id)
{
$request->query->set(
'with',
'jds.addresses.province,jds.addresses.city,jds.educationName,typeName,scaleName,industries,province,city'
);
$company = (new Company())->filter($request->query())->findOrFail($id);
return (new CompanyShowResource($company))->response();
}
nginx+fpm
octane
from octane.
Database queries won't by default start executing asynchronsuly you need to execute it through Octane::concurrently
use App\User;
use App\Server;
use Laravel\Octane\Facades\Octane;
[$users, $servers] = Octane::concurrently([
fn () => User::all(),
fn () => Server::all(),
]);
from octane.
All I/O operations in Laravel Octane now should still be blocking I/O. Octane::concurrently
seems using SwooleTaskDispatcher
by default. That means concurrently
now can only help you decrease total waiting time of multiple I/O operations. These I/O operations still block Swoole's task workers. It won't help boost your qps significantly.
Unless coroutine feature is fully supported in Laravel, otherwise contexts between different coroutines may lead unexpected results.
from octane.
@albertcht does that mean we won't be able to use go
functions with octane
? I am thinking if Laravel does not provide it then why not use Swoole's utility functions directly?
from octane.
Swoole::concurrently(...)
uses go()
(or actually the long version of it, see #100) under the hood. It allows you to execute multiple commands in parallel, but not in a fully asynchronous style we know from other languages like C#.
Whether Octane has an impact on request times depends on the tasks performed on the server. The more I/O is involved, the less noticeable it will be in the end. But for high traffic sites with content that can be cached easily, Octane is a great plus nonetheless.
What I'm not sure about is the Coroutine MySql Extension provided by Swoole. The documentation is lacking in my opinion, but maybe it can improve performance of queries further.
from octane.
Related Issues (20)
- Code Updates don't reflect unless the Octane Server with FrankenPHP is restarted HOT 2
- 408 Request Timeout HOT 2
- Undefined constant "LARAVEL_START" in health-up.blade HOT 4
- Roadrunner upload limit setting HOT 3
- dump() only works in cli HOT 3
- Misleading error if port is already in use HOT 1
- vulnerability question, log handler problem, database connection exception HOT 6
- Error starting octane server swoole HOT 1
- Error PHP 8.3.3 10.46.0 Undefined constant "FTP_BINARY" HOT 2
- gmp and imagick and other extensions not loaded HOT 1
- Using Octane cause an issue with repeater fields from Laravel Nova HOT 1
- Error Too few arguments to function Illuminate\Cache\CacheManager::repository() HOT 2
- Octane does not call close() on Monolog Handler HOT 2
- Octane doesn't drop connections after docker container stopped HOT 4
- Bug: Target [Illuminate\Contracts\Routing\ResponseFactory] is not instantiable while building [Illuminate\Routing\ViewController]. with Breeze / Livewire HOT 16
- Fatal error with Swoole on a PUT request with application/x-www-form-urlencoded content type HOT 1
- Undefined array key "assets" HOT 4
- Invalid signature error with temporary signed routes HOT 1
- Loses communication with worker when using `dump()` HOT 4
- Swoole in HTTP/2 mode is incompatible with chunking large responses in `SwooleClient` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from octane.